From 81475c91bdfd42c7838b9845407cd741bba58ff8 Mon Sep 17 00:00:00 2001 From: colawwj <70128817+colawwj@users.noreply.github.com> Date: Fri, 21 Jan 2022 17:16:58 +0800 Subject: [PATCH] appinsights-datacatalog-storsimple1200series-storsimple8000series-support-timeseriesinsights-trafficmanager-visualstudio-vmwarecloudsimple-track2 (#19979) * appinsights-release * datacatalog-release * storsimple1200series-release * storsimple8000series-release * support-release * timeseriesinsights-release * trafficmanager-release * visualstudio-release * appinsights-datacatalog-storsimple1200series-storsimple8000series-support-timeseriesinsights-trafficmanager-visualstudio-vmwarecloudsimple-track2 * update * update --- common/config/rush/pnpm-lock.yaml | 243 + eng/ignore-links.txt | 2 + rush.json | 47 +- .../arm-appinsights/CHANGELOG.md | 11 + .../arm-appinsights/LICENSE | 21 + .../arm-appinsights/README.md | 149 +- .../arm-appinsights/_meta.json | 7 + .../arm-appinsights/api-extractor.json | 18 + .../arm-appinsights/package.json | 101 +- .../node/my_test/recording_sample_test.js | 5 + .../review/arm-appinsights.api.md | 1779 +++++ .../arm-appinsights/rollup.config.js | 211 +- .../applicationInsightsManagementClient.ts | 219 +- ...licationInsightsManagementClientContext.ts | 66 - .../arm-appinsights/src/index.ts | 12 + .../src/models/aPIKeysMappers.ts | 14 - .../src/models/analyticsItemsMappers.ts | 13 - .../src/models/annotationsMappers.ts | 15 - .../componentAvailableFeaturesMappers.ts | 14 - .../componentCurrentBillingFeaturesMappers.ts | 13 - .../componentFeatureCapabilitiesMappers.ts | 12 - ...tLinkedStorageAccountsOperationsMappers.ts | 31 - .../src/models/componentQuotaStatusMappers.ts | 12 - .../src/models/componentsMappers.ts | 36 - .../src/models/exportConfigurationsMappers.ts | 13 - .../src/models/favoritesMappers.ts | 12 - .../arm-appinsights/src/models/index.ts | 4123 ++++------- .../src/models/liveTokenMappers.ts | 12 - .../arm-appinsights/src/models/mappers.ts | 2679 ++++--- .../src/models/myWorkbooksMappers.ts | 32 - .../src/models/operationsMappers.ts | 18 - .../arm-appinsights/src/models/parameters.ts | 556 +- ...proactiveDetectionConfigurationsMappers.ts | 30 - .../src/models/webTestLocationsMappers.ts | 13 - .../src/models/webTestsMappers.ts | 32 - .../models/workItemConfigurationsMappers.ts | 16 - .../src/models/workbooksMappers.ts | 32 - .../arm-appinsights/src/operations/aPIKeys.ts | 346 +- .../src/operations/analyticsItems.ts | 362 +- .../src/operations/annotations.ts | 401 +- .../operations/componentAvailableFeatures.ts | 97 +- .../componentCurrentBillingFeatures.ts | 176 +- .../componentFeatureCapabilities.ts | 97 +- ...omponentLinkedStorageAccountsOperations.ts | 310 +- .../src/operations/componentQuotaStatus.ts | 96 +- .../src/operations/components.ts | 767 +- .../src/operations/exportConfigurations.ts | 403 +- .../src/operations/favorites.ts | 376 +- .../arm-appinsights/src/operations/index.ts | 13 +- .../src/operations/liveToken.ts | 80 +- .../src/operations/myWorkbooks.ts | 612 +- .../src/operations/operations.ts | 253 +- .../proactiveDetectionConfigurations.ts | 257 +- .../src/operations/webTestLocations.ts | 139 +- .../src/operations/webTests.ts | 802 +- .../src/operations/workItemConfigurations.ts | 485 +- .../src/operations/workbookTemplates.ts | 286 + .../src/operations/workbooks.ts | 754 +- .../src/operationsInterfaces/aPIKeys.ts | 76 + .../operationsInterfaces/analyticsItems.ts | 82 + .../src/operationsInterfaces/annotations.ts | 81 + .../componentAvailableFeatures.ts | 27 + .../componentCurrentBillingFeatures.ts | 44 + .../componentFeatureCapabilities.ts | 27 + ...omponentLinkedStorageAccountsOperations.ts | 86 + .../componentQuotaStatus.ts | 27 + .../src/operationsInterfaces/components.ts | 131 + .../exportConfigurations.ts | 95 + .../src/operationsInterfaces/favorites.ts | 92 + .../src/operationsInterfaces/index.ts | 28 + .../src/operationsInterfaces/liveToken.ts | 22 + .../src/operationsInterfaces/myWorkbooks.ts | 95 + .../src/operationsInterfaces/operations.ts | 22 + .../proactiveDetectionConfigurations.ts | 63 + .../operationsInterfaces/webTestLocations.ts | 29 + .../src/operationsInterfaces/webTests.ts | 104 + .../workItemConfigurations.ts | 109 + .../operationsInterfaces/workbookTemplates.ts | 80 + .../src/operationsInterfaces/workbooks.ts | 120 + .../arm-appinsights/test/sampleTest.ts | 48 + .../arm-appinsights/tsconfig.json | 6 +- sdk/applicationinsights/ci.yml | 30 + sdk/datacatalog/arm-datacatalog/CHANGELOG.md | 11 + sdk/datacatalog/arm-datacatalog/LICENSE | 21 + sdk/datacatalog/arm-datacatalog/README.md | 149 +- sdk/datacatalog/arm-datacatalog/_meta.json | 7 + .../arm-datacatalog/api-extractor.json | 18 + sdk/datacatalog/arm-datacatalog/package.json | 105 +- .../node/my_test/recording_sample_test.js | 5 + .../review/arm-datacatalog.api.md | 157 + .../arm-datacatalog/rollup.config.js | 211 +- .../src/dataCatalogRestClient.ts | 111 +- .../src/dataCatalogRestClientContext.ts | 75 - sdk/datacatalog/arm-datacatalog/src/index.ts | 11 + .../arm-datacatalog/src/lroImpl.ts | 34 + .../src/models/aDCCatalogsMappers.ts | 19 - .../src/models/aDCOperationsMappers.ts | 17 - .../arm-datacatalog/src/models/index.ts | 360 +- .../arm-datacatalog/src/models/mappers.ts | 231 +- .../arm-datacatalog/src/models/parameters.ts | 84 +- .../src/operations/aDCCatalogs.ts | 449 +- .../src/operations/aDCOperations.ts | 76 +- .../arm-datacatalog/src/operations/index.ts | 8 +- .../src/operationsInterfaces/aDCCatalogs.ts | 93 + .../src/operationsInterfaces/aDCOperations.ts | 23 + .../src/operationsInterfaces/index.ts | 10 + .../arm-datacatalog/test/sampleTest.ts | 48 + sdk/datacatalog/arm-datacatalog/tsconfig.json | 8 +- sdk/datacatalog/ci.yml | 30 + .../arm-storsimple1200series/CHANGELOG.md | 11 + .../arm-storsimple1200series/LICENSE | 21 + .../arm-storsimple1200series/README.md | 145 +- .../arm-storsimple1200series/_meta.json | 7 + .../api-extractor.json | 18 + .../arm-storsimple1200series/package.json | 116 +- .../node/my_test/recording_sample_test.js | 5 + .../review/arm-storsimple1200series.api.md | 1708 +++++ .../arm-storsimple1200series/rollup.config.js | 211 +- .../arm-storsimple1200series/sample.env | 4 + .../accessControlRecordsCreateOrUpdate.ts | 43 + .../samples-dev/accessControlRecordsDelete.ts | 35 + .../samples-dev/accessControlRecordsGet.ts | 35 + .../accessControlRecordsListByManager.ts | 36 + .../samples-dev/alertsClear.ts | 42 + .../samples-dev/alertsListByManager.ts | 39 + .../samples-dev/alertsSendTestEmail.ts | 42 + .../backupScheduleGroupsCreateOrUpdate.ts | 45 + .../samples-dev/backupScheduleGroupsDelete.ts | 37 + .../samples-dev/backupScheduleGroupsGet.ts | 37 + .../backupScheduleGroupsListByDevice.ts | 38 + .../samples-dev/backupsClone.ts | 59 + .../samples-dev/backupsDelete.ts | 37 + .../samples-dev/backupsListByDevice.ts | 41 + .../samples-dev/backupsListByManager.ts | 40 + .../samples-dev/chapSettingsCreateOrUpdate.ts | 50 + .../samples-dev/chapSettingsDelete.ts | 37 + .../samples-dev/chapSettingsGet.ts | 37 + .../samples-dev/chapSettingsListByDevice.ts | 38 + .../devicesCreateOrUpdateAlertSettings.ts | 46 + .../devicesCreateOrUpdateSecuritySettings.ts | 47 + .../samples-dev/devicesDeactivate.ts | 35 + .../samples-dev/devicesDelete.ts | 35 + .../samples-dev/devicesDownloadUpdates.ts | 35 + .../samples-dev/devicesFailover.ts | 48 + .../samples-dev/devicesGet.ts | 35 + .../samples-dev/devicesGetAlertSettings.ts | 35 + .../samples-dev/devicesGetNetworkSettings.ts | 35 + .../samples-dev/devicesGetTimeSettings.ts | 35 + .../samples-dev/devicesGetUpdateSummary.ts | 35 + .../samples-dev/devicesInstallUpdates.ts | 35 + .../samples-dev/devicesListByManager.ts | 36 + .../samples-dev/devicesListFailoverTarget.ts | 38 + .../devicesListMetricDefinition.ts | 38 + .../samples-dev/devicesListMetrics.ts | 42 + .../samples-dev/devicesPatch.ts | 42 + .../samples-dev/devicesScanForUpdates.ts | 35 + .../samples-dev/fileServersBackupNow.ts | 37 + .../samples-dev/fileServersCreateOrUpdate.ts | 50 + .../samples-dev/fileServersDelete.ts | 37 + .../samples-dev/fileServersGet.ts | 37 + .../samples-dev/fileServersListByDevice.ts | 38 + .../samples-dev/fileServersListByManager.ts | 36 + .../fileServersListMetricDefinition.ts | 40 + .../samples-dev/fileServersListMetrics.ts | 44 + .../samples-dev/fileSharesCreateOrUpdate.ts | 52 + .../samples-dev/fileSharesDelete.ts | 39 + .../samples-dev/fileSharesGet.ts | 39 + .../samples-dev/fileSharesListByDevice.ts | 38 + .../samples-dev/fileSharesListByFileServer.ts | 40 + .../fileSharesListMetricDefinition.ts | 42 + .../samples-dev/fileSharesListMetrics.ts | 46 + .../samples-dev/iscsiDisksCreateOrUpdate.ts | 52 + .../samples-dev/iscsiDisksDelete.ts | 39 + .../samples-dev/iscsiDisksGet.ts | 39 + .../samples-dev/iscsiDisksListByDevice.ts | 38 + .../iscsiDisksListByIscsiServer.ts | 40 + .../iscsiDisksListMetricDefinition.ts | 42 + .../samples-dev/iscsiDisksListMetrics.ts | 46 + .../samples-dev/iscsiServersBackupNow.ts | 37 + .../samples-dev/iscsiServersCreateOrUpdate.ts | 54 + .../samples-dev/iscsiServersDelete.ts | 37 + .../samples-dev/iscsiServersGet.ts | 37 + .../samples-dev/iscsiServersListByDevice.ts | 38 + .../samples-dev/iscsiServersListByManager.ts | 36 + .../iscsiServersListMetricDefinition.ts | 40 + .../samples-dev/iscsiServersListMetrics.ts | 44 + .../samples-dev/jobsGet.ts | 37 + .../samples-dev/jobsListByDevice.ts | 41 + .../samples-dev/jobsListByManager.ts | 39 + .../samples-dev/managersCreateExtendedInfo.ts | 46 + .../samples-dev/managersCreateOrUpdate.ts | 43 + .../samples-dev/managersDelete.ts | 30 + .../samples-dev/managersDeleteExtendedInfo.ts | 33 + .../samples-dev/managersGet.ts | 30 + .../samples-dev/managersGetEncryptionKey.ts | 33 + .../managersGetEncryptionSettings.ts | 33 + .../samples-dev/managersGetExtendedInfo.ts | 33 + .../samples-dev/managersList.ts | 31 + .../managersListByResourceGroup.ts | 34 + .../managersListMetricDefinition.ts | 36 + .../samples-dev/managersListMetrics.ts | 40 + .../samples-dev/managersUpdate.ts | 38 + .../samples-dev/managersUpdateExtendedInfo.ts | 48 + .../managersUploadRegistrationCertificate.ts | 47 + .../samples-dev/operationsList.ts | 31 + ...storageAccountCredentialsCreateOrUpdate.ts | 54 + .../storageAccountCredentialsDelete.ts | 35 + .../storageAccountCredentialsGet.ts | 35 + .../storageAccountCredentialsListByManager.ts | 36 + .../storageDomainsCreateOrUpdate.ts | 46 + .../samples-dev/storageDomainsDelete.ts | 35 + .../samples-dev/storageDomainsGet.ts | 35 + .../storageDomainsListByManager.ts | 36 + .../samples/v2/javascript/README.md | 236 + .../accessControlRecordsCreateOrUpdate.js | 40 + .../javascript/accessControlRecordsDelete.js | 35 + .../v2/javascript/accessControlRecordsGet.js | 35 + .../accessControlRecordsListByManager.js | 36 + .../samples/v2/javascript/alertsClear.js | 35 + .../v2/javascript/alertsListByManager.js | 35 + .../v2/javascript/alertsSendTestEmail.js | 39 + .../backupScheduleGroupsCreateOrUpdate.js | 42 + .../javascript/backupScheduleGroupsDelete.js | 37 + .../v2/javascript/backupScheduleGroupsGet.js | 37 + .../backupScheduleGroupsListByDevice.js | 38 + .../samples/v2/javascript/backupsClone.js | 56 + .../samples/v2/javascript/backupsDelete.js | 37 + .../v2/javascript/backupsListByDevice.js | 41 + .../v2/javascript/backupsListByManager.js | 36 + .../javascript/chapSettingsCreateOrUpdate.js | 46 + .../v2/javascript/chapSettingsDelete.js | 37 + .../samples/v2/javascript/chapSettingsGet.js | 37 + .../v2/javascript/chapSettingsListByDevice.js | 38 + .../devicesCreateOrUpdateAlertSettings.js | 43 + .../devicesCreateOrUpdateSecuritySettings.js | 43 + .../v2/javascript/devicesDeactivate.js | 35 + .../samples/v2/javascript/devicesDelete.js | 35 + .../v2/javascript/devicesDownloadUpdates.js | 35 + .../samples/v2/javascript/devicesFailover.js | 45 + .../samples/v2/javascript/devicesGet.js | 31 + .../v2/javascript/devicesGetAlertSettings.js | 31 + .../javascript/devicesGetNetworkSettings.js | 35 + .../v2/javascript/devicesGetTimeSettings.js | 31 + .../v2/javascript/devicesGetUpdateSummary.js | 31 + .../v2/javascript/devicesInstallUpdates.js | 35 + .../v2/javascript/devicesListByManager.js | 33 + .../javascript/devicesListFailoverTarget.js | 38 + .../javascript/devicesListMetricDefinition.js | 38 + .../v2/javascript/devicesListMetrics.js | 41 + .../samples/v2/javascript/devicesPatch.js | 39 + .../v2/javascript/devicesScanForUpdates.js | 35 + .../v2/javascript/fileServersBackupNow.js | 37 + .../javascript/fileServersCreateOrUpdate.js | 47 + .../v2/javascript/fileServersDelete.js | 37 + .../samples/v2/javascript/fileServersGet.js | 37 + .../v2/javascript/fileServersListByDevice.js | 38 + .../v2/javascript/fileServersListByManager.js | 33 + .../fileServersListMetricDefinition.js | 40 + .../v2/javascript/fileServersListMetrics.js | 43 + .../v2/javascript/fileSharesCreateOrUpdate.js | 49 + .../samples/v2/javascript/fileSharesDelete.js | 39 + .../samples/v2/javascript/fileSharesGet.js | 39 + .../v2/javascript/fileSharesListByDevice.js | 38 + .../javascript/fileSharesListByFileServer.js | 40 + .../fileSharesListMetricDefinition.js | 42 + .../v2/javascript/fileSharesListMetrics.js | 45 + .../v2/javascript/iscsiDisksCreateOrUpdate.js | 49 + .../samples/v2/javascript/iscsiDisksDelete.js | 39 + .../samples/v2/javascript/iscsiDisksGet.js | 39 + .../v2/javascript/iscsiDisksListByDevice.js | 38 + .../javascript/iscsiDisksListByIscsiServer.js | 40 + .../iscsiDisksListMetricDefinition.js | 42 + .../v2/javascript/iscsiDisksListMetrics.js | 45 + .../v2/javascript/iscsiServersBackupNow.js | 37 + .../javascript/iscsiServersCreateOrUpdate.js | 50 + .../v2/javascript/iscsiServersDelete.js | 37 + .../samples/v2/javascript/iscsiServersGet.js | 37 + .../v2/javascript/iscsiServersListByDevice.js | 38 + .../javascript/iscsiServersListByManager.js | 33 + .../iscsiServersListMetricDefinition.js | 40 + .../v2/javascript/iscsiServersListMetrics.js | 43 + .../samples/v2/javascript/jobsGet.js | 32 + .../samples/v2/javascript/jobsListByDevice.js | 41 + .../v2/javascript/jobsListByManager.js | 35 + .../javascript/managersCreateExtendedInfo.js | 42 + .../v2/javascript/managersCreateOrUpdate.js | 36 + .../samples/v2/javascript/managersDelete.js | 30 + .../javascript/managersDeleteExtendedInfo.js | 30 + .../samples/v2/javascript/managersGet.js | 30 + .../v2/javascript/managersGetEncryptionKey.js | 30 + .../managersGetEncryptionSettings.js | 30 + .../v2/javascript/managersGetExtendedInfo.js | 30 + .../samples/v2/javascript/managersList.js | 31 + .../javascript/managersListByResourceGroup.js | 32 + .../managersListMetricDefinition.js | 33 + .../v2/javascript/managersListMetrics.js | 35 + .../samples/v2/javascript/managersUpdate.js | 31 + .../javascript/managersUpdateExtendedInfo.js | 44 + .../managersUploadRegistrationCertificate.js | 44 + .../samples/v2/javascript/operationsList.js | 31 + .../samples/v2/javascript/package.json | 32 + .../samples/v2/javascript/sample.env | 4 + ...storageAccountCredentialsCreateOrUpdate.js | 50 + .../storageAccountCredentialsDelete.js | 35 + .../storageAccountCredentialsGet.js | 35 + .../storageAccountCredentialsListByManager.js | 36 + .../storageDomainsCreateOrUpdate.js | 43 + .../v2/javascript/storageDomainsDelete.js | 35 + .../v2/javascript/storageDomainsGet.js | 31 + .../javascript/storageDomainsListByManager.js | 33 + .../samples/v2/typescript/README.md | 249 + .../samples/v2/typescript/package.json | 41 + .../samples/v2/typescript/sample.env | 4 + .../src/accessControlRecordsCreateOrUpdate.ts | 43 + .../src/accessControlRecordsDelete.ts | 35 + .../typescript/src/accessControlRecordsGet.ts | 35 + .../src/accessControlRecordsListByManager.ts | 36 + .../samples/v2/typescript/src/alertsClear.ts | 42 + .../v2/typescript/src/alertsListByManager.ts | 39 + .../v2/typescript/src/alertsSendTestEmail.ts | 42 + .../src/backupScheduleGroupsCreateOrUpdate.ts | 45 + .../src/backupScheduleGroupsDelete.ts | 37 + .../typescript/src/backupScheduleGroupsGet.ts | 37 + .../src/backupScheduleGroupsListByDevice.ts | 38 + .../samples/v2/typescript/src/backupsClone.ts | 59 + .../v2/typescript/src/backupsDelete.ts | 37 + .../v2/typescript/src/backupsListByDevice.ts | 41 + .../v2/typescript/src/backupsListByManager.ts | 40 + .../src/chapSettingsCreateOrUpdate.ts | 50 + .../v2/typescript/src/chapSettingsDelete.ts | 37 + .../v2/typescript/src/chapSettingsGet.ts | 37 + .../src/chapSettingsListByDevice.ts | 38 + .../src/devicesCreateOrUpdateAlertSettings.ts | 46 + .../devicesCreateOrUpdateSecuritySettings.ts | 47 + .../v2/typescript/src/devicesDeactivate.ts | 35 + .../v2/typescript/src/devicesDelete.ts | 35 + .../typescript/src/devicesDownloadUpdates.ts | 35 + .../v2/typescript/src/devicesFailover.ts | 48 + .../samples/v2/typescript/src/devicesGet.ts | 35 + .../typescript/src/devicesGetAlertSettings.ts | 35 + .../src/devicesGetNetworkSettings.ts | 35 + .../typescript/src/devicesGetTimeSettings.ts | 35 + .../typescript/src/devicesGetUpdateSummary.ts | 35 + .../typescript/src/devicesInstallUpdates.ts | 35 + .../v2/typescript/src/devicesListByManager.ts | 36 + .../src/devicesListFailoverTarget.ts | 38 + .../src/devicesListMetricDefinition.ts | 38 + .../v2/typescript/src/devicesListMetrics.ts | 42 + .../samples/v2/typescript/src/devicesPatch.ts | 42 + .../typescript/src/devicesScanForUpdates.ts | 35 + .../v2/typescript/src/fileServersBackupNow.ts | 37 + .../src/fileServersCreateOrUpdate.ts | 50 + .../v2/typescript/src/fileServersDelete.ts | 37 + .../v2/typescript/src/fileServersGet.ts | 37 + .../typescript/src/fileServersListByDevice.ts | 38 + .../src/fileServersListByManager.ts | 36 + .../src/fileServersListMetricDefinition.ts | 40 + .../typescript/src/fileServersListMetrics.ts | 44 + .../src/fileSharesCreateOrUpdate.ts | 52 + .../v2/typescript/src/fileSharesDelete.ts | 39 + .../v2/typescript/src/fileSharesGet.ts | 39 + .../typescript/src/fileSharesListByDevice.ts | 38 + .../src/fileSharesListByFileServer.ts | 40 + .../src/fileSharesListMetricDefinition.ts | 42 + .../typescript/src/fileSharesListMetrics.ts | 46 + .../src/iscsiDisksCreateOrUpdate.ts | 52 + .../v2/typescript/src/iscsiDisksDelete.ts | 39 + .../v2/typescript/src/iscsiDisksGet.ts | 39 + .../typescript/src/iscsiDisksListByDevice.ts | 38 + .../src/iscsiDisksListByIscsiServer.ts | 40 + .../src/iscsiDisksListMetricDefinition.ts | 42 + .../typescript/src/iscsiDisksListMetrics.ts | 46 + .../typescript/src/iscsiServersBackupNow.ts | 37 + .../src/iscsiServersCreateOrUpdate.ts | 54 + .../v2/typescript/src/iscsiServersDelete.ts | 37 + .../v2/typescript/src/iscsiServersGet.ts | 37 + .../src/iscsiServersListByDevice.ts | 38 + .../src/iscsiServersListByManager.ts | 36 + .../src/iscsiServersListMetricDefinition.ts | 40 + .../typescript/src/iscsiServersListMetrics.ts | 44 + .../samples/v2/typescript/src/jobsGet.ts | 37 + .../v2/typescript/src/jobsListByDevice.ts | 41 + .../v2/typescript/src/jobsListByManager.ts | 39 + .../src/managersCreateExtendedInfo.ts | 46 + .../typescript/src/managersCreateOrUpdate.ts | 43 + .../v2/typescript/src/managersDelete.ts | 30 + .../src/managersDeleteExtendedInfo.ts | 33 + .../samples/v2/typescript/src/managersGet.ts | 30 + .../src/managersGetEncryptionKey.ts | 33 + .../src/managersGetEncryptionSettings.ts | 33 + .../typescript/src/managersGetExtendedInfo.ts | 33 + .../samples/v2/typescript/src/managersList.ts | 31 + .../src/managersListByResourceGroup.ts | 34 + .../src/managersListMetricDefinition.ts | 36 + .../v2/typescript/src/managersListMetrics.ts | 40 + .../v2/typescript/src/managersUpdate.ts | 38 + .../src/managersUpdateExtendedInfo.ts | 48 + .../managersUploadRegistrationCertificate.ts | 47 + .../v2/typescript/src/operationsList.ts | 31 + ...storageAccountCredentialsCreateOrUpdate.ts | 54 + .../src/storageAccountCredentialsDelete.ts | 35 + .../src/storageAccountCredentialsGet.ts | 35 + .../storageAccountCredentialsListByManager.ts | 36 + .../src/storageDomainsCreateOrUpdate.ts | 46 + .../v2/typescript/src/storageDomainsDelete.ts | 35 + .../v2/typescript/src/storageDomainsGet.ts | 35 + .../src/storageDomainsListByManager.ts | 36 + .../samples/v2/typescript/tsconfig.json | 17 + .../arm-storsimple1200series/src/index.ts | 12 + .../arm-storsimple1200series/src/lroImpl.ts | 34 + .../src/models/accessControlRecordsMappers.ts | 54 - .../src/models/alertsMappers.ts | 56 - ...ableProviderOperationsOperationsMappers.ts | 19 - .../src/models/backupScheduleGroupsMappers.ts | 54 - .../src/models/backupsMappers.ts | 55 - .../models/chapSettingsOperationsMappers.ts | 54 - .../src/models/devicesMappers.ts | 64 - .../src/models/fileServersMappers.ts | 62 - .../src/models/fileSharesMappers.ts | 62 - .../src/models/index.ts | 5609 +++++--------- .../src/models/iscsiDisksMappers.ts | 62 - .../src/models/iscsiServersMappers.ts | 62 - .../src/models/jobsMappers.ts | 54 - .../src/models/managersMappers.ts | 70 - .../src/models/mappers.ts | 3756 +++++----- .../src/models/parameters.ts | 358 +- .../storageAccountCredentialsMappers.ts | 54 - .../src/models/storageDomainsMappers.ts | 54 - .../src/operations/accessControlRecords.ts | 474 +- .../src/operations/alerts.ts | 362 +- .../availableProviderOperationsOperations.ts | 161 +- .../src/operations/backupScheduleGroups.ts | 493 +- .../src/operations/backups.ts | 688 +- .../src/operations/chapSettingsOperations.ts | 505 +- .../src/operations/devices.ts | 2092 ++++-- .../src/operations/fileServers.ts | 1072 ++- .../src/operations/fileShares.ts | 965 ++- .../src/operations/index.ts | 8 +- .../src/operations/iscsiDisks.ts | 999 ++- .../src/operations/iscsiServers.ts | 1088 ++- .../src/operations/jobs.ts | 484 +- .../src/operations/managers.ts | 1143 ++- .../operations/storageAccountCredentials.ts | 475 +- .../src/operations/storageDomains.ts | 472 +- .../accessControlRecords.ts | 109 + .../src/operationsInterfaces/alerts.ts | 61 + .../availableProviderOperationsOperations.ts | 25 + .../backupScheduleGroups.ts | 121 + .../src/operationsInterfaces/backups.ts | 115 + .../chapSettingsOperations.ts | 121 + .../src/operationsInterfaces/devices.ts | 421 ++ .../src/operationsInterfaces/fileServers.ts | 198 + .../src/operationsInterfaces/fileShares.ts | 185 + .../src/operationsInterfaces/index.ts | 23 + .../src/operationsInterfaces/iscsiDisks.ts | 185 + .../src/operationsInterfaces/iscsiServers.ts | 198 + .../src/operationsInterfaces/jobs.ts | 60 + .../src/operationsInterfaces/managers.ts | 220 + .../storageAccountCredentials.ts | 109 + .../operationsInterfaces/storageDomains.ts | 109 + .../src/storSimpleManagementClient.ts | 181 +- .../src/storSimpleManagementClientContext.ts | 62 - .../test/sampleTest.ts | 48 + .../arm-storsimple1200series/tsconfig.json | 11 +- sdk/storsimple1200series/ci.yml | 30 + .../arm-storsimple8000series/CHANGELOG.md | 11 + .../arm-storsimple8000series/LICENSE | 21 + .../arm-storsimple8000series/README.md | 145 +- .../arm-storsimple8000series/_meta.json | 7 + .../api-extractor.json | 18 + .../arm-storsimple8000series/package.json | 116 +- .../node/my_test/recording_sample_test.js | 5 + .../review/arm-storsimple8000series.api.md | 1924 +++++ .../arm-storsimple8000series/rollup.config.js | 211 +- .../arm-storsimple8000series/sample.env | 4 + .../accessControlRecordsCreateOrUpdate.ts | 45 + .../samples-dev/accessControlRecordsDelete.ts | 38 + .../samples-dev/accessControlRecordsGet.ts | 38 + .../accessControlRecordsListByManager.ts | 39 + .../samples-dev/alertsClear.ts | 45 + .../samples-dev/alertsListByManager.ts | 43 + .../samples-dev/alertsSendTestEmail.ts | 45 + .../samples-dev/backupPoliciesBackupNow.ts | 42 + .../backupPoliciesCreateOrUpdate.ts | 51 + .../samples-dev/backupPoliciesDelete.ts | 40 + .../samples-dev/backupPoliciesGet.ts | 40 + .../samples-dev/backupPoliciesListByDevice.ts | 41 + .../backupSchedulesCreateOrUpdate.ts | 58 + .../samples-dev/backupSchedulesDelete.ts | 42 + .../samples-dev/backupSchedulesGet.ts | 42 + .../backupSchedulesListByBackupPolicy.ts | 43 + .../samples-dev/backupsClone.ts | 66 + .../samples-dev/backupsDelete.ts | 40 + .../samples-dev/backupsListByDevice.ts | 45 + .../samples-dev/backupsRestore.ts | 40 + .../bandwidthSettingsCreateOrUpdate.ts | 52 + .../samples-dev/bandwidthSettingsDelete.ts | 38 + .../samples-dev/bandwidthSettingsGet.ts | 38 + .../bandwidthSettingsListByManager.ts | 39 + ...udAppliancesListSupportedConfigurations.ts | 39 + .../samples-dev/cloudAppliancesProvision.ts | 45 + ...viceSettingsCreateOrUpdateAlertSettings.ts | 48 + ...eviceSettingsCreateOrUpdateTimeSettings.ts | 47 + .../deviceSettingsGetAlertSettings.ts | 38 + .../deviceSettingsGetNetworkSettings.ts | 38 + .../deviceSettingsGetSecuritySettings.ts | 38 + .../deviceSettingsGetTimeSettings.ts | 38 + ...SettingsSyncRemotemanagementCertificate.ts | 38 + .../deviceSettingsUpdateNetworkSettings.ts | 48 + .../deviceSettingsUpdateSecuritySettings.ts | 71 + ...uthorizeForServiceEncryptionKeyRollover.ts | 38 + .../samples-dev/devicesConfigure.ts | 49 + .../samples-dev/devicesDeactivate.ts | 38 + .../samples-dev/devicesDelete.ts | 38 + .../samples-dev/devicesFailover.ts | 49 + .../samples-dev/devicesGet.ts | 41 + .../samples-dev/devicesGetUpdateSummary.ts | 38 + .../samples-dev/devicesInstallUpdates.ts | 38 + .../samples-dev/devicesListByManager.ts | 39 + .../samples-dev/devicesListFailoverSets.ts | 41 + .../samples-dev/devicesListFailoverTargets.ts | 50 + .../devicesListMetricDefinition.ts | 41 + .../samples-dev/devicesListMetrics.ts | 44 + .../samples-dev/devicesScanForUpdates.ts | 38 + .../samples-dev/devicesUpdate.ts | 45 + ...mponentGroupsChangeControllerPowerState.ts | 50 + .../hardwareComponentGroupsListByDevice.ts | 41 + .../samples-dev/jobsCancel.ts | 40 + .../samples-dev/jobsGet.ts | 40 + .../samples-dev/jobsListByDevice.ts | 44 + .../samples-dev/jobsListByManager.ts | 42 + .../samples-dev/managersCreateExtendedInfo.ts | 44 + .../samples-dev/managersCreateOrUpdate.ts | 45 + .../samples-dev/managersDelete.ts | 33 + .../samples-dev/managersDeleteExtendedInfo.ts | 36 + .../samples-dev/managersGet.ts | 33 + .../samples-dev/managersGetActivationKey.ts | 36 + .../managersGetDevicePublicEncryptionKey.ts | 38 + .../managersGetEncryptionSettings.ts | 36 + .../samples-dev/managersGetExtendedInfo.ts | 36 + .../managersGetPublicEncryptionKey.ts | 36 + .../samples-dev/managersList.ts | 34 + .../managersListByResourceGroup.ts | 37 + .../managersListFeatureSupportStatus.ts | 39 + .../managersListMetricDefinition.ts | 39 + .../samples-dev/managersListMetrics.ts | 42 + .../managersRegenerateActivationKey.ts | 36 + .../samples-dev/managersUpdate.ts | 41 + .../samples-dev/managersUpdateExtendedInfo.ts | 47 + .../samples-dev/operationsList.ts | 34 + ...storageAccountCredentialsCreateOrUpdate.ts | 52 + .../storageAccountCredentialsDelete.ts | 38 + .../storageAccountCredentialsGet.ts | 38 + .../storageAccountCredentialsListByManager.ts | 39 + .../volumeContainersCreateOrUpdate.ts | 56 + .../samples-dev/volumeContainersDelete.ts | 40 + .../samples-dev/volumeContainersGet.ts | 40 + .../volumeContainersListByDevice.ts | 41 + .../volumeContainersListMetricDefinition.ts | 43 + .../volumeContainersListMetrics.ts | 46 + .../samples-dev/volumesCreateOrUpdate.ts | 55 + .../samples-dev/volumesDelete.ts | 42 + .../samples-dev/volumesGet.ts | 42 + .../samples-dev/volumesListByDevice.ts | 41 + .../volumesListByVolumeContainer.ts | 43 + .../volumesListMetricDefinition.ts | 45 + .../samples-dev/volumesListMetrics.ts | 48 + .../samples/v2/javascript/README.md | 232 + .../accessControlRecordsCreateOrUpdate.js | 39 + .../javascript/accessControlRecordsDelete.js | 35 + .../v2/javascript/accessControlRecordsGet.js | 35 + .../accessControlRecordsListByManager.js | 36 + .../samples/v2/javascript/alertsClear.js | 35 + .../v2/javascript/alertsListByManager.js | 36 + .../v2/javascript/alertsSendTestEmail.js | 39 + .../v2/javascript/backupPoliciesBackupNow.js | 39 + .../backupPoliciesCreateOrUpdate.js | 45 + .../v2/javascript/backupPoliciesDelete.js | 37 + .../v2/javascript/backupPoliciesGet.js | 37 + .../javascript/backupPoliciesListByDevice.js | 38 + .../backupSchedulesCreateOrUpdate.js | 52 + .../v2/javascript/backupSchedulesDelete.js | 39 + .../v2/javascript/backupSchedulesGet.js | 39 + .../backupSchedulesListByBackupPolicy.js | 40 + .../samples/v2/javascript/backupsClone.js | 59 + .../samples/v2/javascript/backupsDelete.js | 37 + .../v2/javascript/backupsListByDevice.js | 42 + .../samples/v2/javascript/backupsRestore.js | 37 + .../bandwidthSettingsCreateOrUpdate.js | 46 + .../v2/javascript/bandwidthSettingsDelete.js | 35 + .../v2/javascript/bandwidthSettingsGet.js | 35 + .../bandwidthSettingsListByManager.js | 33 + ...udAppliancesListSupportedConfigurations.js | 36 + .../v2/javascript/cloudAppliancesProvision.js | 39 + ...viceSettingsCreateOrUpdateAlertSettings.js | 42 + ...eviceSettingsCreateOrUpdateTimeSettings.js | 41 + .../deviceSettingsGetAlertSettings.js | 35 + .../deviceSettingsGetNetworkSettings.js | 35 + .../deviceSettingsGetSecuritySettings.js | 35 + .../deviceSettingsGetTimeSettings.js | 35 + ...SettingsSyncRemotemanagementCertificate.js | 35 + .../deviceSettingsUpdateNetworkSettings.js | 42 + .../deviceSettingsUpdateSecuritySettings.js | 65 + ...uthorizeForServiceEncryptionKeyRollover.js | 35 + .../samples/v2/javascript/devicesConfigure.js | 43 + .../v2/javascript/devicesDeactivate.js | 35 + .../samples/v2/javascript/devicesDelete.js | 35 + .../samples/v2/javascript/devicesFailover.js | 43 + .../samples/v2/javascript/devicesGet.js | 33 + .../v2/javascript/devicesGetUpdateSummary.js | 31 + .../v2/javascript/devicesInstallUpdates.js | 35 + .../v2/javascript/devicesListByManager.js | 33 + .../v2/javascript/devicesListFailoverSets.js | 38 + .../javascript/devicesListFailoverTargets.js | 44 + .../javascript/devicesListMetricDefinition.js | 38 + .../v2/javascript/devicesListMetrics.js | 41 + .../v2/javascript/devicesScanForUpdates.js | 35 + .../samples/v2/javascript/devicesUpdate.js | 39 + ...mponentGroupsChangeControllerPowerState.js | 44 + .../hardwareComponentGroupsListByDevice.js | 38 + .../samples/v2/javascript/jobsCancel.js | 37 + .../samples/v2/javascript/jobsGet.js | 32 + .../samples/v2/javascript/jobsListByDevice.js | 41 + .../v2/javascript/jobsListByManager.js | 35 + .../javascript/managersCreateExtendedInfo.js | 38 + .../v2/javascript/managersCreateOrUpdate.js | 35 + .../samples/v2/javascript/managersDelete.js | 30 + .../javascript/managersDeleteExtendedInfo.js | 30 + .../samples/v2/javascript/managersGet.js | 30 + .../v2/javascript/managersGetActivationKey.js | 30 + .../managersGetDevicePublicEncryptionKey.js | 35 + .../managersGetEncryptionSettings.js | 30 + .../v2/javascript/managersGetExtendedInfo.js | 30 + .../managersGetPublicEncryptionKey.js | 30 + .../samples/v2/javascript/managersList.js | 31 + .../javascript/managersListByResourceGroup.js | 32 + .../managersListFeatureSupportStatus.js | 33 + .../managersListMetricDefinition.js | 33 + .../v2/javascript/managersListMetrics.js | 35 + .../managersRegenerateActivationKey.js | 30 + .../samples/v2/javascript/managersUpdate.js | 31 + .../javascript/managersUpdateExtendedInfo.js | 41 + .../samples/v2/javascript/operationsList.js | 31 + .../samples/v2/javascript/package.json | 32 + .../samples/v2/javascript/sample.env | 4 + ...storageAccountCredentialsCreateOrUpdate.js | 46 + .../storageAccountCredentialsDelete.js | 35 + .../storageAccountCredentialsGet.js | 35 + .../storageAccountCredentialsListByManager.js | 36 + .../volumeContainersCreateOrUpdate.js | 50 + .../v2/javascript/volumeContainersDelete.js | 37 + .../v2/javascript/volumeContainersGet.js | 37 + .../volumeContainersListByDevice.js | 38 + .../volumeContainersListMetricDefinition.js | 40 + .../javascript/volumeContainersListMetrics.js | 43 + .../v2/javascript/volumesCreateOrUpdate.js | 49 + .../samples/v2/javascript/volumesDelete.js | 39 + .../samples/v2/javascript/volumesGet.js | 39 + .../v2/javascript/volumesListByDevice.js | 34 + .../volumesListByVolumeContainer.js | 40 + .../javascript/volumesListMetricDefinition.js | 42 + .../v2/javascript/volumesListMetrics.js | 45 + .../samples/v2/typescript/README.md | 245 + .../samples/v2/typescript/package.json | 41 + .../samples/v2/typescript/sample.env | 4 + .../src/accessControlRecordsCreateOrUpdate.ts | 45 + .../src/accessControlRecordsDelete.ts | 38 + .../typescript/src/accessControlRecordsGet.ts | 38 + .../src/accessControlRecordsListByManager.ts | 39 + .../samples/v2/typescript/src/alertsClear.ts | 45 + .../v2/typescript/src/alertsListByManager.ts | 43 + .../v2/typescript/src/alertsSendTestEmail.ts | 45 + .../typescript/src/backupPoliciesBackupNow.ts | 42 + .../src/backupPoliciesCreateOrUpdate.ts | 51 + .../v2/typescript/src/backupPoliciesDelete.ts | 40 + .../v2/typescript/src/backupPoliciesGet.ts | 40 + .../src/backupPoliciesListByDevice.ts | 41 + .../src/backupSchedulesCreateOrUpdate.ts | 58 + .../typescript/src/backupSchedulesDelete.ts | 42 + .../v2/typescript/src/backupSchedulesGet.ts | 42 + .../src/backupSchedulesListByBackupPolicy.ts | 43 + .../samples/v2/typescript/src/backupsClone.ts | 66 + .../v2/typescript/src/backupsDelete.ts | 40 + .../v2/typescript/src/backupsListByDevice.ts | 45 + .../v2/typescript/src/backupsRestore.ts | 40 + .../src/bandwidthSettingsCreateOrUpdate.ts | 52 + .../typescript/src/bandwidthSettingsDelete.ts | 38 + .../v2/typescript/src/bandwidthSettingsGet.ts | 38 + .../src/bandwidthSettingsListByManager.ts | 39 + ...udAppliancesListSupportedConfigurations.ts | 39 + .../src/cloudAppliancesProvision.ts | 45 + ...viceSettingsCreateOrUpdateAlertSettings.ts | 48 + ...eviceSettingsCreateOrUpdateTimeSettings.ts | 47 + .../src/deviceSettingsGetAlertSettings.ts | 38 + .../src/deviceSettingsGetNetworkSettings.ts | 38 + .../src/deviceSettingsGetSecuritySettings.ts | 38 + .../src/deviceSettingsGetTimeSettings.ts | 38 + ...SettingsSyncRemotemanagementCertificate.ts | 38 + .../deviceSettingsUpdateNetworkSettings.ts | 48 + .../deviceSettingsUpdateSecuritySettings.ts | 71 + ...uthorizeForServiceEncryptionKeyRollover.ts | 38 + .../v2/typescript/src/devicesConfigure.ts | 49 + .../v2/typescript/src/devicesDeactivate.ts | 38 + .../v2/typescript/src/devicesDelete.ts | 38 + .../v2/typescript/src/devicesFailover.ts | 49 + .../samples/v2/typescript/src/devicesGet.ts | 41 + .../typescript/src/devicesGetUpdateSummary.ts | 38 + .../typescript/src/devicesInstallUpdates.ts | 38 + .../v2/typescript/src/devicesListByManager.ts | 39 + .../typescript/src/devicesListFailoverSets.ts | 41 + .../src/devicesListFailoverTargets.ts | 50 + .../src/devicesListMetricDefinition.ts | 41 + .../v2/typescript/src/devicesListMetrics.ts | 44 + .../typescript/src/devicesScanForUpdates.ts | 38 + .../v2/typescript/src/devicesUpdate.ts | 45 + ...mponentGroupsChangeControllerPowerState.ts | 50 + .../hardwareComponentGroupsListByDevice.ts | 41 + .../samples/v2/typescript/src/jobsCancel.ts | 40 + .../samples/v2/typescript/src/jobsGet.ts | 40 + .../v2/typescript/src/jobsListByDevice.ts | 44 + .../v2/typescript/src/jobsListByManager.ts | 42 + .../src/managersCreateExtendedInfo.ts | 44 + .../typescript/src/managersCreateOrUpdate.ts | 45 + .../v2/typescript/src/managersDelete.ts | 33 + .../src/managersDeleteExtendedInfo.ts | 36 + .../samples/v2/typescript/src/managersGet.ts | 33 + .../src/managersGetActivationKey.ts | 36 + .../managersGetDevicePublicEncryptionKey.ts | 38 + .../src/managersGetEncryptionSettings.ts | 36 + .../typescript/src/managersGetExtendedInfo.ts | 36 + .../src/managersGetPublicEncryptionKey.ts | 36 + .../samples/v2/typescript/src/managersList.ts | 34 + .../src/managersListByResourceGroup.ts | 37 + .../src/managersListFeatureSupportStatus.ts | 39 + .../src/managersListMetricDefinition.ts | 39 + .../v2/typescript/src/managersListMetrics.ts | 42 + .../src/managersRegenerateActivationKey.ts | 36 + .../v2/typescript/src/managersUpdate.ts | 41 + .../src/managersUpdateExtendedInfo.ts | 47 + .../v2/typescript/src/operationsList.ts | 34 + ...storageAccountCredentialsCreateOrUpdate.ts | 52 + .../src/storageAccountCredentialsDelete.ts | 38 + .../src/storageAccountCredentialsGet.ts | 38 + .../storageAccountCredentialsListByManager.ts | 39 + .../src/volumeContainersCreateOrUpdate.ts | 56 + .../typescript/src/volumeContainersDelete.ts | 40 + .../v2/typescript/src/volumeContainersGet.ts | 40 + .../src/volumeContainersListByDevice.ts | 41 + .../volumeContainersListMetricDefinition.ts | 43 + .../src/volumeContainersListMetrics.ts | 46 + .../typescript/src/volumesCreateOrUpdate.ts | 55 + .../v2/typescript/src/volumesDelete.ts | 42 + .../samples/v2/typescript/src/volumesGet.ts | 42 + .../v2/typescript/src/volumesListByDevice.ts | 41 + .../src/volumesListByVolumeContainer.ts | 43 + .../src/volumesListMetricDefinition.ts | 45 + .../v2/typescript/src/volumesListMetrics.ts | 48 + .../samples/v2/typescript/tsconfig.json | 17 + .../arm-storsimple8000series/src/index.ts | 12 + .../arm-storsimple8000series/src/lroImpl.ts | 34 + .../src/models/accessControlRecordsMappers.ts | 64 - .../src/models/alertsMappers.ts | 66 - .../src/models/backupPoliciesMappers.ts | 64 - .../src/models/backupSchedulesMappers.ts | 64 - .../src/models/backupsMappers.ts | 65 - .../src/models/bandwidthSettingsMappers.ts | 64 - .../src/models/cloudAppliancesMappers.ts | 65 - .../src/models/deviceSettingsMappers.ts | 67 - .../src/models/devicesMappers.ts | 84 - .../models/hardwareComponentGroupsMappers.ts | 64 - .../src/models/index.ts | 6534 +++++------------ .../src/models/jobsMappers.ts | 64 - .../src/models/managersMappers.ts | 83 - .../src/models/mappers.ts | 4970 ++++++------- .../src/models/operationsMappers.ts | 17 - .../src/models/parameters.ts | 372 +- .../storageAccountCredentialsMappers.ts | 64 - .../src/models/volumeContainersMappers.ts | 72 - .../src/models/volumesMappers.ts | 72 - .../src/operations/accessControlRecords.ts | 480 +- .../src/operations/alerts.ts | 372 +- .../src/operations/backupPolicies.ts | 638 +- .../src/operations/backupSchedules.ts | 528 +- .../src/operations/backups.ts | 635 +- .../src/operations/bandwidthSettings.ts | 480 +- .../src/operations/cloudAppliances.ts | 278 +- .../src/operations/deviceSettings.ts | 1045 +-- .../src/operations/devices.ts | 1785 +++-- .../src/operations/hardwareComponentGroups.ts | 307 +- .../src/operations/index.ts | 8 +- .../src/operations/jobs.ts | 637 +- .../src/operations/managers.ts | 1426 ++-- .../src/operations/operations.ts | 170 +- .../operations/storageAccountCredentials.ts | 481 +- .../src/operations/volumeContainers.ts | 813 +- .../src/operations/volumes.ts | 991 ++- .../accessControlRecords.ts | 109 + .../src/operationsInterfaces/alerts.ts | 61 + .../operationsInterfaces/backupPolicies.ts | 156 + .../operationsInterfaces/backupSchedules.ts | 133 + .../src/operationsInterfaces/backups.ts | 134 + .../operationsInterfaces/bandwidthSettings.ts | 109 + .../operationsInterfaces/cloudAppliances.ts | 58 + .../operationsInterfaces/deviceSettings.ts | 254 + .../src/operationsInterfaces/devices.ts | 331 + .../hardwareComponentGroups.ts | 68 + .../src/operationsInterfaces/index.ts | 24 + .../src/operationsInterfaces/jobs.ts | 94 + .../src/operationsInterfaces/managers.ts | 257 + .../src/operationsInterfaces/operations.ts | 25 + .../storageAccountCredentials.ts | 109 + .../operationsInterfaces/volumeContainers.ts | 157 + .../src/operationsInterfaces/volumes.ts | 187 + .../storSimple8000SeriesManagementClient.ts | 185 +- ...Simple8000SeriesManagementClientContext.ts | 62 - .../test/sampleTest.ts | 48 + .../arm-storsimple8000series/tsconfig.json | 11 +- sdk/storsimple8000series/ci.yml | 30 + sdk/support/arm-support/CHANGELOG.md | 11 + sdk/support/arm-support/LICENSE | 21 + sdk/support/arm-support/README.md | 143 +- sdk/support/arm-support/_meta.json | 7 + sdk/support/arm-support/api-extractor.json | 18 + sdk/support/arm-support/package.json | 107 +- .../node/my_test/recording_sample_test.js | 5 + .../arm-support/review/arm-support.api.md | 459 ++ sdk/support/arm-support/rollup.config.js | 211 +- sdk/support/arm-support/sample.env | 4 + .../addCommunicationToSubscriptionTicket.ts | 39 + ...NameIsAvailableForCommunicationResource.ts | 39 + ...NameIsAvailableForSupportTicketResource.ts | 37 + .../createATicketForBillingRelatedIssues.ts | 49 + ...tForSubscriptionManagementRelatedIssues.ts | 50 + ...echnicalIssueRelatedToASpecificResource.ts | 54 + ...tiveJobsAndJobSchedulesForABatchAccount.ts | 61 + ...QuotaIncreaseForAzureSqlManagedInstance.ts | 65 + ...ncreaseForBatchAccountsForASubscription.ts | 58 + ...ToRequestQuotaIncreaseForComputeVMCores.ts | 55 + ...IncreaseForDtUsForAzureSynapseAnalytics.ts | 61 + ...questQuotaIncreaseForDtUsForSqlDatabase.ts | 59 + ...easeForLowPriorityCoresForABatchAccount.ts | 61 + ...wPriorityCoresForMachineLearningService.ts | 58 + ...stQuotaIncreaseForPoolsForABatchAccount.ts | 61 + ...reaseForServersForAzureSynapseAnalytics.ts | 56 + ...stQuotaIncreaseForServersForSqlDatabase.ts | 56 + ...nalDetailsInTheQuotaTicketDetailsObject.ts | 52 + ...orSpecificVMFamilyCoresForABatchAccount.ts | 62 + ...cVMFamilyCoresForMachineLearningService.ts | 62 + .../samples-dev/getAllOperations.ts | 31 + ...ionDetailsForASubscriptionSupportTicket.ts | 33 + .../getDetailsOfASubscriptionTicket.ts | 29 + ...sOfProblemClassificationForAzureService.ts | 33 + .../getsDetailsOfTheAzureService.ts | 29 + ...rviceForWhichASupportTicketCanBeCreated.ts | 34 + ...vicesForWhichASupportTicketCanBeCreated.ts | 31 + ...unicationsForASubscriptionSupportTicket.ts | 32 + ...rtainDateAndInOpenStateForASubscription.ts | 35 + .../listSupportTicketsForASubscription.ts | 31 + ...pportTicketsInOpenStateForASubscription.ts | 33 + ...ecificDateForASubscriptionSupportTicket.ts | 40 + ...unicationsForASubscriptionSupportTicket.ts | 37 + .../updateContactDetailsOfASupportTicket.ts | 45 + .../updateSeverityOfASupportTicket.ts | 33 + .../updateStatusOfASupportTicket.ts | 33 + .../samples/v2/javascript/README.md | 120 + .../addCommunicationToSubscriptionTicket.js | 39 + ...NameIsAvailableForCommunicationResource.js | 36 + ...NameIsAvailableForSupportTicketResource.js | 32 + .../createATicketForBillingRelatedIssues.js | 49 + ...tForSubscriptionManagementRelatedIssues.js | 49 + ...echnicalIssueRelatedToASpecificResource.js | 53 + ...tiveJobsAndJobSchedulesForABatchAccount.js | 61 + ...QuotaIncreaseForAzureSqlManagedInstance.js | 63 + ...ncreaseForBatchAccountsForASubscription.js | 54 + ...ToRequestQuotaIncreaseForComputeVMCores.js | 53 + ...IncreaseForDtUsForAzureSynapseAnalytics.js | 59 + ...questQuotaIncreaseForDtUsForSqlDatabase.js | 59 + ...easeForLowPriorityCoresForABatchAccount.js | 59 + ...wPriorityCoresForMachineLearningService.js | 56 + ...stQuotaIncreaseForPoolsForABatchAccount.js | 59 + ...reaseForServersForAzureSynapseAnalytics.js | 54 + ...stQuotaIncreaseForServersForSqlDatabase.js | 54 + ...nalDetailsInTheQuotaTicketDetailsObject.js | 51 + ...orSpecificVMFamilyCoresForABatchAccount.js | 60 + ...cVMFamilyCoresForMachineLearningService.js | 61 + .../samples/v2/javascript/getAllOperations.js | 31 + ...ionDetailsForASubscriptionSupportTicket.js | 30 + .../getDetailsOfASubscriptionTicket.js | 29 + ...sOfProblemClassificationForAzureService.js | 30 + .../getsDetailsOfTheAzureService.js | 29 + ...rviceForWhichASupportTicketCanBeCreated.js | 34 + ...vicesForWhichASupportTicketCanBeCreated.js | 31 + ...unicationsForASubscriptionSupportTicket.js | 32 + ...rtainDateAndInOpenStateForASubscription.js | 33 + .../listSupportTicketsForASubscription.js | 31 + ...pportTicketsInOpenStateForASubscription.js | 33 + ...ecificDateForASubscriptionSupportTicket.js | 36 + ...unicationsForASubscriptionSupportTicket.js | 34 + .../samples/v2/javascript/package.json | 32 + .../samples/v2/javascript/sample.env | 4 + .../updateContactDetailsOfASupportTicket.js | 42 + .../updateSeverityOfASupportTicket.js | 30 + .../updateStatusOfASupportTicket.js | 30 + .../samples/v2/typescript/README.md | 133 + .../samples/v2/typescript/package.json | 41 + .../samples/v2/typescript/sample.env | 4 + .../addCommunicationToSubscriptionTicket.ts | 39 + ...NameIsAvailableForCommunicationResource.ts | 39 + ...NameIsAvailableForSupportTicketResource.ts | 37 + .../createATicketForBillingRelatedIssues.ts | 49 + ...tForSubscriptionManagementRelatedIssues.ts | 50 + ...echnicalIssueRelatedToASpecificResource.ts | 54 + ...tiveJobsAndJobSchedulesForABatchAccount.ts | 61 + ...QuotaIncreaseForAzureSqlManagedInstance.ts | 65 + ...ncreaseForBatchAccountsForASubscription.ts | 58 + ...ToRequestQuotaIncreaseForComputeVMCores.ts | 55 + ...IncreaseForDtUsForAzureSynapseAnalytics.ts | 61 + ...questQuotaIncreaseForDtUsForSqlDatabase.ts | 59 + ...easeForLowPriorityCoresForABatchAccount.ts | 61 + ...wPriorityCoresForMachineLearningService.ts | 58 + ...stQuotaIncreaseForPoolsForABatchAccount.ts | 61 + ...reaseForServersForAzureSynapseAnalytics.ts | 56 + ...stQuotaIncreaseForServersForSqlDatabase.ts | 56 + ...nalDetailsInTheQuotaTicketDetailsObject.ts | 52 + ...orSpecificVMFamilyCoresForABatchAccount.ts | 62 + ...cVMFamilyCoresForMachineLearningService.ts | 62 + .../v2/typescript/src/getAllOperations.ts | 31 + ...ionDetailsForASubscriptionSupportTicket.ts | 33 + .../src/getDetailsOfASubscriptionTicket.ts | 29 + ...sOfProblemClassificationForAzureService.ts | 33 + .../src/getsDetailsOfTheAzureService.ts | 29 + ...rviceForWhichASupportTicketCanBeCreated.ts | 34 + ...vicesForWhichASupportTicketCanBeCreated.ts | 31 + ...unicationsForASubscriptionSupportTicket.ts | 32 + ...rtainDateAndInOpenStateForASubscription.ts | 35 + .../src/listSupportTicketsForASubscription.ts | 31 + ...pportTicketsInOpenStateForASubscription.ts | 33 + ...ecificDateForASubscriptionSupportTicket.ts | 40 + ...unicationsForASubscriptionSupportTicket.ts | 37 + .../updateContactDetailsOfASupportTicket.ts | 45 + .../src/updateSeverityOfASupportTicket.ts | 33 + .../src/updateStatusOfASupportTicket.ts | 33 + .../samples/v2/typescript/tsconfig.json | 17 + sdk/support/arm-support/src/index.ts | 12 + sdk/support/arm-support/src/lroImpl.ts | 34 + .../arm-support/src/microsoftSupport.ts | 119 +- .../src/microsoftSupportContext.ts | 62 - .../src/models/communicationsMappers.ts | 25 - sdk/support/arm-support/src/models/index.ts | 1257 ++-- sdk/support/arm-support/src/models/mappers.ts | 836 +-- .../src/models/operationsMappers.ts | 16 - .../arm-support/src/models/parameters.ts | 153 +- .../models/problemClassificationsMappers.ts | 15 - .../arm-support/src/models/servicesMappers.ts | 15 - .../src/models/supportTicketsMappers.ts | 27 - .../src/operations/communications.ts | 491 +- .../arm-support/src/operations/index.ts | 8 +- .../arm-support/src/operations/operations.ts | 108 +- .../src/operations/problemClassifications.ts | 190 +- .../arm-support/src/operations/services.ts | 176 +- .../src/operations/supportTickets.ts | 586 +- .../operationsInterfaces/communications.ts | 94 + .../src/operationsInterfaces/index.ts | 13 + .../src/operationsInterfaces/operations.ts | 22 + .../problemClassifications.ts | 43 + .../src/operationsInterfaces/services.ts | 42 + .../operationsInterfaces/supportTickets.ts | 137 + sdk/support/arm-support/test/sampleTest.ts | 48 + sdk/support/arm-support/tsconfig.json | 9 +- sdk/support/ci.yml | 30 + .../arm-timeseriesinsights/CHANGELOG.md | 11 + .../arm-timeseriesinsights/LICENSE | 21 + .../arm-timeseriesinsights/README.md | 143 +- .../arm-timeseriesinsights/_meta.json | 7 + .../arm-timeseriesinsights/api-extractor.json | 18 + .../arm-timeseriesinsights/package.json | 99 +- .../node/my_test/recording_sample_test.js | 5 + .../review/arm-timeseriesinsights.api.md | 943 +++ .../arm-timeseriesinsights/rollup.config.js | 211 +- .../arm-timeseriesinsights/src/index.ts | 12 + .../arm-timeseriesinsights/src/lroImpl.ts | 34 + .../src/models/accessPoliciesMappers.ts | 30 - .../src/models/environmentsMappers.ts | 35 - .../src/models/eventSourcesMappers.ts | 39 - .../src/models/index.ts | 2291 +++--- .../src/models/mappers.ts | 2379 ++++-- .../src/models/operationsMappers.ts | 15 - .../src/models/parameters.ts | 226 +- .../src/models/referenceDataSetsMappers.ts | 35 - .../src/operations/accessPolicies.ts | 394 +- .../src/operations/environments.ts | 589 +- .../src/operations/eventSources.ts | 394 +- .../src/operations/index.ts | 8 +- .../src/operations/operations.ts | 160 +- .../src/operations/referenceDataSets.ts | 394 +- .../operationsInterfaces/accessPolicies.ts | 103 + .../src/operationsInterfaces/environments.ts | 135 + .../src/operationsInterfaces/eventSources.ts | 104 + .../src/operationsInterfaces/index.ts | 13 + .../src/operationsInterfaces/operations.ts | 22 + .../operationsInterfaces/referenceDataSets.ts | 104 + .../src/timeSeriesInsightsClient.ts | 119 +- .../src/timeSeriesInsightsClientContext.ts | 62 - .../arm-timeseriesinsights/test/sampleTest.ts | 48 + .../arm-timeseriesinsights/tsconfig.json | 6 +- sdk/timeseriesinsights/ci.yml | 30 + .../arm-trafficmanager/CHANGELOG.md | 11 + sdk/trafficmanager/arm-trafficmanager/LICENSE | 21 + .../arm-trafficmanager/README.md | 158 +- .../arm-trafficmanager/_meta.json | 7 + .../arm-trafficmanager/api-extractor.json | 18 + .../arm-trafficmanager/package.json | 109 +- .../node/my_test/recording_sample_test.js | 5 + .../review/arm-trafficmanager.api.md | 486 ++ .../arm-trafficmanager/rollup.config.js | 211 +- .../arm-trafficmanager/sample.env | 4 + .../samples-dev/endpointDeleteExternal.ts | 37 + .../endpointGetExternalWithGeoMapping.ts | 37 + .../endpointGetExternalWithLocation.ts | 37 + .../endpointGetExternalWithSubnetMapping.ts | 37 + .../endpointPatchExternalTarget.ts | 48 + .../endpointPutExternalWithCustomHeaders.ts | 52 + .../endpointPutExternalWithGeoMapping.ts | 48 + .../endpointPutExternalWithLocation.ts | 48 + .../endpointPutExternalWithSubnetMapping.ts | 51 + .../geographicHierarchyGetDefault.ts | 28 + .../samples-dev/heatMapGet.ts | 30 + .../samples-dev/heatMapGetWithNullValues.ts | 30 + .../heatMapGetWithTopLeftBotRight.ts | 37 + .../samples-dev/listBySubscription.ts | 31 + .../listProfilesByResourceGroup.ts | 34 + ...nameAvailabilityTestNameAvailablePost21.ts | 37 + ...eAvailabilityTestNameNotAvailablePost23.ts | 37 + .../samples-dev/profileDelete.ts | 30 + .../samples-dev/profileGetWithEndpoints.ts | 30 + .../profileGetWithTrafficViewDisabled.ts | 30 + .../profileGetWithTrafficViewEnabled.ts | 30 + .../samples-dev/profilePatchMonitorConfig.ts | 51 + .../samples-dev/profilePutMultiValue.ts | 46 + .../samples-dev/profilePutNoEndpoints.ts | 44 + .../samples-dev/profilePutWithAliasing.ts | 64 + .../profilePutWithCustomHeaders.ts | 73 + .../samples-dev/profilePutWithEndpoints.ts | 63 + .../profilePutWithNestedEndpoints.ts | 75 + .../trafficManagerUserMetricsKeysDelete.ts | 28 + .../trafficManagerUserMetricsKeysGet.ts | 28 + .../trafficManagerUserMetricsKeysPut.ts | 28 + .../samples/v6/javascript/README.md | 110 + .../v6/javascript/endpointDeleteExternal.js | 37 + .../endpointGetExternalWithGeoMapping.js | 37 + .../endpointGetExternalWithLocation.js | 37 + .../endpointGetExternalWithSubnetMapping.js | 37 + .../javascript/endpointPatchExternalTarget.js | 44 + .../endpointPutExternalWithCustomHeaders.js | 49 + .../endpointPutExternalWithGeoMapping.js | 45 + .../endpointPutExternalWithLocation.js | 45 + .../endpointPutExternalWithSubnetMapping.js | 48 + .../geographicHierarchyGetDefault.js | 28 + .../samples/v6/javascript/heatMapGet.js | 30 + .../v6/javascript/heatMapGetWithNullValues.js | 30 + .../heatMapGetWithTopLeftBotRight.js | 33 + .../v6/javascript/listBySubscription.js | 31 + .../javascript/listProfilesByResourceGroup.js | 32 + ...nameAvailabilityTestNameAvailablePost21.js | 32 + ...eAvailabilityTestNameNotAvailablePost23.js | 32 + .../samples/v6/javascript/package.json | 32 + .../samples/v6/javascript/profileDelete.js | 30 + .../v6/javascript/profileGetWithEndpoints.js | 30 + .../profileGetWithTrafficViewDisabled.js | 30 + .../profileGetWithTrafficViewEnabled.js | 30 + .../javascript/profilePatchMonitorConfig.js | 44 + .../v6/javascript/profilePutMultiValue.js | 39 + .../v6/javascript/profilePutNoEndpoints.js | 37 + .../v6/javascript/profilePutWithAliasing.js | 57 + .../javascript/profilePutWithCustomHeaders.js | 66 + .../v6/javascript/profilePutWithEndpoints.js | 56 + .../profilePutWithNestedEndpoints.js | 68 + .../samples/v6/javascript/sample.env | 4 + .../trafficManagerUserMetricsKeysDelete.js | 28 + .../trafficManagerUserMetricsKeysGet.js | 28 + .../trafficManagerUserMetricsKeysPut.js | 28 + .../samples/v6/typescript/README.md | 123 + .../samples/v6/typescript/package.json | 41 + .../samples/v6/typescript/sample.env | 4 + .../typescript/src/endpointDeleteExternal.ts | 37 + .../src/endpointGetExternalWithGeoMapping.ts | 37 + .../src/endpointGetExternalWithLocation.ts | 37 + .../endpointGetExternalWithSubnetMapping.ts | 37 + .../src/endpointPatchExternalTarget.ts | 48 + .../endpointPutExternalWithCustomHeaders.ts | 52 + .../src/endpointPutExternalWithGeoMapping.ts | 48 + .../src/endpointPutExternalWithLocation.ts | 48 + .../endpointPutExternalWithSubnetMapping.ts | 51 + .../src/geographicHierarchyGetDefault.ts | 28 + .../samples/v6/typescript/src/heatMapGet.ts | 30 + .../src/heatMapGetWithNullValues.ts | 30 + .../src/heatMapGetWithTopLeftBotRight.ts | 37 + .../v6/typescript/src/listBySubscription.ts | 31 + .../src/listProfilesByResourceGroup.ts | 34 + ...nameAvailabilityTestNameAvailablePost21.ts | 37 + ...eAvailabilityTestNameNotAvailablePost23.ts | 37 + .../v6/typescript/src/profileDelete.ts | 30 + .../typescript/src/profileGetWithEndpoints.ts | 30 + .../src/profileGetWithTrafficViewDisabled.ts | 30 + .../src/profileGetWithTrafficViewEnabled.ts | 30 + .../src/profilePatchMonitorConfig.ts | 51 + .../v6/typescript/src/profilePutMultiValue.ts | 46 + .../typescript/src/profilePutNoEndpoints.ts | 44 + .../typescript/src/profilePutWithAliasing.ts | 64 + .../src/profilePutWithCustomHeaders.ts | 73 + .../typescript/src/profilePutWithEndpoints.ts | 63 + .../src/profilePutWithNestedEndpoints.ts | 75 + .../trafficManagerUserMetricsKeysDelete.ts | 28 + .../src/trafficManagerUserMetricsKeysGet.ts | 28 + .../src/trafficManagerUserMetricsKeysPut.ts | 28 + .../samples/v6/typescript/tsconfig.json | 17 + .../arm-trafficmanager/src/index.ts | 12 + .../src/models/endpointsMappers.ts | 31 - .../models/geographicHierarchiesMappers.ts | 30 - .../src/models/heatMapMappers.ts | 30 - .../arm-trafficmanager/src/models/index.ts | 1194 ++- .../arm-trafficmanager/src/models/mappers.ts | 703 +- .../src/models/parameters.ts | 166 +- .../src/models/profilesMappers.ts | 34 - .../trafficManagerUserMetricsKeysMappers.ts | 31 - .../src/operations/endpoints.ts | 325 +- .../src/operations/geographicHierarchies.ts | 70 +- .../src/operations/heatMap.ts | 93 +- .../src/operations/index.ts | 3 +- .../src/operations/profiles.ts | 534 +- .../trafficManagerUserMetricsKeys.ts | 162 +- .../src/operationsInterfaces/endpoints.ts | 91 + .../geographicHierarchies.ts | 23 + .../src/operationsInterfaces/heatMap.ts | 24 + .../src/operationsInterfaces/index.ts | 13 + .../src/operationsInterfaces/profiles.ts | 106 + .../trafficManagerUserMetricsKeys.ts | 41 + .../src/trafficManagerManagementClient.ts | 124 +- .../trafficManagerManagementClientContext.ts | 68 - .../arm-trafficmanager/test/sampleTest.ts | 48 + .../arm-trafficmanager/tsconfig.json | 9 +- sdk/trafficmanager/ci.yml | 30 + .../arm-visualstudio/CHANGELOG.md | 11 + sdk/visualstudio/arm-visualstudio/LICENSE | 21 + sdk/visualstudio/arm-visualstudio/README.md | 145 +- sdk/visualstudio/arm-visualstudio/_meta.json | 7 + .../arm-visualstudio/api-extractor.json | 18 + .../arm-visualstudio/package.json | 115 +- .../node/my_test/recording_sample_test.js | 5 + .../review/arm-visualstudio.api.md | 314 + .../arm-visualstudio/rollup.config.js | 211 +- sdk/visualstudio/arm-visualstudio/sample.env | 4 + .../checkAvailabilityOfAnAccountName.ts | 38 + .../samples-dev/createAProjectResource.ts | 54 + .../samples-dev/createAnAccountResource.ts | 41 + .../samples-dev/createAnExtensionResource.ts | 54 + .../samples-dev/deleteAnAccountResource.ts | 33 + .../samples-dev/deleteAnExtensionResource.ts | 38 + ...istOfAccountResourcesInTheResourceGroup.ts | 32 + ...xtensionResourcesWithinTheResourceGroup.ts | 36 + ...ListOfOperationsForThisResourceProvider.ts | 31 + ...rojectResourcesInTheTeamServicesAccount.ts | 36 + .../samples-dev/getAProjectResource.ts | 38 + .../samples-dev/getAnAccountResource.ts | 33 + .../samples-dev/getAnExtensionResource.ts | 38 + .../getTheStatusOfTheProjectCreationJob.ts | 45 + .../samples-dev/updateAProjectResource.ts | 51 + .../samples-dev/updateAnExtensionResource.ts | 54 + .../samples/v4-beta/javascript/README.md | 80 + .../checkAvailabilityOfAnAccountName.js | 32 + .../javascript/createAProjectResource.js | 47 + .../javascript/createAnAccountResource.js | 31 + .../javascript/createAnExtensionResource.js | 48 + .../javascript/deleteAnAccountResource.js | 30 + .../javascript/deleteAnExtensionResource.js | 35 + ...istOfAccountResourcesInTheResourceGroup.js | 29 + ...xtensionResourcesWithinTheResourceGroup.js | 30 + ...ListOfOperationsForThisResourceProvider.js | 28 + ...rojectResourcesInTheTeamServicesAccount.js | 30 + .../v4-beta/javascript/getAProjectResource.js | 31 + .../javascript/getAnAccountResource.js | 30 + .../javascript/getAnExtensionResource.js | 35 + .../getTheStatusOfTheProjectCreationJob.js | 42 + .../samples/v4-beta/javascript/package.json | 32 + .../samples/v4-beta/javascript/sample.env | 4 + .../javascript/updateAProjectResource.js | 44 + .../javascript/updateAnExtensionResource.js | 48 + .../samples/v4-beta/typescript/README.md | 93 + .../samples/v4-beta/typescript/package.json | 41 + .../samples/v4-beta/typescript/sample.env | 4 + .../src/checkAvailabilityOfAnAccountName.ts | 38 + .../typescript/src/createAProjectResource.ts | 54 + .../typescript/src/createAnAccountResource.ts | 41 + .../src/createAnExtensionResource.ts | 54 + .../typescript/src/deleteAnAccountResource.ts | 33 + .../src/deleteAnExtensionResource.ts | 38 + ...istOfAccountResourcesInTheResourceGroup.ts | 32 + ...xtensionResourcesWithinTheResourceGroup.ts | 36 + ...ListOfOperationsForThisResourceProvider.ts | 31 + ...rojectResourcesInTheTeamServicesAccount.ts | 36 + .../typescript/src/getAProjectResource.ts | 38 + .../typescript/src/getAnAccountResource.ts | 33 + .../typescript/src/getAnExtensionResource.ts | 38 + .../getTheStatusOfTheProjectCreationJob.ts | 45 + .../typescript/src/updateAProjectResource.ts | 51 + .../src/updateAnExtensionResource.ts | 54 + .../samples/v4-beta/typescript/tsconfig.json | 17 + .../arm-visualstudio/src/index.ts | 11 + .../arm-visualstudio/src/lroImpl.ts | 34 + .../src/models/accountsMappers.ts | 25 - .../src/models/extensionsMappers.ts | 22 - .../arm-visualstudio/src/models/index.ts | 853 +-- .../arm-visualstudio/src/models/mappers.ts | 407 +- .../src/models/operationsMappers.ts | 17 - .../arm-visualstudio/src/models/parameters.ts | 165 +- .../src/models/projectsMappers.ts | 21 - .../src/operations/accounts.ts | 440 +- .../src/operations/extensions.ts | 366 +- .../arm-visualstudio/src/operations/index.ts | 8 +- .../src/operations/operations.ts | 73 +- .../src/operations/projects.ts | 508 +- .../src/operationsInterfaces/accounts.ts | 96 + .../src/operationsInterfaces/extensions.ts | 91 + .../src/operationsInterfaces/index.ts | 12 + .../src/operationsInterfaces/operations.ts | 21 + .../src/operationsInterfaces/projects.ts | 128 + .../src/visualStudioResourceProviderClient.ts | 113 +- ...sualStudioResourceProviderClientContext.ts | 62 - .../arm-visualstudio/test/sampleTest.ts | 48 + .../arm-visualstudio/tsconfig.json | 11 +- sdk/visualstudio/ci.yml | 30 + .../arm-vmwarecloudsimple/CHANGELOG.md | 11 + .../arm-vmwarecloudsimple/LICENSE | 21 + .../arm-vmwarecloudsimple/README.md | 141 +- .../arm-vmwarecloudsimple/_meta.json | 7 + .../arm-vmwarecloudsimple/api-extractor.json | 18 + .../arm-vmwarecloudsimple/package.json | 99 +- .../node/my_test/recording_sample_test.js | 5 + .../review/arm-vmwarecloudsimple.api.md | 1140 +++ .../arm-vmwarecloudsimple/rollup.config.js | 211 +- .../arm-vmwarecloudsimple/src/index.ts | 12 + .../arm-vmwarecloudsimple/src/lroImpl.ts | 34 + .../src/models/dedicatedCloudNodesMappers.ts | 26 - .../models/dedicatedCloudServicesMappers.ts | 25 - .../arm-vmwarecloudsimple/src/models/index.ts | 3111 +++----- .../src/models/mappers.ts | 2075 +++--- .../src/models/operationsMappers.ts | 20 - .../src/models/parameters.ts | 307 +- .../src/models/privateCloudsMappers.ts | 20 - .../src/models/resourcePoolsMappers.ts | 14 - .../src/models/skusAvailabilityMappers.ts | 14 - .../src/models/usagesMappers.ts | 15 - .../models/virtualMachineTemplatesMappers.ts | 18 - .../src/models/virtualMachinesMappers.ts | 29 - .../src/models/virtualNetworksMappers.ts | 14 - .../src/operations/customizationPolicies.ts | 217 + .../src/operations/dedicatedCloudNodes.ts | 708 +- .../src/operations/dedicatedCloudServices.ts | 691 +- .../src/operations/index.ts | 9 +- .../src/operations/operations.ts | 242 +- .../src/operations/privateClouds.ts | 254 +- .../src/operations/resourcePools.ts | 274 +- .../src/operations/skusAvailability.ts | 194 +- .../src/operations/usages.ts | 194 +- .../src/operations/virtualMachineTemplates.ts | 294 +- .../src/operations/virtualMachines.ts | 1108 ++- .../src/operations/virtualNetworks.ts | 299 +- .../customizationPolicies.ts | 44 + .../dedicatedCloudNodes.ts | 110 + .../dedicatedCloudServices.ts | 103 + .../src/operationsInterfaces/index.ts | 19 + .../src/operationsInterfaces/operations.ts | 38 + .../src/operationsInterfaces/privateClouds.ts | 40 + .../src/operationsInterfaces/resourcePools.ts | 44 + .../operationsInterfaces/skusAvailability.ts | 24 + .../src/operationsInterfaces/usages.ts | 24 + .../virtualMachineTemplates.ts | 46 + .../operationsInterfaces/virtualMachines.ts | 191 + .../operationsInterfaces/virtualNetworks.ts | 46 + .../src/vMwareCloudSimple.ts | 126 + .../src/vMwareCloudSimpleClient.ts | 61 - .../src/vMwareCloudSimpleClientContext.ts | 68 - .../arm-vmwarecloudsimple/test/sampleTest.ts | 48 + .../arm-vmwarecloudsimple/tsconfig.json | 6 +- sdk/vmwarecloudsimple/ci.yml | 30 + 1285 files changed, 100691 insertions(+), 48924 deletions(-) create mode 100644 sdk/applicationinsights/arm-appinsights/CHANGELOG.md create mode 100644 sdk/applicationinsights/arm-appinsights/LICENSE create mode 100644 sdk/applicationinsights/arm-appinsights/_meta.json create mode 100644 sdk/applicationinsights/arm-appinsights/api-extractor.json create mode 100644 sdk/applicationinsights/arm-appinsights/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/applicationinsights/arm-appinsights/review/arm-appinsights.api.md delete mode 100644 sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClientContext.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/index.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/aPIKeysMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/analyticsItemsMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/annotationsMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/componentAvailableFeaturesMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/componentCurrentBillingFeaturesMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/componentFeatureCapabilitiesMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/componentLinkedStorageAccountsOperationsMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/componentQuotaStatusMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/componentsMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/exportConfigurationsMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/favoritesMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/liveTokenMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/myWorkbooksMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/operationsMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/proactiveDetectionConfigurationsMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/webTestLocationsMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/webTestsMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/workItemConfigurationsMappers.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/models/workbooksMappers.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operations/workbookTemplates.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/aPIKeys.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/analyticsItems.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/annotations.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentAvailableFeatures.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentCurrentBillingFeatures.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentFeatureCapabilities.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentLinkedStorageAccountsOperations.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentQuotaStatus.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/components.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/exportConfigurations.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/favorites.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/index.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/liveToken.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/myWorkbooks.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/operations.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/proactiveDetectionConfigurations.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/webTestLocations.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/webTests.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workItemConfigurations.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workbookTemplates.ts create mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workbooks.ts create mode 100644 sdk/applicationinsights/arm-appinsights/test/sampleTest.ts create mode 100644 sdk/applicationinsights/ci.yml create mode 100644 sdk/datacatalog/arm-datacatalog/CHANGELOG.md create mode 100644 sdk/datacatalog/arm-datacatalog/LICENSE create mode 100644 sdk/datacatalog/arm-datacatalog/_meta.json create mode 100644 sdk/datacatalog/arm-datacatalog/api-extractor.json create mode 100644 sdk/datacatalog/arm-datacatalog/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/datacatalog/arm-datacatalog/review/arm-datacatalog.api.md delete mode 100644 sdk/datacatalog/arm-datacatalog/src/dataCatalogRestClientContext.ts create mode 100644 sdk/datacatalog/arm-datacatalog/src/index.ts create mode 100644 sdk/datacatalog/arm-datacatalog/src/lroImpl.ts delete mode 100644 sdk/datacatalog/arm-datacatalog/src/models/aDCCatalogsMappers.ts delete mode 100644 sdk/datacatalog/arm-datacatalog/src/models/aDCOperationsMappers.ts create mode 100644 sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/aDCCatalogs.ts create mode 100644 sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/aDCOperations.ts create mode 100644 sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/index.ts create mode 100644 sdk/datacatalog/arm-datacatalog/test/sampleTest.ts create mode 100644 sdk/datacatalog/ci.yml create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/CHANGELOG.md create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/LICENSE create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/_meta.json create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/api-extractor.json create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/review/arm-storsimple1200series.api.md create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/sample.env create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsClear.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsSendTestEmail.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsClone.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesCreateOrUpdateAlertSettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesCreateOrUpdateSecuritySettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDeactivate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDownloadUpdates.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesFailover.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetAlertSettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetNetworkSettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetTimeSettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetUpdateSummary.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesInstallUpdates.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListFailoverTarget.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesPatch.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesScanForUpdates.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersBackupNow.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListByFileServer.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListByIscsiServer.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersBackupNow.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersCreateExtendedInfo.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersDeleteExtendedInfo.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetEncryptionKey.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetEncryptionSettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetExtendedInfo.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersList.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListByResourceGroup.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUpdateExtendedInfo.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUploadRegistrationCertificate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/operationsList.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/README.md create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsCreateOrUpdate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsListByManager.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsClear.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsListByManager.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsSendTestEmail.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsCreateOrUpdate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsListByDevice.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsClone.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsListByDevice.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsListByManager.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsCreateOrUpdate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsListByDevice.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesCreateOrUpdateAlertSettings.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesCreateOrUpdateSecuritySettings.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDeactivate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDownloadUpdates.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesFailover.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetAlertSettings.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetNetworkSettings.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetTimeSettings.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetUpdateSummary.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesInstallUpdates.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListByManager.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListFailoverTarget.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListMetricDefinition.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListMetrics.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesPatch.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesScanForUpdates.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersBackupNow.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersCreateOrUpdate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListByDevice.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListByManager.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListMetricDefinition.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListMetrics.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesCreateOrUpdate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListByDevice.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListByFileServer.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListMetricDefinition.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListMetrics.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksCreateOrUpdate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListByDevice.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListByIscsiServer.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListMetricDefinition.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListMetrics.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersBackupNow.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersCreateOrUpdate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListByDevice.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListByManager.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListMetricDefinition.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListMetrics.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsListByDevice.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsListByManager.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersCreateExtendedInfo.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersCreateOrUpdate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersDeleteExtendedInfo.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetEncryptionKey.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetEncryptionSettings.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetExtendedInfo.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersList.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListByResourceGroup.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListMetricDefinition.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListMetrics.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUpdate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUpdateExtendedInfo.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUploadRegistrationCertificate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/operationsList.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/package.json create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/sample.env create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsCreateOrUpdate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsListByManager.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsCreateOrUpdate.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsDelete.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsGet.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsListByManager.js create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/README.md create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/package.json create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/sample.env create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsClear.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsSendTestEmail.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsClone.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesCreateOrUpdateAlertSettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesCreateOrUpdateSecuritySettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDeactivate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDownloadUpdates.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesFailover.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetAlertSettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetNetworkSettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetTimeSettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetUpdateSummary.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesInstallUpdates.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListFailoverTarget.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesPatch.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesScanForUpdates.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersBackupNow.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListByFileServer.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListByIscsiServer.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersBackupNow.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsListByDevice.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersCreateExtendedInfo.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersDeleteExtendedInfo.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetEncryptionKey.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetEncryptionSettings.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetExtendedInfo.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersList.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListByResourceGroup.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListMetricDefinition.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListMetrics.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUpdateExtendedInfo.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUploadRegistrationCertificate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/operationsList.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsCreateOrUpdate.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsDelete.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsGet.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsListByManager.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/tsconfig.json create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/index.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/lroImpl.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/accessControlRecordsMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/alertsMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/availableProviderOperationsOperationsMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/backupScheduleGroupsMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/backupsMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/chapSettingsOperationsMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/devicesMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/fileServersMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/fileSharesMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/iscsiDisksMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/iscsiServersMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/jobsMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/managersMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/storageAccountCredentialsMappers.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/models/storageDomainsMappers.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/accessControlRecords.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/alerts.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/availableProviderOperationsOperations.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/backupScheduleGroups.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/backups.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/chapSettingsOperations.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/devices.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/fileServers.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/fileShares.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/index.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/iscsiDisks.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/iscsiServers.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/jobs.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/managers.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/storageAccountCredentials.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/storageDomains.ts delete mode 100644 sdk/storsimple1200series/arm-storsimple1200series/src/storSimpleManagementClientContext.ts create mode 100644 sdk/storsimple1200series/arm-storsimple1200series/test/sampleTest.ts create mode 100644 sdk/storsimple1200series/ci.yml create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/CHANGELOG.md create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/LICENSE create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/_meta.json create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/api-extractor.json create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/review/arm-storsimple8000series.api.md create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/sample.env create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsClear.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsSendTestEmail.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesBackupNow.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesListByBackupPolicy.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsClone.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsRestore.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/cloudAppliancesListSupportedConfigurations.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/cloudAppliancesProvision.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsCreateOrUpdateAlertSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsCreateOrUpdateTimeSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetAlertSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetNetworkSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetSecuritySettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetTimeSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsSyncRemotemanagementCertificate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsUpdateNetworkSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsUpdateSecuritySettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesAuthorizeForServiceEncryptionKeyRollover.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesConfigure.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesDeactivate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesFailover.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesGetUpdateSummary.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesInstallUpdates.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListFailoverSets.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListFailoverTargets.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListMetricDefinition.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListMetrics.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesScanForUpdates.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/hardwareComponentGroupsChangeControllerPowerState.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/hardwareComponentGroupsListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsCancel.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersCreateExtendedInfo.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersDeleteExtendedInfo.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetActivationKey.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetDevicePublicEncryptionKey.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetEncryptionSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetExtendedInfo.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetPublicEncryptionKey.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersList.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListByResourceGroup.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListFeatureSupportStatus.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListMetricDefinition.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListMetrics.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersRegenerateActivationKey.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersUpdateExtendedInfo.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/operationsList.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListMetricDefinition.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListMetrics.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListByVolumeContainer.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListMetricDefinition.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListMetrics.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/README.md create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsCreateOrUpdate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsDelete.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsGet.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsListByManager.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsClear.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsListByManager.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsSendTestEmail.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesBackupNow.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesCreateOrUpdate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesDelete.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesGet.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesListByDevice.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesCreateOrUpdate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesDelete.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesGet.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesListByBackupPolicy.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsClone.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsDelete.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsListByDevice.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsRestore.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsCreateOrUpdate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsDelete.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsGet.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsListByManager.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/cloudAppliancesListSupportedConfigurations.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/cloudAppliancesProvision.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsCreateOrUpdateAlertSettings.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsCreateOrUpdateTimeSettings.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetAlertSettings.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetNetworkSettings.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetSecuritySettings.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetTimeSettings.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsSyncRemotemanagementCertificate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsUpdateNetworkSettings.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsUpdateSecuritySettings.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesAuthorizeForServiceEncryptionKeyRollover.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesConfigure.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesDeactivate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesDelete.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesFailover.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesGet.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesGetUpdateSummary.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesInstallUpdates.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListByManager.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListFailoverSets.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListFailoverTargets.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListMetricDefinition.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListMetrics.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesScanForUpdates.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesUpdate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/hardwareComponentGroupsChangeControllerPowerState.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/hardwareComponentGroupsListByDevice.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsCancel.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsGet.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsListByDevice.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsListByManager.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersCreateExtendedInfo.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersCreateOrUpdate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersDelete.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersDeleteExtendedInfo.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGet.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetActivationKey.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetDevicePublicEncryptionKey.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetEncryptionSettings.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetExtendedInfo.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetPublicEncryptionKey.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersList.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListByResourceGroup.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListFeatureSupportStatus.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListMetricDefinition.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListMetrics.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersRegenerateActivationKey.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersUpdate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersUpdateExtendedInfo.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/operationsList.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/package.json create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/sample.env create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsCreateOrUpdate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsDelete.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsGet.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsListByManager.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersCreateOrUpdate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersDelete.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersGet.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListByDevice.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListMetricDefinition.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListMetrics.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesCreateOrUpdate.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesDelete.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesGet.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListByDevice.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListByVolumeContainer.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListMetricDefinition.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListMetrics.js create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/README.md create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/package.json create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/sample.env create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsClear.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsSendTestEmail.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesBackupNow.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesListByBackupPolicy.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsClone.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsRestore.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/cloudAppliancesListSupportedConfigurations.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/cloudAppliancesProvision.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsCreateOrUpdateAlertSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsCreateOrUpdateTimeSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetAlertSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetNetworkSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetSecuritySettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetTimeSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsSyncRemotemanagementCertificate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsUpdateNetworkSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsUpdateSecuritySettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesAuthorizeForServiceEncryptionKeyRollover.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesConfigure.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesDeactivate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesFailover.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesGetUpdateSummary.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesInstallUpdates.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListFailoverSets.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListFailoverTargets.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListMetricDefinition.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListMetrics.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesScanForUpdates.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/hardwareComponentGroupsChangeControllerPowerState.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/hardwareComponentGroupsListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsCancel.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersCreateExtendedInfo.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersDeleteExtendedInfo.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetActivationKey.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetDevicePublicEncryptionKey.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetEncryptionSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetExtendedInfo.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetPublicEncryptionKey.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersList.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListByResourceGroup.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListFeatureSupportStatus.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListMetricDefinition.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListMetrics.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersRegenerateActivationKey.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersUpdateExtendedInfo.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/operationsList.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsListByManager.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListMetricDefinition.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListMetrics.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesCreateOrUpdate.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesDelete.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesGet.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListByDevice.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListByVolumeContainer.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListMetricDefinition.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListMetrics.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/tsconfig.json create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/index.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/lroImpl.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/accessControlRecordsMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/alertsMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/backupPoliciesMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/backupSchedulesMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/backupsMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/bandwidthSettingsMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/cloudAppliancesMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/deviceSettingsMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/devicesMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/hardwareComponentGroupsMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/jobsMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/managersMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/operationsMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/storageAccountCredentialsMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/volumeContainersMappers.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/models/volumesMappers.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/accessControlRecords.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/alerts.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backupPolicies.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backupSchedules.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backups.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/bandwidthSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/cloudAppliances.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/deviceSettings.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/devices.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/hardwareComponentGroups.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/index.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/jobs.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/managers.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/operations.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/storageAccountCredentials.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/volumeContainers.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/volumes.ts delete mode 100644 sdk/storsimple8000series/arm-storsimple8000series/src/storSimple8000SeriesManagementClientContext.ts create mode 100644 sdk/storsimple8000series/arm-storsimple8000series/test/sampleTest.ts create mode 100644 sdk/storsimple8000series/ci.yml create mode 100644 sdk/support/arm-support/CHANGELOG.md create mode 100644 sdk/support/arm-support/LICENSE create mode 100644 sdk/support/arm-support/_meta.json create mode 100644 sdk/support/arm-support/api-extractor.json create mode 100644 sdk/support/arm-support/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/support/arm-support/review/arm-support.api.md create mode 100644 sdk/support/arm-support/sample.env create mode 100644 sdk/support/arm-support/samples-dev/addCommunicationToSubscriptionTicket.ts create mode 100644 sdk/support/arm-support/samples-dev/checksWhetherNameIsAvailableForCommunicationResource.ts create mode 100644 sdk/support/arm-support/samples-dev/checksWhetherNameIsAvailableForSupportTicketResource.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketForBillingRelatedIssues.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketForSubscriptionManagementRelatedIssues.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketForTechnicalIssueRelatedToASpecificResource.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForComputeVMCores.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.ts create mode 100644 sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.ts create mode 100644 sdk/support/arm-support/samples-dev/getAllOperations.ts create mode 100644 sdk/support/arm-support/samples-dev/getCommunicationDetailsForASubscriptionSupportTicket.ts create mode 100644 sdk/support/arm-support/samples-dev/getDetailsOfASubscriptionTicket.ts create mode 100644 sdk/support/arm-support/samples-dev/getsDetailsOfProblemClassificationForAzureService.ts create mode 100644 sdk/support/arm-support/samples-dev/getsDetailsOfTheAzureService.ts create mode 100644 sdk/support/arm-support/samples-dev/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.ts create mode 100644 sdk/support/arm-support/samples-dev/getsListOfServicesForWhichASupportTicketCanBeCreated.ts create mode 100644 sdk/support/arm-support/samples-dev/listCommunicationsForASubscriptionSupportTicket.ts create mode 100644 sdk/support/arm-support/samples-dev/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.ts create mode 100644 sdk/support/arm-support/samples-dev/listSupportTicketsForASubscription.ts create mode 100644 sdk/support/arm-support/samples-dev/listSupportTicketsInOpenStateForASubscription.ts create mode 100644 sdk/support/arm-support/samples-dev/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.ts create mode 100644 sdk/support/arm-support/samples-dev/listWebCommunicationsForASubscriptionSupportTicket.ts create mode 100644 sdk/support/arm-support/samples-dev/updateContactDetailsOfASupportTicket.ts create mode 100644 sdk/support/arm-support/samples-dev/updateSeverityOfASupportTicket.ts create mode 100644 sdk/support/arm-support/samples-dev/updateStatusOfASupportTicket.ts create mode 100644 sdk/support/arm-support/samples/v2/javascript/README.md create mode 100644 sdk/support/arm-support/samples/v2/javascript/addCommunicationToSubscriptionTicket.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/checksWhetherNameIsAvailableForCommunicationResource.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/checksWhetherNameIsAvailableForSupportTicketResource.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketForBillingRelatedIssues.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketForSubscriptionManagementRelatedIssues.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketForTechnicalIssueRelatedToASpecificResource.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForComputeVMCores.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/getAllOperations.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/getCommunicationDetailsForASubscriptionSupportTicket.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/getDetailsOfASubscriptionTicket.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/getsDetailsOfProblemClassificationForAzureService.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/getsDetailsOfTheAzureService.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/getsListOfServicesForWhichASupportTicketCanBeCreated.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/listCommunicationsForASubscriptionSupportTicket.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/listSupportTicketsForASubscription.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/listSupportTicketsInOpenStateForASubscription.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/listWebCommunicationsForASubscriptionSupportTicket.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/package.json create mode 100644 sdk/support/arm-support/samples/v2/javascript/sample.env create mode 100644 sdk/support/arm-support/samples/v2/javascript/updateContactDetailsOfASupportTicket.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/updateSeverityOfASupportTicket.js create mode 100644 sdk/support/arm-support/samples/v2/javascript/updateStatusOfASupportTicket.js create mode 100644 sdk/support/arm-support/samples/v2/typescript/README.md create mode 100644 sdk/support/arm-support/samples/v2/typescript/package.json create mode 100644 sdk/support/arm-support/samples/v2/typescript/sample.env create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/addCommunicationToSubscriptionTicket.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/checksWhetherNameIsAvailableForCommunicationResource.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/checksWhetherNameIsAvailableForSupportTicketResource.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketForBillingRelatedIssues.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketForSubscriptionManagementRelatedIssues.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketForTechnicalIssueRelatedToASpecificResource.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForComputeVMCores.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/getAllOperations.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/getCommunicationDetailsForASubscriptionSupportTicket.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/getDetailsOfASubscriptionTicket.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/getsDetailsOfProblemClassificationForAzureService.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/getsDetailsOfTheAzureService.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/getsListOfServicesForWhichASupportTicketCanBeCreated.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/listCommunicationsForASubscriptionSupportTicket.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsForASubscription.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsInOpenStateForASubscription.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/listWebCommunicationsForASubscriptionSupportTicket.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/updateContactDetailsOfASupportTicket.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/updateSeverityOfASupportTicket.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/src/updateStatusOfASupportTicket.ts create mode 100644 sdk/support/arm-support/samples/v2/typescript/tsconfig.json create mode 100644 sdk/support/arm-support/src/index.ts create mode 100644 sdk/support/arm-support/src/lroImpl.ts delete mode 100644 sdk/support/arm-support/src/microsoftSupportContext.ts delete mode 100644 sdk/support/arm-support/src/models/communicationsMappers.ts delete mode 100644 sdk/support/arm-support/src/models/operationsMappers.ts delete mode 100644 sdk/support/arm-support/src/models/problemClassificationsMappers.ts delete mode 100644 sdk/support/arm-support/src/models/servicesMappers.ts delete mode 100644 sdk/support/arm-support/src/models/supportTicketsMappers.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/communications.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/index.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/operations.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/problemClassifications.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/services.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/supportTickets.ts create mode 100644 sdk/support/arm-support/test/sampleTest.ts create mode 100644 sdk/support/ci.yml create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/CHANGELOG.md create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/LICENSE create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/_meta.json create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/api-extractor.json create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/review/arm-timeseriesinsights.api.md create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/index.ts create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/lroImpl.ts delete mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/models/accessPoliciesMappers.ts delete mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/models/environmentsMappers.ts delete mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/models/eventSourcesMappers.ts delete mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/models/operationsMappers.ts delete mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/models/referenceDataSetsMappers.ts create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/accessPolicies.ts create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/environments.ts create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/eventSources.ts create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/index.ts create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/operations.ts create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/referenceDataSets.ts delete mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/src/timeSeriesInsightsClientContext.ts create mode 100644 sdk/timeseriesinsights/arm-timeseriesinsights/test/sampleTest.ts create mode 100644 sdk/timeseriesinsights/ci.yml create mode 100644 sdk/trafficmanager/arm-trafficmanager/CHANGELOG.md create mode 100644 sdk/trafficmanager/arm-trafficmanager/LICENSE create mode 100644 sdk/trafficmanager/arm-trafficmanager/_meta.json create mode 100644 sdk/trafficmanager/arm-trafficmanager/api-extractor.json create mode 100644 sdk/trafficmanager/arm-trafficmanager/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/review/arm-trafficmanager.api.md create mode 100644 sdk/trafficmanager/arm-trafficmanager/sample.env create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointDeleteExternal.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithGeoMapping.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithLocation.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithSubnetMapping.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPatchExternalTarget.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithCustomHeaders.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithGeoMapping.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithLocation.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithSubnetMapping.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/geographicHierarchyGetDefault.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGet.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGetWithNullValues.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGetWithTopLeftBotRight.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/listBySubscription.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/listProfilesByResourceGroup.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/nameAvailabilityTestNameAvailablePost21.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/nameAvailabilityTestNameNotAvailablePost23.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/profileDelete.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithEndpoints.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithTrafficViewDisabled.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithTrafficViewEnabled.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePatchMonitorConfig.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutMultiValue.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutNoEndpoints.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithAliasing.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithCustomHeaders.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithEndpoints.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithNestedEndpoints.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysDelete.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysGet.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysPut.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/README.md create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointDeleteExternal.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithGeoMapping.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithLocation.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithSubnetMapping.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPatchExternalTarget.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithCustomHeaders.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithGeoMapping.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithLocation.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithSubnetMapping.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/geographicHierarchyGetDefault.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGet.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGetWithNullValues.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGetWithTopLeftBotRight.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/listBySubscription.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/listProfilesByResourceGroup.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/nameAvailabilityTestNameAvailablePost21.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/nameAvailabilityTestNameNotAvailablePost23.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/package.json create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileDelete.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithEndpoints.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithTrafficViewDisabled.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithTrafficViewEnabled.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePatchMonitorConfig.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutMultiValue.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutNoEndpoints.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithAliasing.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithCustomHeaders.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithEndpoints.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithNestedEndpoints.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/sample.env create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysDelete.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysGet.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysPut.js create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/README.md create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/package.json create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/sample.env create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointDeleteExternal.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithGeoMapping.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithLocation.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithSubnetMapping.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPatchExternalTarget.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithCustomHeaders.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithGeoMapping.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithLocation.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithSubnetMapping.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/geographicHierarchyGetDefault.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGet.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGetWithNullValues.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGetWithTopLeftBotRight.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/listBySubscription.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/listProfilesByResourceGroup.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/nameAvailabilityTestNameAvailablePost21.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/nameAvailabilityTestNameNotAvailablePost23.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileDelete.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithEndpoints.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithTrafficViewDisabled.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithTrafficViewEnabled.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePatchMonitorConfig.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutMultiValue.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutNoEndpoints.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithAliasing.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithCustomHeaders.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithEndpoints.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithNestedEndpoints.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysDelete.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysGet.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysPut.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/tsconfig.json create mode 100644 sdk/trafficmanager/arm-trafficmanager/src/index.ts delete mode 100644 sdk/trafficmanager/arm-trafficmanager/src/models/endpointsMappers.ts delete mode 100644 sdk/trafficmanager/arm-trafficmanager/src/models/geographicHierarchiesMappers.ts delete mode 100644 sdk/trafficmanager/arm-trafficmanager/src/models/heatMapMappers.ts delete mode 100644 sdk/trafficmanager/arm-trafficmanager/src/models/profilesMappers.ts delete mode 100644 sdk/trafficmanager/arm-trafficmanager/src/models/trafficManagerUserMetricsKeysMappers.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/endpoints.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/geographicHierarchies.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/heatMap.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/index.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/profiles.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/trafficManagerUserMetricsKeys.ts delete mode 100644 sdk/trafficmanager/arm-trafficmanager/src/trafficManagerManagementClientContext.ts create mode 100644 sdk/trafficmanager/arm-trafficmanager/test/sampleTest.ts create mode 100644 sdk/trafficmanager/ci.yml create mode 100644 sdk/visualstudio/arm-visualstudio/CHANGELOG.md create mode 100644 sdk/visualstudio/arm-visualstudio/LICENSE create mode 100644 sdk/visualstudio/arm-visualstudio/_meta.json create mode 100644 sdk/visualstudio/arm-visualstudio/api-extractor.json create mode 100644 sdk/visualstudio/arm-visualstudio/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/visualstudio/arm-visualstudio/review/arm-visualstudio.api.md create mode 100644 sdk/visualstudio/arm-visualstudio/sample.env create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/checkAvailabilityOfAnAccountName.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/createAProjectResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/createAnAccountResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/createAnExtensionResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/deleteAnAccountResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/deleteAnExtensionResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfAccountResourcesInTheResourceGroup.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfExtensionResourcesWithinTheResourceGroup.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfOperationsForThisResourceProvider.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfProjectResourcesInTheTeamServicesAccount.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/getAProjectResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/getAnAccountResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/getAnExtensionResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/getTheStatusOfTheProjectCreationJob.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/updateAProjectResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples-dev/updateAnExtensionResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/README.md create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/checkAvailabilityOfAnAccountName.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAProjectResource.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAnAccountResource.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAnExtensionResource.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/deleteAnAccountResource.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/deleteAnExtensionResource.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfAccountResourcesInTheResourceGroup.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfExtensionResourcesWithinTheResourceGroup.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfOperationsForThisResourceProvider.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfProjectResourcesInTheTeamServicesAccount.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAProjectResource.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAnAccountResource.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAnExtensionResource.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getTheStatusOfTheProjectCreationJob.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/package.json create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/sample.env create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/updateAProjectResource.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/updateAnExtensionResource.js create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/README.md create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/package.json create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/sample.env create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/checkAvailabilityOfAnAccountName.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAProjectResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAnAccountResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAnExtensionResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/deleteAnAccountResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/deleteAnExtensionResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfAccountResourcesInTheResourceGroup.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfExtensionResourcesWithinTheResourceGroup.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfOperationsForThisResourceProvider.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfProjectResourcesInTheTeamServicesAccount.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAProjectResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAnAccountResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAnExtensionResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getTheStatusOfTheProjectCreationJob.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/updateAProjectResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/updateAnExtensionResource.ts create mode 100644 sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/tsconfig.json create mode 100644 sdk/visualstudio/arm-visualstudio/src/index.ts create mode 100644 sdk/visualstudio/arm-visualstudio/src/lroImpl.ts delete mode 100644 sdk/visualstudio/arm-visualstudio/src/models/accountsMappers.ts delete mode 100644 sdk/visualstudio/arm-visualstudio/src/models/extensionsMappers.ts delete mode 100644 sdk/visualstudio/arm-visualstudio/src/models/operationsMappers.ts delete mode 100644 sdk/visualstudio/arm-visualstudio/src/models/projectsMappers.ts create mode 100644 sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/accounts.ts create mode 100644 sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/extensions.ts create mode 100644 sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/index.ts create mode 100644 sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/operations.ts create mode 100644 sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/projects.ts delete mode 100644 sdk/visualstudio/arm-visualstudio/src/visualStudioResourceProviderClientContext.ts create mode 100644 sdk/visualstudio/arm-visualstudio/test/sampleTest.ts create mode 100644 sdk/visualstudio/ci.yml create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/CHANGELOG.md create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/LICENSE create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/_meta.json create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/api-extractor.json create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/review/arm-vmwarecloudsimple.api.md create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/index.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/lroImpl.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/dedicatedCloudNodesMappers.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/dedicatedCloudServicesMappers.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/operationsMappers.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/privateCloudsMappers.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/resourcePoolsMappers.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/skusAvailabilityMappers.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/usagesMappers.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualMachineTemplatesMappers.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualMachinesMappers.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualNetworksMappers.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/customizationPolicies.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/customizationPolicies.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/dedicatedCloudNodes.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/dedicatedCloudServices.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/index.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/operations.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/privateClouds.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/resourcePools.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/skusAvailability.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/usages.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualMachineTemplates.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualMachines.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualNetworks.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimple.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimpleClient.ts delete mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimpleClientContext.ts create mode 100644 sdk/vmwarecloudsimple/arm-vmwarecloudsimple/test/sampleTest.ts create mode 100644 sdk/vmwarecloudsimple/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 0fd36f8f2f13..01ec82f75f19 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13,6 +13,7 @@ specifiers: '@rush-temp/arm-analysisservices': file:./projects/arm-analysisservices.tgz '@rush-temp/arm-apimanagement': file:./projects/arm-apimanagement.tgz '@rush-temp/arm-appconfiguration': file:./projects/arm-appconfiguration.tgz + '@rush-temp/arm-appinsights': file:./projects/arm-appinsights.tgz '@rush-temp/arm-appplatform': file:./projects/arm-appplatform.tgz '@rush-temp/arm-appservice': file:./projects/arm-appservice.tgz '@rush-temp/arm-attestation': file:./projects/arm-attestation.tgz @@ -40,6 +41,7 @@ specifiers: '@rush-temp/arm-databox': file:./projects/arm-databox.tgz '@rush-temp/arm-databoxedge': file:./projects/arm-databoxedge.tgz '@rush-temp/arm-databricks': file:./projects/arm-databricks.tgz + '@rush-temp/arm-datacatalog': file:./projects/arm-datacatalog.tgz '@rush-temp/arm-datadog': file:./projects/arm-datadog.tgz '@rush-temp/arm-datafactory': file:./projects/arm-datafactory.tgz '@rush-temp/arm-datalake-analytics': file:./projects/arm-datalake-analytics.tgz @@ -129,11 +131,18 @@ specifiers: '@rush-temp/arm-storage': file:./projects/arm-storage.tgz '@rush-temp/arm-storagecache': file:./projects/arm-storagecache.tgz '@rush-temp/arm-storagesync': file:./projects/arm-storagesync.tgz + '@rush-temp/arm-storsimple1200series': file:./projects/arm-storsimple1200series.tgz + '@rush-temp/arm-storsimple8000series': file:./projects/arm-storsimple8000series.tgz '@rush-temp/arm-streamanalytics': file:./projects/arm-streamanalytics.tgz '@rush-temp/arm-subscriptions': file:./projects/arm-subscriptions.tgz + '@rush-temp/arm-support': file:./projects/arm-support.tgz '@rush-temp/arm-synapse': file:./projects/arm-synapse.tgz '@rush-temp/arm-templatespecs': file:./projects/arm-templatespecs.tgz + '@rush-temp/arm-timeseriesinsights': file:./projects/arm-timeseriesinsights.tgz + '@rush-temp/arm-trafficmanager': file:./projects/arm-trafficmanager.tgz '@rush-temp/arm-videoanalyzer': file:./projects/arm-videoanalyzer.tgz + '@rush-temp/arm-visualstudio': file:./projects/arm-visualstudio.tgz + '@rush-temp/arm-vmwarecloudsimple': file:./projects/arm-vmwarecloudsimple.tgz '@rush-temp/arm-webpubsub': file:./projects/arm-webpubsub.tgz '@rush-temp/arm-webservices': file:./projects/arm-webservices.tgz '@rush-temp/arm-workspaces': file:./projects/arm-workspaces.tgz @@ -253,6 +262,7 @@ dependencies: '@rush-temp/arm-analysisservices': file:projects/arm-analysisservices.tgz '@rush-temp/arm-apimanagement': file:projects/arm-apimanagement.tgz '@rush-temp/arm-appconfiguration': file:projects/arm-appconfiguration.tgz + '@rush-temp/arm-appinsights': file:projects/arm-appinsights.tgz '@rush-temp/arm-appplatform': file:projects/arm-appplatform.tgz '@rush-temp/arm-appservice': file:projects/arm-appservice.tgz '@rush-temp/arm-attestation': file:projects/arm-attestation.tgz @@ -280,6 +290,7 @@ dependencies: '@rush-temp/arm-databox': file:projects/arm-databox.tgz '@rush-temp/arm-databoxedge': file:projects/arm-databoxedge.tgz '@rush-temp/arm-databricks': file:projects/arm-databricks.tgz + '@rush-temp/arm-datacatalog': file:projects/arm-datacatalog.tgz '@rush-temp/arm-datadog': file:projects/arm-datadog.tgz '@rush-temp/arm-datafactory': file:projects/arm-datafactory.tgz '@rush-temp/arm-datalake-analytics': file:projects/arm-datalake-analytics.tgz @@ -369,11 +380,18 @@ dependencies: '@rush-temp/arm-storage': file:projects/arm-storage.tgz '@rush-temp/arm-storagecache': file:projects/arm-storagecache.tgz '@rush-temp/arm-storagesync': file:projects/arm-storagesync.tgz + '@rush-temp/arm-storsimple1200series': file:projects/arm-storsimple1200series.tgz + '@rush-temp/arm-storsimple8000series': file:projects/arm-storsimple8000series.tgz '@rush-temp/arm-streamanalytics': file:projects/arm-streamanalytics.tgz '@rush-temp/arm-subscriptions': file:projects/arm-subscriptions.tgz + '@rush-temp/arm-support': file:projects/arm-support.tgz '@rush-temp/arm-synapse': file:projects/arm-synapse.tgz '@rush-temp/arm-templatespecs': file:projects/arm-templatespecs.tgz + '@rush-temp/arm-timeseriesinsights': file:projects/arm-timeseriesinsights.tgz + '@rush-temp/arm-trafficmanager': file:projects/arm-trafficmanager.tgz '@rush-temp/arm-videoanalyzer': file:projects/arm-videoanalyzer.tgz + '@rush-temp/arm-visualstudio': file:projects/arm-visualstudio.tgz + '@rush-temp/arm-vmwarecloudsimple': file:projects/arm-vmwarecloudsimple.tgz '@rush-temp/arm-webpubsub': file:projects/arm-webpubsub.tgz '@rush-temp/arm-webservices': file:projects/arm-webservices.tgz '@rush-temp/arm-workspaces': file:projects/arm-workspaces.tgz @@ -8788,6 +8806,31 @@ packages: - supports-color dev: false + file:projects/arm-appinsights.tgz: + resolution: {integrity: sha512-OEmWtZsHkEl0cpiZbyVe2HbTiQyCtxHjT/2KZj6S13Tqt4Qi66SuCCPo5RrbGA+LfrZOdy4TTHnMCqTUb96A1w==, tarball: file:projects/arm-appinsights.tgz} + name: '@rush-temp/arm-appinsights' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + file:projects/arm-appplatform.tgz: resolution: {integrity: sha512-4ViCtaJaq0hg3Ed7lIB7V1EWyRJiGk1Xifc8SHCQTUzizQm2Ke36e635M0aEuH4oUBo+XhirXJKMuNOfiaa0RQ==, tarball: file:projects/arm-appplatform.tgz} name: '@rush-temp/arm-appplatform' @@ -9456,6 +9499,31 @@ packages: - supports-color dev: false + file:projects/arm-datacatalog.tgz: + resolution: {integrity: sha512-F4XRkHua4jUdxm/TVPFBntRsvcQFKEgaIPJzzxcYsGwNUYwjHR9xHp+NfWskqWg96ievQ/2b3YZrkoCPuhCFqA==, tarball: file:projects/arm-datacatalog.tgz} + name: '@rush-temp/arm-datacatalog' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + file:projects/arm-datadog.tgz: resolution: {integrity: sha512-ieKcaxZAw8yaT2wFKzLROyOruNTfQeN26BBkMHkz6JmZDGMYUdzI6dvTak/swksTZAr/prEb7pCaMNKUJ8ZcUA==, tarball: file:projects/arm-datadog.tgz} name: '@rush-temp/arm-datadog' @@ -11683,6 +11751,56 @@ packages: - supports-color dev: false + file:projects/arm-storsimple1200series.tgz: + resolution: {integrity: sha512-EkcbViBGv0kuKbipmi6LorUxXGjya6yFDhnygTgrS/y/GqpgfLA/IK60jthR3cnZjNj4ErSMIrWzo52h1lY8Jw==, tarball: file:projects/arm-storsimple1200series.tgz} + name: '@rush-temp/arm-storsimple1200series' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + + file:projects/arm-storsimple8000series.tgz: + resolution: {integrity: sha512-hb0DbEaFHq7w4/Js7Jh1ly9B2sDbRINGUyCe+0mf7wBO/1TKaR5xD5AUbJ57VUDUE5iqhj999DNEGw0nn5g1aQ==, tarball: file:projects/arm-storsimple8000series.tgz} + name: '@rush-temp/arm-storsimple8000series' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + file:projects/arm-streamanalytics.tgz: resolution: {integrity: sha512-anS7TXMqYdobBqt4VnMVXs6geNykd9Wod2fgz7EEfpPT4lMmA2I9MSeBA+zAZp5JvmuiWS+2SRFhjmfwWRFIzA==, tarball: file:projects/arm-streamanalytics.tgz} name: '@rush-temp/arm-streamanalytics' @@ -11733,6 +11851,31 @@ packages: - supports-color dev: false + file:projects/arm-support.tgz: + resolution: {integrity: sha512-WIjPeWrrReWl+bQCjJrP0A5glBPNqbAeuuwwbXgEP314oHPSXJi1hhqgw5+aDlruGVWzfLm/xhcWysmnxlI6Aw==, tarball: file:projects/arm-support.tgz} + name: '@rush-temp/arm-support' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + file:projects/arm-synapse.tgz: resolution: {integrity: sha512-pXWYvHxQV3L/tE5ZPje6k/4e3OB5Ubn1EoyRvRcPA45fKArYudHUfF6+3ifuDJg9pmuGSZBs98wNFOXtElP90A==, tarball: file:projects/arm-synapse.tgz} name: '@rush-temp/arm-synapse' @@ -11783,6 +11926,56 @@ packages: - supports-color dev: false + file:projects/arm-timeseriesinsights.tgz: + resolution: {integrity: sha512-YBr9G2KPgY/e+AwpBWu4ILnBhTDp/e4pfatbbUMavxG+N72JmxZTMhCq/p4ruRM9GMJitN52ikVxX3xCCn4lUA==, tarball: file:projects/arm-timeseriesinsights.tgz} + name: '@rush-temp/arm-timeseriesinsights' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + + file:projects/arm-trafficmanager.tgz: + resolution: {integrity: sha512-+8yJ6MhksJopLaV0lZU6eBoIFOpKCCKZam6D4yL12IhdPsi11dJm+Q8hGUr34UNt0Lf03duQg6p1gVqD5uMw9Q==, tarball: file:projects/arm-trafficmanager.tgz} + name: '@rush-temp/arm-trafficmanager' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + file:projects/arm-videoanalyzer.tgz: resolution: {integrity: sha512-9cKpE8i/nJqJxDSzN5MbXRNNE80OH1zbrVCHfE215Wirf+1lY/ZAQUo4Vta/OabkJBwXRPoI7UngYMnh25g/Cw==, tarball: file:projects/arm-videoanalyzer.tgz} name: '@rush-temp/arm-videoanalyzer' @@ -11808,6 +12001,56 @@ packages: - supports-color dev: false + file:projects/arm-visualstudio.tgz: + resolution: {integrity: sha512-NRvggj2tukBv1nHexUoJqD/aDoCyctlF67RvYApwL4mSnQPkQtJ+U4PWqUggx89zr8OSFzN/mTgyijxPl6vRJA==, tarball: file:projects/arm-visualstudio.tgz} + name: '@rush-temp/arm-visualstudio' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + + file:projects/arm-vmwarecloudsimple.tgz: + resolution: {integrity: sha512-/GmoKH84EBYDBu95kEOq34d/0H8yclUuMLu8K2xkLWPWFKHLPFfqrSrwuJ0tzzLWDaVksE1lAkKGmlC25DdcnQ==, tarball: file:projects/arm-vmwarecloudsimple.tgz} + name: '@rush-temp/arm-vmwarecloudsimple' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + file:projects/arm-webpubsub.tgz: resolution: {integrity: sha512-HvoZFROZyHqpeIrdj2Yb6GXGeJIA8tyEM5cS+8h+AqimdVQagsotBV8hicGPga143QNp9LuHsUFpPjkJstz4Kw==, tarball: file:projects/arm-webpubsub.tgz} name: '@rush-temp/arm-webpubsub' diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index 8dbd02914738..5f138a283b0a 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -30,3 +30,5 @@ https://docs.microsoft.com/javascript/api/@azure/arm-postgresql-flexible https://docs.microsoft.com/javascript/api/@azure/arm-postgresql-flexible?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-serialconsole https://docs.microsoft.com/javascript/api/@azure-rest/iot-device-update +https://docs.microsoft.com/javascript/api/@azure/arm-vmwarecloudsimple +https://docs.microsoft.com/en-us/rest/api/index diff --git a/rush.json b/rush.json index 80c79857e4f7..d6659d8a126d 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -1509,6 +1509,51 @@ "packageName": "@azure/arm-resourcegraph", "projectFolder": "sdk/resourcegraph/arm-resourcegraph", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-appinsights", + "projectFolder": "sdk/applicationinsights/arm-appinsights", + "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-datacatalog", + "projectFolder": "sdk/datacatalog/arm-datacatalog", + "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-storsimple1200series", + "projectFolder": "sdk/storsimple1200series/arm-storsimple1200series", + "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-storsimple8000series", + "projectFolder": "sdk/storsimple8000series/arm-storsimple8000series", + "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-support", + "projectFolder": "sdk/support/arm-support", + "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-timeseriesinsights", + "projectFolder": "sdk/timeseriesinsights/arm-timeseriesinsights", + "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-trafficmanager", + "projectFolder": "sdk/trafficmanager/arm-trafficmanager", + "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-visualstudio", + "projectFolder": "sdk/visualstudio/arm-visualstudio", + "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-vmwarecloudsimple", + "projectFolder": "sdk/vmwarecloudsimple/arm-vmwarecloudsimple", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/applicationinsights/arm-appinsights/CHANGELOG.md b/sdk/applicationinsights/arm-appinsights/CHANGELOG.md new file mode 100644 index 000000000000..62470a621563 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 5.0.0-beta.1 (2022-01-21) + +The package of @azure/arm-appinsights is using our next generation design principles since version 5.0.0-beta.1, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/applicationinsights/arm-appinsights/LICENSE b/sdk/applicationinsights/arm-appinsights/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/applicationinsights/arm-appinsights/README.md b/sdk/applicationinsights/arm-appinsights/README.md index 4b865a5e2981..68ba5ff919df 100644 --- a/sdk/applicationinsights/arm-appinsights/README.md +++ b/sdk/applicationinsights/arm-appinsights/README.md @@ -1,109 +1,98 @@ -## Azure ApplicationInsightsManagementClient SDK for JavaScript +# Azure ApplicationInsightsManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for ApplicationInsightsManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ApplicationInsightsManagement client. + +Composite Swagger for Application Insights Management Client + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/applicationinsights/arm-appinsights) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-appinsights) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-appinsights?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-appinsights` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-appinsights` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure ApplicationInsightsManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-appinsights @azure/identity +npm install @azure/arm-appinsights ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `ApplicationInsightsManagementClient` -### How to use +To create a client object to access the Azure ApplicationInsightsManagement API, you will need the `endpoint` of your Azure ApplicationInsightsManagement resource and a `credential`. The Azure ApplicationInsightsManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure ApplicationInsightsManagement resource in the [Azure Portal][azure_portal]. -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure ApplicationInsightsManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Sample code +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { ApplicationInsightsManagementClient } = require("@azure/arm-appinsights"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new ApplicationInsightsManagementClient(creds, subscriptionId); - -client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ApplicationInsightsManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and list operations as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-appinsights sample - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### ApplicationInsightsManagementClient + +`ApplicationInsightsManagementClient` is the primary interface for developers using the Azure ApplicationInsightsManagement client library. Explore the methods on this client object to understand the different features of the Azure ApplicationInsightsManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fapplicationinsights%2Farm-appinsights%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/applicationinsights/arm-appinsights/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/applicationinsights/arm-appinsights/_meta.json b/sdk/applicationinsights/arm-appinsights/_meta.json new file mode 100644 index 000000000000..3021b5d9d2b5 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "readme": "specification/applicationinsights/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/applicationinsights/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" +} \ No newline at end of file diff --git a/sdk/applicationinsights/arm-appinsights/api-extractor.json b/sdk/applicationinsights/arm-appinsights/api-extractor.json new file mode 100644 index 000000000000..8d94522c21e8 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-appinsights.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/applicationinsights/arm-appinsights/package.json b/sdk/applicationinsights/arm-appinsights/package.json index 86aa24dbac0b..50d5a2aa6c45 100644 --- a/sdk/applicationinsights/arm-appinsights/package.json +++ b/sdk/applicationinsights/arm-appinsights/package.json @@ -1,59 +1,98 @@ { "name": "@azure/arm-appinsights", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "ApplicationInsightsManagementClient Library with typescript type definitions for node.js and browser.", - "version": "3.1.0", + "description": "A generated SDK for ApplicationInsightsManagementClient.", + "version": "5.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-appinsights.js", - "module": "./esm/applicationInsightsManagementClient.js", - "types": "./esm/applicationInsightsManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-appinsights.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/applicationinsights/arm-appinsights", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-appinsights.js.map'\" -o ./dist/arm-appinsights.min.js ./dist/arm-appinsights.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/ApplicationInsightsManagementClient.ts", + "prefix": "packageDetails" + } + ] + }, "autoPublish": true } diff --git a/sdk/applicationinsights/arm-appinsights/recordings/node/my_test/recording_sample_test.js b/sdk/applicationinsights/arm-appinsights/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/applicationinsights/arm-appinsights/review/arm-appinsights.api.md b/sdk/applicationinsights/arm-appinsights/review/arm-appinsights.api.md new file mode 100644 index 000000000000..7b40e42381ee --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/review/arm-appinsights.api.md @@ -0,0 +1,1779 @@ +## API Report File for "@azure/arm-appinsights" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; + +// @public +export interface AnalyticsItems { + delete(resourceGroupName: string, resourceName: string, scopePath: ItemScopePath, options?: AnalyticsItemsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, scopePath: ItemScopePath, options?: AnalyticsItemsGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, scopePath: ItemScopePath, options?: AnalyticsItemsListOptionalParams): Promise; + put(resourceGroupName: string, resourceName: string, scopePath: ItemScopePath, itemProperties: ApplicationInsightsComponentAnalyticsItem, options?: AnalyticsItemsPutOptionalParams): Promise; +} + +// @public +export interface AnalyticsItemsDeleteOptionalParams extends coreClient.OperationOptions { + id?: string; + name?: string; +} + +// @public +export interface AnalyticsItemsGetOptionalParams extends coreClient.OperationOptions { + id?: string; + name?: string; +} + +// @public +export type AnalyticsItemsGetResponse = ApplicationInsightsComponentAnalyticsItem; + +// @public +export interface AnalyticsItemsListOptionalParams extends coreClient.OperationOptions { + includeContent?: boolean; + scope?: ItemScope; + typeParam?: ItemTypeParameter; +} + +// @public +export type AnalyticsItemsListResponse = ApplicationInsightsComponentAnalyticsItem[]; + +// @public +export interface AnalyticsItemsPutOptionalParams extends coreClient.OperationOptions { + overrideItem?: boolean; +} + +// @public +export type AnalyticsItemsPutResponse = ApplicationInsightsComponentAnalyticsItem; + +// @public +export interface Annotation { + annotationName?: string; + category?: string; + eventTime?: Date; + id?: string; + properties?: string; + relatedAnnotation?: string; +} + +// @public +export interface AnnotationError { + code?: string; + innererror?: InnerError; + message?: string; +} + +// @public +export interface Annotations { + create(resourceGroupName: string, resourceName: string, annotationProperties: Annotation, options?: AnnotationsCreateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, annotationId: string, options?: AnnotationsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, annotationId: string, options?: AnnotationsGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, start: string, end: string, options?: AnnotationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AnnotationsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AnnotationsCreateResponse = Annotation[]; + +// @public +export interface AnnotationsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface AnnotationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AnnotationsGetResponse = Annotation[]; + +// @public +export interface AnnotationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AnnotationsListResponse = AnnotationsListResult; + +// @public +export interface AnnotationsListResult { + readonly value?: Annotation[]; +} + +// @public +export interface APIKeyRequest { + linkedReadProperties?: string[]; + linkedWriteProperties?: string[]; + name?: string; +} + +// @public +export interface APIKeys { + create(resourceGroupName: string, resourceName: string, aPIKeyProperties: APIKeyRequest, options?: APIKeysCreateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, keyId: string, options?: APIKeysDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, keyId: string, options?: APIKeysGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, options?: APIKeysListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface APIKeysCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type APIKeysCreateResponse = ApplicationInsightsComponentAPIKey; + +// @public +export interface APIKeysDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type APIKeysDeleteResponse = ApplicationInsightsComponentAPIKey; + +// @public +export interface APIKeysGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type APIKeysGetResponse = ApplicationInsightsComponentAPIKey; + +// @public +export interface APIKeysListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type APIKeysListResponse = ApplicationInsightsComponentAPIKeyListResult; + +// @public +export type ApplicationInsightsComponent = ComponentsResource & { + kind: string; + readonly applicationId?: string; + readonly appId?: string; + applicationType?: ApplicationType; + flowType?: FlowType; + requestSource?: RequestSource; + readonly instrumentationKey?: string; + readonly creationDate?: Date; + readonly tenantId?: string; + hockeyAppId?: string; + readonly hockeyAppToken?: string; + readonly provisioningState?: string; + samplingPercentage?: number; + readonly connectionString?: string; + retentionInDays?: number; + disableIpMasking?: boolean; + immediatePurgeDataOn30Days?: boolean; + readonly privateLinkScopedResources?: PrivateLinkScopedResource[]; + publicNetworkAccessForIngestion?: PublicNetworkAccessType; + publicNetworkAccessForQuery?: PublicNetworkAccessType; + ingestionMode?: IngestionMode; +}; + +// @public +export interface ApplicationInsightsComponentAnalyticsItem { + content?: string; + id?: string; + name?: string; + properties?: ApplicationInsightsComponentAnalyticsItemProperties; + scope?: ItemScope; + readonly timeCreated?: string; + readonly timeModified?: string; + type?: ItemType; + readonly version?: string; +} + +// @public +export interface ApplicationInsightsComponentAnalyticsItemProperties { + functionAlias?: string; +} + +// @public +export interface ApplicationInsightsComponentAPIKey { + readonly apiKey?: string; + createdDate?: string; + readonly id?: string; + linkedReadProperties?: string[]; + linkedWriteProperties?: string[]; + name?: string; +} + +// @public +export interface ApplicationInsightsComponentAPIKeyListResult { + value: ApplicationInsightsComponentAPIKey[]; +} + +// @public +export interface ApplicationInsightsComponentAvailableFeatures { + readonly result?: ApplicationInsightsComponentFeature[]; +} + +// @public +export interface ApplicationInsightsComponentBillingFeatures { + currentBillingFeatures?: string[]; + dataVolumeCap?: ApplicationInsightsComponentDataVolumeCap; +} + +// @public +export interface ApplicationInsightsComponentDataVolumeCap { + cap?: number; + readonly maxHistoryCap?: number; + readonly resetTime?: number; + stopSendNotificationWhenHitCap?: boolean; + stopSendNotificationWhenHitThreshold?: boolean; + warningThreshold?: number; +} + +// @public +export interface ApplicationInsightsComponentExportConfiguration { + readonly applicationName?: string; + readonly containerName?: string; + readonly destinationAccountId?: string; + readonly destinationStorageLocationId?: string; + readonly destinationStorageSubscriptionId?: string; + readonly destinationType?: string; + readonly exportId?: string; + readonly exportStatus?: string; + readonly instrumentationKey?: string; + readonly isUserEnabled?: string; + readonly lastGapTime?: string; + readonly lastSuccessTime?: string; + readonly lastUserUpdate?: string; + notificationQueueEnabled?: string; + readonly permanentErrorReason?: string; + recordTypes?: string; + readonly resourceGroup?: string; + readonly storageName?: string; + readonly subscriptionId?: string; +} + +// @public +export interface ApplicationInsightsComponentExportRequest { + destinationAccountId?: string; + destinationAddress?: string; + destinationStorageLocationId?: string; + destinationStorageSubscriptionId?: string; + destinationType?: string; + isEnabled?: string; + notificationQueueEnabled?: string; + notificationQueueUri?: string; + recordTypes?: string; +} + +// @public +export interface ApplicationInsightsComponentFavorite { + category?: string; + config?: string; + readonly favoriteId?: string; + favoriteType?: FavoriteType; + isGeneratedFromTemplate?: boolean; + name?: string; + sourceType?: string; + tags?: string[]; + readonly timeModified?: string; + readonly userId?: string; + version?: string; +} + +// @public +export interface ApplicationInsightsComponentFeature { + readonly capabilities?: ApplicationInsightsComponentFeatureCapability[]; + readonly featureName?: string; + readonly isHidden?: boolean; + readonly isMainFeature?: boolean; + readonly meterId?: string; + readonly meterRateFrequency?: string; + readonly resouceId?: string; + readonly supportedAddonFeatures?: string; + readonly title?: string; +} + +// @public +export interface ApplicationInsightsComponentFeatureCapabilities { + readonly analyticsIntegration?: boolean; + readonly apiAccessLevel?: string; + readonly applicationMap?: boolean; + readonly burstThrottlePolicy?: string; + readonly dailyCap?: number; + readonly dailyCapResetTime?: number; + readonly liveStreamMetrics?: boolean; + readonly metadataClass?: string; + readonly multipleStepWebTest?: boolean; + readonly openSchema?: boolean; + readonly powerBIIntegration?: boolean; + readonly proactiveDetection?: boolean; + readonly supportExportData?: boolean; + readonly throttleRate?: number; + readonly trackingType?: string; + readonly workItemIntegration?: boolean; +} + +// @public +export interface ApplicationInsightsComponentFeatureCapability { + readonly description?: string; + readonly meterId?: string; + readonly meterRateFrequency?: string; + readonly name?: string; + readonly unit?: string; + readonly value?: string; +} + +// @public +export interface ApplicationInsightsComponentListResult { + nextLink?: string; + value: ApplicationInsightsComponent[]; +} + +// @public +export interface ApplicationInsightsComponentProactiveDetectionConfiguration { + customEmails?: string[]; + enabled?: boolean; + lastUpdatedTime?: string; + name?: string; + ruleDefinitions?: ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions; + sendEmailsToSubscriptionOwners?: boolean; +} + +// @public +export interface ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions { + description?: string; + displayName?: string; + helpUrl?: string; + isEnabledByDefault?: boolean; + isHidden?: boolean; + isInPreview?: boolean; + name?: string; + supportsEmailNotifications?: boolean; +} + +// @public +export interface ApplicationInsightsComponentQuotaStatus { + readonly appId?: string; + readonly expirationTime?: string; + readonly shouldBeThrottled?: boolean; +} + +// @public +export interface ApplicationInsightsComponentWebTestLocation { + readonly displayName?: string; + readonly tag?: string; +} + +// @public (undocumented) +export class ApplicationInsightsManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ApplicationInsightsManagementClientOptionalParams); + // (undocumented) + analyticsItems: AnalyticsItems; + // (undocumented) + annotations: Annotations; + // (undocumented) + aPIKeys: APIKeys; + // (undocumented) + componentAvailableFeatures: ComponentAvailableFeatures; + // (undocumented) + componentCurrentBillingFeatures: ComponentCurrentBillingFeatures; + // (undocumented) + componentFeatureCapabilities: ComponentFeatureCapabilities; + // (undocumented) + componentLinkedStorageAccountsOperations: ComponentLinkedStorageAccountsOperations; + // (undocumented) + componentQuotaStatus: ComponentQuotaStatus; + // (undocumented) + components: Components; + // (undocumented) + exportConfigurations: ExportConfigurations; + // (undocumented) + favorites: Favorites; + // (undocumented) + liveToken: LiveToken; + // (undocumented) + myWorkbooks: MyWorkbooks; + // (undocumented) + operations: Operations; + // (undocumented) + proactiveDetectionConfigurations: ProactiveDetectionConfigurations; + // (undocumented) + subscriptionId: string; + // (undocumented) + webTestLocations: WebTestLocations; + // (undocumented) + webTests: WebTests; + // (undocumented) + workbooks: Workbooks; + // (undocumented) + workbookTemplates: WorkbookTemplates; + // (undocumented) + workItemConfigurations: WorkItemConfigurations; +} + +// @public +export interface ApplicationInsightsManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + endpoint?: string; +} + +// @public +export interface ApplicationInsightsWebTestLocationsListResult { + value: ApplicationInsightsComponentWebTestLocation[]; +} + +// @public +export type ApplicationType = string; + +// @public +export type CategoryType = string; + +// @public +export interface ComponentAvailableFeatures { + get(resourceGroupName: string, resourceName: string, options?: ComponentAvailableFeaturesGetOptionalParams): Promise; +} + +// @public +export interface ComponentAvailableFeaturesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentAvailableFeaturesGetResponse = ApplicationInsightsComponentAvailableFeatures; + +// @public +export interface ComponentCurrentBillingFeatures { + get(resourceGroupName: string, resourceName: string, options?: ComponentCurrentBillingFeaturesGetOptionalParams): Promise; + update(resourceGroupName: string, resourceName: string, billingFeaturesProperties: ApplicationInsightsComponentBillingFeatures, options?: ComponentCurrentBillingFeaturesUpdateOptionalParams): Promise; +} + +// @public +export interface ComponentCurrentBillingFeaturesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentCurrentBillingFeaturesGetResponse = ApplicationInsightsComponentBillingFeatures; + +// @public +export interface ComponentCurrentBillingFeaturesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentCurrentBillingFeaturesUpdateResponse = ApplicationInsightsComponentBillingFeatures; + +// @public +export interface ComponentFeatureCapabilities { + get(resourceGroupName: string, resourceName: string, options?: ComponentFeatureCapabilitiesGetOptionalParams): Promise; +} + +// @public +export interface ComponentFeatureCapabilitiesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentFeatureCapabilitiesGetResponse = ApplicationInsightsComponentFeatureCapabilities; + +// @public +export type ComponentLinkedStorageAccounts = ProxyResource & { + linkedStorageAccount?: string; +}; + +// @public +export interface ComponentLinkedStorageAccountsCreateAndUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentLinkedStorageAccountsCreateAndUpdateResponse = ComponentLinkedStorageAccounts; + +// @public +export interface ComponentLinkedStorageAccountsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ComponentLinkedStorageAccountsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentLinkedStorageAccountsGetResponse = ComponentLinkedStorageAccounts; + +// @public +export interface ComponentLinkedStorageAccountsOperations { + createAndUpdate(resourceGroupName: string, resourceName: string, storageType: StorageType, linkedStorageAccountsProperties: ComponentLinkedStorageAccounts, options?: ComponentLinkedStorageAccountsCreateAndUpdateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, storageType: StorageType, options?: ComponentLinkedStorageAccountsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, storageType: StorageType, options?: ComponentLinkedStorageAccountsGetOptionalParams): Promise; + update(resourceGroupName: string, resourceName: string, storageType: StorageType, linkedStorageAccountsProperties: ComponentLinkedStorageAccountsPatch, options?: ComponentLinkedStorageAccountsUpdateOptionalParams): Promise; +} + +// @public +export interface ComponentLinkedStorageAccountsPatch { + linkedStorageAccount?: string; +} + +// @public +export interface ComponentLinkedStorageAccountsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentLinkedStorageAccountsUpdateResponse = ComponentLinkedStorageAccounts; + +// @public +export interface ComponentPurgeBody { + filters: ComponentPurgeBodyFilters[]; + table: string; +} + +// @public +export interface ComponentPurgeBodyFilters { + column?: string; + key?: string; + operator?: string; + value?: any; +} + +// @public +export interface ComponentPurgeResponse { + operationId: string; +} + +// @public +export interface ComponentPurgeStatusResponse { + status: PurgeState; +} + +// @public +export interface ComponentQuotaStatus { + get(resourceGroupName: string, resourceName: string, options?: ComponentQuotaStatusGetOptionalParams): Promise; +} + +// @public +export interface ComponentQuotaStatusGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentQuotaStatusGetResponse = ApplicationInsightsComponentQuotaStatus; + +// @public +export interface Components { + createOrUpdate(resourceGroupName: string, resourceName: string, insightProperties: ApplicationInsightsComponent, options?: ComponentsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, options?: ComponentsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, options?: ComponentsGetOptionalParams): Promise; + getPurgeStatus(resourceGroupName: string, resourceName: string, purgeId: string, options?: ComponentsGetPurgeStatusOptionalParams): Promise; + list(options?: ComponentsListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: ComponentsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + purge(resourceGroupName: string, resourceName: string, body: ComponentPurgeBody, options?: ComponentsPurgeOptionalParams): Promise; + updateTags(resourceGroupName: string, resourceName: string, componentTags: TagsResource, options?: ComponentsUpdateTagsOptionalParams): Promise; +} + +// @public +export interface ComponentsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentsCreateOrUpdateResponse = ApplicationInsightsComponent; + +// @public +export interface ComponentsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ComponentsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ComponentsGetPurgeStatusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentsGetPurgeStatusResponse = ComponentPurgeStatusResponse; + +// @public +export type ComponentsGetResponse = ApplicationInsightsComponent; + +// @public +export interface ComponentsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentsListByResourceGroupNextResponse = ApplicationInsightsComponentListResult; + +// @public +export interface ComponentsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentsListByResourceGroupResponse = ApplicationInsightsComponentListResult; + +// @public +export interface ComponentsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentsListNextResponse = ApplicationInsightsComponentListResult; + +// @public +export interface ComponentsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentsListResponse = ApplicationInsightsComponentListResult; + +// @public +export interface ComponentsPurgeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentsPurgeResponse = ComponentPurgeResponse; + +// @public +export interface ComponentsResource { + readonly id?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface ComponentsUpdateTagsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ComponentsUpdateTagsResponse = ApplicationInsightsComponent; + +// @public +export type CreatedByType = string; + +// @public +export interface ErrorDefinition { + readonly code?: string; + readonly innererror?: any; + readonly message?: string; +} + +// @public +export interface ErrorResponse { + code?: string; + message?: string; +} + +// @public (undocumented) +export interface ErrorResponseLinkedStorage { + error?: ErrorResponseLinkedStorageError; +} + +// @public +export interface ErrorResponseLinkedStorageError { + readonly code?: string; + readonly message?: string; +} + +// @public +export interface ExportConfigurations { + create(resourceGroupName: string, resourceName: string, exportProperties: ApplicationInsightsComponentExportRequest, options?: ExportConfigurationsCreateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, exportId: string, options?: ExportConfigurationsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, exportId: string, options?: ExportConfigurationsGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, options?: ExportConfigurationsListOptionalParams): Promise; + update(resourceGroupName: string, resourceName: string, exportId: string, exportProperties: ApplicationInsightsComponentExportRequest, options?: ExportConfigurationsUpdateOptionalParams): Promise; +} + +// @public +export interface ExportConfigurationsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExportConfigurationsCreateResponse = ApplicationInsightsComponentExportConfiguration[]; + +// @public +export interface ExportConfigurationsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExportConfigurationsDeleteResponse = ApplicationInsightsComponentExportConfiguration; + +// @public +export interface ExportConfigurationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExportConfigurationsGetResponse = ApplicationInsightsComponentExportConfiguration; + +// @public +export interface ExportConfigurationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExportConfigurationsListResponse = ApplicationInsightsComponentExportConfiguration[]; + +// @public +export interface ExportConfigurationsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExportConfigurationsUpdateResponse = ApplicationInsightsComponentExportConfiguration; + +// @public +export interface Favorites { + add(resourceGroupName: string, resourceName: string, favoriteId: string, favoriteProperties: ApplicationInsightsComponentFavorite, options?: FavoritesAddOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, favoriteId: string, options?: FavoritesDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, favoriteId: string, options?: FavoritesGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, options?: FavoritesListOptionalParams): Promise; + update(resourceGroupName: string, resourceName: string, favoriteId: string, favoriteProperties: ApplicationInsightsComponentFavorite, options?: FavoritesUpdateOptionalParams): Promise; +} + +// @public +export interface FavoritesAddOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FavoritesAddResponse = ApplicationInsightsComponentFavorite; + +// @public +export interface FavoritesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface FavoritesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FavoritesGetResponse = ApplicationInsightsComponentFavorite; + +// @public +export interface FavoritesListOptionalParams extends coreClient.OperationOptions { + canFetchContent?: boolean; + favoriteType?: FavoriteType; + sourceType?: FavoriteSourceType; + tags?: string[]; +} + +// @public +export type FavoritesListResponse = ApplicationInsightsComponentFavorite[]; + +// @public +export type FavoriteSourceType = string; + +// @public +export interface FavoritesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FavoritesUpdateResponse = ApplicationInsightsComponentFavorite; + +// @public +export type FavoriteType = "shared" | "user"; + +// @public +export type FlowType = string; + +// @public +export type IngestionMode = string; + +// @public +export interface InnerError { + diagnosticcontext?: string; + time?: Date; +} + +// @public +export interface InnerErrorTrace { + readonly trace?: string[]; +} + +// @public +export type ItemScope = string; + +// @public +export type ItemScopePath = string; + +// @public +export type ItemType = string; + +// @public +export type ItemTypeParameter = string; + +// @public +export type Kind = string; + +// @public +export enum KnownApplicationType { + // (undocumented) + Other = "other", + // (undocumented) + Web = "web" +} + +// @public +export enum KnownCategoryType { + // (undocumented) + Performance = "performance", + // (undocumented) + Retention = "retention", + // (undocumented) + TSG = "TSG", + // (undocumented) + Workbook = "workbook" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownFavoriteSourceType { + // (undocumented) + Events = "events", + // (undocumented) + Funnel = "funnel", + // (undocumented) + Impact = "impact", + // (undocumented) + Notebook = "notebook", + // (undocumented) + Retention = "retention", + // (undocumented) + Segmentation = "segmentation", + // (undocumented) + Sessions = "sessions", + // (undocumented) + Userflows = "userflows" +} + +// @public +export enum KnownFlowType { + // (undocumented) + Bluefield = "Bluefield" +} + +// @public +export enum KnownIngestionMode { + // (undocumented) + ApplicationInsights = "ApplicationInsights", + // (undocumented) + ApplicationInsightsWithDiagnosticSettings = "ApplicationInsightsWithDiagnosticSettings", + // (undocumented) + LogAnalytics = "LogAnalytics" +} + +// @public +export enum KnownItemScope { + // (undocumented) + Shared = "shared", + // (undocumented) + User = "user" +} + +// @public +export enum KnownItemScopePath { + // (undocumented) + AnalyticsItems = "analyticsItems", + // (undocumented) + MyanalyticsItems = "myanalyticsItems" +} + +// @public +export enum KnownItemType { + // (undocumented) + Function = "function", + // (undocumented) + None = "none", + // (undocumented) + Query = "query", + // (undocumented) + Recent = "recent" +} + +// @public +export enum KnownItemTypeParameter { + // (undocumented) + Folder = "folder", + // (undocumented) + Function = "function", + // (undocumented) + None = "none", + // (undocumented) + Query = "query", + // (undocumented) + Recent = "recent" +} + +// @public +export enum KnownKind { + // (undocumented) + Shared = "shared", + // (undocumented) + User = "user" +} + +// @public +export enum KnownManagedServiceIdentityType { + // (undocumented) + None = "None", + // (undocumented) + SystemAssigned = "SystemAssigned", + // (undocumented) + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", + // (undocumented) + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownMyWorkbookManagedIdentityType { + // (undocumented) + None = "None", + // (undocumented) + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownPublicNetworkAccessType { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownPurgeState { + // (undocumented) + Completed = "completed", + // (undocumented) + Pending = "pending" +} + +// @public +export enum KnownRequestSource { + // (undocumented) + Rest = "rest" +} + +// @public +export enum KnownSharedTypeKind { + // (undocumented) + Shared = "shared", + // (undocumented) + User = "user" +} + +// @public +export enum KnownStorageType { + // (undocumented) + ServiceProfiler = "ServiceProfiler" +} + +// @public +export interface LiveToken { + get(resourceUri: string, options?: LiveTokenGetOptionalParams): Promise; +} + +// @public +export interface LiveTokenGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LiveTokenGetResponse = LiveTokenResponse; + +// @public +export interface LiveTokenResponse { + readonly liveToken?: string; +} + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; +} + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export type MyWorkbook = MyWorkbookResource & { + kind?: Kind; + readonly systemData?: SystemData; + displayName?: string; + serializedData?: string; + version?: string; + readonly timeModified?: string; + category?: string; + tagsPropertiesTags?: string[]; + readonly userId?: string; + sourceId?: string; + storageUri?: string; +}; + +// @public +export interface MyWorkbookError { + error?: ErrorDefinition; +} + +// @public +export interface MyWorkbookManagedIdentity { + type?: MyWorkbookManagedIdentityType; + userAssignedIdentities?: MyWorkbookUserAssignedIdentities; +} + +// @public +export type MyWorkbookManagedIdentityType = string; + +// @public +export interface MyWorkbookResource { + etag?: { + [propertyName: string]: string; + }; + id?: string; + identity?: MyWorkbookManagedIdentity; + location?: string; + name?: string; + tags?: { + [propertyName: string]: string; + }; + type?: string; +} + +// @public +export interface MyWorkbooks { + createOrUpdate(resourceGroupName: string, resourceName: string, workbookProperties: MyWorkbook, options?: MyWorkbooksCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, options?: MyWorkbooksDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, options?: MyWorkbooksGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, category: CategoryType, options?: MyWorkbooksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(category: CategoryType, options?: MyWorkbooksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, resourceName: string, workbookProperties: MyWorkbook, options?: MyWorkbooksUpdateOptionalParams): Promise; +} + +// @public +export interface MyWorkbooksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + sourceId?: string; +} + +// @public +export type MyWorkbooksCreateOrUpdateResponse = MyWorkbook; + +// @public +export interface MyWorkbooksDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface MyWorkbooksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MyWorkbooksGetResponse = MyWorkbook; + +// @public +export interface MyWorkbooksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + canFetchContent?: boolean; + sourceId?: string; + tags?: string[]; +} + +// @public +export type MyWorkbooksListByResourceGroupNextResponse = MyWorkbooksListResult; + +// @public +export interface MyWorkbooksListByResourceGroupOptionalParams extends coreClient.OperationOptions { + canFetchContent?: boolean; + sourceId?: string; + tags?: string[]; +} + +// @public +export type MyWorkbooksListByResourceGroupResponse = MyWorkbooksListResult; + +// @public +export interface MyWorkbooksListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + canFetchContent?: boolean; + tags?: string[]; +} + +// @public +export type MyWorkbooksListBySubscriptionNextResponse = MyWorkbooksListResult; + +// @public +export interface MyWorkbooksListBySubscriptionOptionalParams extends coreClient.OperationOptions { + canFetchContent?: boolean; + tags?: string[]; +} + +// @public +export type MyWorkbooksListBySubscriptionResponse = MyWorkbooksListResult; + +// @public +export interface MyWorkbooksListResult { + // (undocumented) + nextLink?: string; + readonly value?: MyWorkbook[]; +} + +// @public +export interface MyWorkbooksUpdateOptionalParams extends coreClient.OperationOptions { + sourceId?: string; +} + +// @public +export type MyWorkbooksUpdateResponse = MyWorkbook; + +// @public +export interface MyWorkbookUserAssignedIdentities { + readonly principalId?: string; + readonly tenantId?: string; +} + +// @public +export interface Operation { + display?: OperationDisplay; + name?: string; +} + +// @public +export interface OperationDisplay { + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationInfo { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationListResult { + nextLink?: string; + value?: Operation[]; +} + +// @public +export interface OperationLive { + display?: OperationInfo; + name?: string; + origin?: string; + properties?: Record; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationsListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationsListResult; + +// @public +export interface OperationsListResult { + nextLink?: string; + value?: OperationLive[]; +} + +// @public +export interface PrivateLinkScopedResource { + resourceId?: string; + scopeId?: string; +} + +// @public +export interface ProactiveDetectionConfigurations { + get(resourceGroupName: string, resourceName: string, configurationId: string, options?: ProactiveDetectionConfigurationsGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, options?: ProactiveDetectionConfigurationsListOptionalParams): Promise; + update(resourceGroupName: string, resourceName: string, configurationId: string, proactiveDetectionProperties: ApplicationInsightsComponentProactiveDetectionConfiguration, options?: ProactiveDetectionConfigurationsUpdateOptionalParams): Promise; +} + +// @public +export interface ProactiveDetectionConfigurationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProactiveDetectionConfigurationsGetResponse = ApplicationInsightsComponentProactiveDetectionConfiguration; + +// @public +export interface ProactiveDetectionConfigurationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProactiveDetectionConfigurationsListResponse = ApplicationInsightsComponentProactiveDetectionConfiguration[]; + +// @public +export interface ProactiveDetectionConfigurationsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProactiveDetectionConfigurationsUpdateResponse = ApplicationInsightsComponentProactiveDetectionConfiguration; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export type PublicNetworkAccessType = string; + +// @public +export type PurgeState = string; + +// @public +export type RequestSource = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type SharedTypeKind = string; + +// @public +export type StorageType = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TagsResource { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export type WebTest = WebtestsResource & { + kind?: WebTestKind; + syntheticMonitorId?: string; + webTestName?: string; + description?: string; + enabled?: boolean; + frequency?: number; + timeout?: number; + webTestKind?: WebTestKind; + retryEnabled?: boolean; + locations?: WebTestGeolocation[]; + configuration?: WebTestPropertiesConfiguration; + readonly provisioningState?: string; +}; + +// @public +export interface WebTestGeolocation { + location?: string; +} + +// @public +export type WebTestKind = "ping" | "multistep"; + +// @public +export interface WebTestListResult { + nextLink?: string; + value: WebTest[]; +} + +// @public +export interface WebTestLocations { + list(resourceGroupName: string, resourceName: string, options?: WebTestLocationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface WebTestLocationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WebTestLocationsListResponse = ApplicationInsightsWebTestLocationsListResult; + +// @public +export interface WebTestPropertiesConfiguration { + webTest?: string; +} + +// @public +export interface WebTests { + createOrUpdate(resourceGroupName: string, webTestName: string, webTestDefinition: WebTest, options?: WebTestsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, webTestName: string, options?: WebTestsDeleteOptionalParams): Promise; + get(resourceGroupName: string, webTestName: string, options?: WebTestsGetOptionalParams): Promise; + list(options?: WebTestsListOptionalParams): PagedAsyncIterableIterator; + listByComponent(componentName: string, resourceGroupName: string, options?: WebTestsListByComponentOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: WebTestsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + updateTags(resourceGroupName: string, webTestName: string, webTestTags: TagsResource, options?: WebTestsUpdateTagsOptionalParams): Promise; +} + +// @public +export interface WebTestsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WebTestsCreateOrUpdateResponse = WebTest; + +// @public +export interface WebTestsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface WebTestsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WebTestsGetResponse = WebTest; + +// @public +export interface WebTestsListByComponentNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WebTestsListByComponentNextResponse = WebTestListResult; + +// @public +export interface WebTestsListByComponentOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WebTestsListByComponentResponse = WebTestListResult; + +// @public +export interface WebTestsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WebTestsListByResourceGroupNextResponse = WebTestListResult; + +// @public +export interface WebTestsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WebTestsListByResourceGroupResponse = WebTestListResult; + +// @public +export interface WebTestsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WebTestsListNextResponse = WebTestListResult; + +// @public +export interface WebTestsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WebTestsListResponse = WebTestListResult; + +// @public +export interface WebtestsResource { + readonly id?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface WebTestsUpdateTagsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WebTestsUpdateTagsResponse = WebTest; + +// @public +export type Workbook = WorkbookResource & { + readonly systemData?: SystemData; + displayName?: string; + serializedData?: string; + version?: string; + readonly timeModified?: Date; + category?: string; + tagsPropertiesTags?: string[]; + readonly userId?: string; + sourceId?: string; + storageUri?: string; + description?: string; + readonly revision?: string; +}; + +// @public +export interface WorkbookError { + error?: WorkbookErrorDefinition; +} + +// @public +export interface WorkbookErrorDefinition { + readonly code?: string; + readonly innerError?: any; + readonly message?: string; +} + +// @public +export interface WorkbookInnerErrorTrace { + readonly trace?: string[]; +} + +// @public +export type WorkbookResource = TrackedResource & { + identity?: WorkbookResourceIdentity; + kind?: Kind; + etag?: string; +}; + +// @public +export type WorkbookResourceIdentity = ManagedServiceIdentity & {}; + +// @public +export interface Workbooks { + createOrUpdate(resourceGroupName: string, resourceName: string, workbookProperties: Workbook, options?: WorkbooksCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, options?: WorkbooksDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, options?: WorkbooksGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, category: CategoryType, options?: WorkbooksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(category: CategoryType, options?: WorkbooksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + listRevisionsList(resourceGroupName: string, resourceName: string, options?: WorkbooksRevisionsListOptionalParams): PagedAsyncIterableIterator; + revisionGet(resourceGroupName: string, resourceName: string, revisionId: string, options?: WorkbooksRevisionGetOptionalParams): Promise; + update(resourceGroupName: string, resourceName: string, options?: WorkbooksUpdateOptionalParams): Promise; +} + +// @public +export interface WorkbooksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + sourceId?: string; +} + +// @public +export type WorkbooksCreateOrUpdateResponse = Workbook; + +// @public +export interface WorkbooksDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface WorkbooksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkbooksGetResponse = Workbook; + +// @public +export interface WorkbooksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + canFetchContent?: boolean; + sourceId?: string; + tags?: string[]; +} + +// @public +export type WorkbooksListByResourceGroupNextResponse = WorkbooksListResult; + +// @public +export interface WorkbooksListByResourceGroupOptionalParams extends coreClient.OperationOptions { + canFetchContent?: boolean; + sourceId?: string; + tags?: string[]; +} + +// @public +export type WorkbooksListByResourceGroupResponse = WorkbooksListResult; + +// @public +export interface WorkbooksListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + canFetchContent?: boolean; + tags?: string[]; +} + +// @public +export type WorkbooksListBySubscriptionNextResponse = WorkbooksListResult; + +// @public +export interface WorkbooksListBySubscriptionOptionalParams extends coreClient.OperationOptions { + canFetchContent?: boolean; + tags?: string[]; +} + +// @public +export type WorkbooksListBySubscriptionResponse = WorkbooksListResult; + +// @public +export interface WorkbooksListResult { + // (undocumented) + nextLink?: string; + readonly value?: Workbook[]; +} + +// @public +export interface WorkbooksRevisionGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkbooksRevisionGetResponse = Workbook; + +// @public +export interface WorkbooksRevisionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkbooksRevisionsListNextResponse = WorkbooksListResult; + +// @public +export interface WorkbooksRevisionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkbooksRevisionsListResponse = WorkbooksListResult; + +// @public +export interface WorkbooksUpdateOptionalParams extends coreClient.OperationOptions { + sourceId?: string; + workbookUpdateParameters?: WorkbookUpdateParameters; +} + +// @public +export type WorkbooksUpdateResponse = Workbook; + +// @public +export type WorkbookTemplate = WorkbookTemplateResource & { + priority?: number; + author?: string; + templateData?: Record; + galleries?: WorkbookTemplateGallery[]; + localized?: { + [propertyName: string]: WorkbookTemplateLocalizedGallery[]; + }; +}; + +// @public +export interface WorkbookTemplateError { + error?: WorkbookTemplateErrorBody; +} + +// @public +export interface WorkbookTemplateErrorBody { + code?: string; + details?: WorkbookTemplateErrorFieldContract[]; + message?: string; +} + +// @public +export interface WorkbookTemplateErrorFieldContract { + code?: string; + message?: string; + target?: string; +} + +// @public +export interface WorkbookTemplateGallery { + category?: string; + name?: string; + order?: number; + resourceType?: string; + type?: string; +} + +// @public +export interface WorkbookTemplateLocalizedGallery { + galleries?: WorkbookTemplateGallery[]; + templateData?: Record; +} + +// @public +export interface WorkbookTemplateResource { + readonly id?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface WorkbookTemplates { + createOrUpdate(resourceGroupName: string, resourceName: string, workbookTemplateProperties: WorkbookTemplate, options?: WorkbookTemplatesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, options?: WorkbookTemplatesDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, options?: WorkbookTemplatesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: WorkbookTemplatesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, resourceName: string, options?: WorkbookTemplatesUpdateOptionalParams): Promise; +} + +// @public +export interface WorkbookTemplatesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkbookTemplatesCreateOrUpdateResponse = WorkbookTemplate; + +// @public +export interface WorkbookTemplatesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface WorkbookTemplatesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkbookTemplatesGetResponse = WorkbookTemplate; + +// @public +export interface WorkbookTemplatesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkbookTemplatesListByResourceGroupResponse = WorkbookTemplatesListResult; + +// @public +export interface WorkbookTemplatesListResult { + value?: WorkbookTemplate[]; +} + +// @public +export interface WorkbookTemplatesUpdateOptionalParams extends coreClient.OperationOptions { + workbookTemplateUpdateParameters?: WorkbookTemplateUpdateParameters; +} + +// @public +export type WorkbookTemplatesUpdateResponse = WorkbookTemplate; + +// @public +export interface WorkbookTemplateUpdateParameters { + author?: string; + galleries?: WorkbookTemplateGallery[]; + localized?: { + [propertyName: string]: WorkbookTemplateLocalizedGallery[]; + }; + priority?: number; + tags?: { + [propertyName: string]: string; + }; + templateData?: Record; +} + +// @public +export interface WorkbookUpdateParameters { + category?: string; + description?: string; + displayName?: string; + kind?: SharedTypeKind; + revision?: string; + serializedData?: string; + tags?: { + [propertyName: string]: string; + }; + tagsPropertiesTags?: string[]; +} + +// @public +export interface WorkItemConfiguration { + configDisplayName?: string; + configProperties?: string; + connectorId?: string; + id?: string; + isDefault?: boolean; +} + +// @public +export interface WorkItemConfigurationError { + code?: string; + innererror?: InnerError; + message?: string; +} + +// @public +export interface WorkItemConfigurations { + create(resourceGroupName: string, resourceName: string, workItemConfigurationProperties: WorkItemCreateConfiguration, options?: WorkItemConfigurationsCreateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, workItemConfigId: string, options?: WorkItemConfigurationsDeleteOptionalParams): Promise; + getDefault(resourceGroupName: string, resourceName: string, options?: WorkItemConfigurationsGetDefaultOptionalParams): Promise; + getItem(resourceGroupName: string, resourceName: string, workItemConfigId: string, options?: WorkItemConfigurationsGetItemOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, options?: WorkItemConfigurationsListOptionalParams): PagedAsyncIterableIterator; + updateItem(resourceGroupName: string, resourceName: string, workItemConfigId: string, workItemConfigurationProperties: WorkItemCreateConfiguration, options?: WorkItemConfigurationsUpdateItemOptionalParams): Promise; +} + +// @public +export interface WorkItemConfigurationsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkItemConfigurationsCreateResponse = WorkItemConfiguration; + +// @public +export interface WorkItemConfigurationsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface WorkItemConfigurationsGetDefaultOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkItemConfigurationsGetDefaultResponse = WorkItemConfiguration; + +// @public +export interface WorkItemConfigurationsGetItemOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkItemConfigurationsGetItemResponse = WorkItemConfiguration; + +// @public +export interface WorkItemConfigurationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkItemConfigurationsListResponse = WorkItemConfigurationsListResult; + +// @public +export interface WorkItemConfigurationsListResult { + readonly value?: WorkItemConfiguration[]; +} + +// @public +export interface WorkItemConfigurationsUpdateItemOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkItemConfigurationsUpdateItemResponse = WorkItemConfiguration; + +// @public +export interface WorkItemCreateConfiguration { + connectorDataConfiguration?: string; + connectorId?: string; + validateOnly?: boolean; + workItemProperties?: { + [propertyName: string]: string; + }; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/applicationinsights/arm-appinsights/rollup.config.js b/sdk/applicationinsights/arm-appinsights/rollup.config.js index 034249a738d2..9be1955eb7f1 100644 --- a/sdk/applicationinsights/arm-appinsights/rollup.config.js +++ b/sdk/applicationinsights/arm-appinsights/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/applicationInsightsManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-appinsights.js", - format: "umd", - name: "Azure.ArmAppinsights", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClient.ts b/sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClient.ts index e001f89b1329..94ec76c781ce 100644 --- a/sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClient.ts +++ b/sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClient.ts @@ -1,84 +1,161 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { ApplicationInsightsManagementClientContext } from "./applicationInsightsManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + AnnotationsImpl, + APIKeysImpl, + ExportConfigurationsImpl, + ComponentCurrentBillingFeaturesImpl, + ComponentQuotaStatusImpl, + ComponentFeatureCapabilitiesImpl, + ComponentAvailableFeaturesImpl, + ProactiveDetectionConfigurationsImpl, + WorkItemConfigurationsImpl, + FavoritesImpl, + WebTestLocationsImpl, + WebTestsImpl, + AnalyticsItemsImpl, + WorkbookTemplatesImpl, + MyWorkbooksImpl, + WorkbooksImpl, + ComponentsImpl, + ComponentLinkedStorageAccountsOperationsImpl, + OperationsImpl, + LiveTokenImpl +} from "./operations"; +import { + Annotations, + APIKeys, + ExportConfigurations, + ComponentCurrentBillingFeatures, + ComponentQuotaStatus, + ComponentFeatureCapabilities, + ComponentAvailableFeatures, + ProactiveDetectionConfigurations, + WorkItemConfigurations, + Favorites, + WebTestLocations, + WebTests, + AnalyticsItems, + WorkbookTemplates, + MyWorkbooks, + Workbooks, + Components, + ComponentLinkedStorageAccountsOperations, + Operations, + LiveToken +} from "./operationsInterfaces"; +import { ApplicationInsightsManagementClientOptionalParams } from "./models"; - -class ApplicationInsightsManagementClient extends ApplicationInsightsManagementClientContext { - // Operation groups - operations: operations.Operations; - annotations: operations.Annotations; - aPIKeys: operations.APIKeys; - exportConfigurations: operations.ExportConfigurations; - componentCurrentBillingFeatures: operations.ComponentCurrentBillingFeatures; - componentQuotaStatus: operations.ComponentQuotaStatus; - componentFeatureCapabilities: operations.ComponentFeatureCapabilities; - componentAvailableFeatures: operations.ComponentAvailableFeatures; - proactiveDetectionConfigurations: operations.ProactiveDetectionConfigurations; - workItemConfigurations: operations.WorkItemConfigurations; - favorites: operations.Favorites; - webTestLocations: operations.WebTestLocations; - webTests: operations.WebTests; - analyticsItems: operations.AnalyticsItems; - workbooks: operations.Workbooks; - myWorkbooks: operations.MyWorkbooks; - components: operations.Components; - componentLinkedStorageAccounts: operations.ComponentLinkedStorageAccountsOperations; - liveToken: operations.LiveToken; +export class ApplicationInsightsManagementClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; /** * Initializes a new instance of the ApplicationInsightsManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId The ID of the target subscription. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.ApplicationInsightsManagementClientOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.annotations = new operations.Annotations(this); - this.aPIKeys = new operations.APIKeys(this); - this.exportConfigurations = new operations.ExportConfigurations(this); - this.componentCurrentBillingFeatures = new operations.ComponentCurrentBillingFeatures(this); - this.componentQuotaStatus = new operations.ComponentQuotaStatus(this); - this.componentFeatureCapabilities = new operations.ComponentFeatureCapabilities(this); - this.componentAvailableFeatures = new operations.ComponentAvailableFeatures(this); - this.proactiveDetectionConfigurations = new operations.ProactiveDetectionConfigurations(this); - this.workItemConfigurations = new operations.WorkItemConfigurations(this); - this.favorites = new operations.Favorites(this); - this.webTestLocations = new operations.WebTestLocations(this); - this.webTests = new operations.WebTests(this); - this.analyticsItems = new operations.AnalyticsItems(this); - this.workbooks = new operations.Workbooks(this); - this.myWorkbooks = new operations.MyWorkbooks(this); - this.components = new operations.Components(this); - this.componentLinkedStorageAccounts = new operations.ComponentLinkedStorageAccountsOperations(this); - this.liveToken = new operations.LiveToken(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: ApplicationInsightsManagementClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ApplicationInsightsManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-appinsights/5.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - ApplicationInsightsManagementClient, - ApplicationInsightsManagementClientContext, - Models as ApplicationInsightsManagementModels, - Mappers as ApplicationInsightsManagementMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.annotations = new AnnotationsImpl(this); + this.aPIKeys = new APIKeysImpl(this); + this.exportConfigurations = new ExportConfigurationsImpl(this); + this.componentCurrentBillingFeatures = new ComponentCurrentBillingFeaturesImpl( + this + ); + this.componentQuotaStatus = new ComponentQuotaStatusImpl(this); + this.componentFeatureCapabilities = new ComponentFeatureCapabilitiesImpl( + this + ); + this.componentAvailableFeatures = new ComponentAvailableFeaturesImpl(this); + this.proactiveDetectionConfigurations = new ProactiveDetectionConfigurationsImpl( + this + ); + this.workItemConfigurations = new WorkItemConfigurationsImpl(this); + this.favorites = new FavoritesImpl(this); + this.webTestLocations = new WebTestLocationsImpl(this); + this.webTests = new WebTestsImpl(this); + this.analyticsItems = new AnalyticsItemsImpl(this); + this.workbookTemplates = new WorkbookTemplatesImpl(this); + this.myWorkbooks = new MyWorkbooksImpl(this); + this.workbooks = new WorkbooksImpl(this); + this.components = new ComponentsImpl(this); + this.componentLinkedStorageAccountsOperations = new ComponentLinkedStorageAccountsOperationsImpl( + this + ); + this.operations = new OperationsImpl(this); + this.liveToken = new LiveTokenImpl(this); + } + + annotations: Annotations; + aPIKeys: APIKeys; + exportConfigurations: ExportConfigurations; + componentCurrentBillingFeatures: ComponentCurrentBillingFeatures; + componentQuotaStatus: ComponentQuotaStatus; + componentFeatureCapabilities: ComponentFeatureCapabilities; + componentAvailableFeatures: ComponentAvailableFeatures; + proactiveDetectionConfigurations: ProactiveDetectionConfigurations; + workItemConfigurations: WorkItemConfigurations; + favorites: Favorites; + webTestLocations: WebTestLocations; + webTests: WebTests; + analyticsItems: AnalyticsItems; + workbookTemplates: WorkbookTemplates; + myWorkbooks: MyWorkbooks; + workbooks: Workbooks; + components: Components; + componentLinkedStorageAccountsOperations: ComponentLinkedStorageAccountsOperations; + operations: Operations; + liveToken: LiveToken; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClientContext.ts b/sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClientContext.ts deleted file mode 100644 index b3cc5d676aba..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClientContext.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-appinsights"; -const packageVersion = "3.1.0"; - -export class ApplicationInsightsManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - subscriptionId: string; - - /** - * Initializes a new instance of the ApplicationInsightsManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId The ID of the target subscription. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.ApplicationInsightsManagementClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/applicationinsights/arm-appinsights/src/index.ts b/sdk/applicationinsights/arm-appinsights/src/index.ts new file mode 100644 index 000000000000..0611f1e13a98 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { ApplicationInsightsManagementClient } from "./applicationInsightsManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/aPIKeysMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/aPIKeysMappers.ts deleted file mode 100644 index 359b47866056..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/aPIKeysMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - APIKeyRequest, - ApplicationInsightsComponentAPIKey, - ApplicationInsightsComponentAPIKeyListResult, - CloudError -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/analyticsItemsMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/analyticsItemsMappers.ts deleted file mode 100644 index ec4ddeb966e1..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/analyticsItemsMappers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponentAnalyticsItem, - ApplicationInsightsComponentAnalyticsItemProperties, - CloudError -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/annotationsMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/annotationsMappers.ts deleted file mode 100644 index dd86a501f412..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/annotationsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Annotation, - AnnotationError, - AnnotationsListResult, - CloudError, - InnerError -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/componentAvailableFeaturesMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/componentAvailableFeaturesMappers.ts deleted file mode 100644 index 077b32f04cad..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/componentAvailableFeaturesMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponentAvailableFeatures, - ApplicationInsightsComponentFeature, - ApplicationInsightsComponentFeatureCapability, - CloudError -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/componentCurrentBillingFeaturesMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/componentCurrentBillingFeaturesMappers.ts deleted file mode 100644 index b765b76a1921..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/componentCurrentBillingFeaturesMappers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponentBillingFeatures, - ApplicationInsightsComponentDataVolumeCap, - CloudError -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/componentFeatureCapabilitiesMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/componentFeatureCapabilitiesMappers.ts deleted file mode 100644 index b13f2ae34a0c..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/componentFeatureCapabilitiesMappers.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponentFeatureCapabilities, - CloudError -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/componentLinkedStorageAccountsOperationsMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/componentLinkedStorageAccountsOperationsMappers.ts deleted file mode 100644 index 712871b162ad..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/componentLinkedStorageAccountsOperationsMappers.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponent, - ApplicationInsightsComponentProactiveDetectionConfiguration, - ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, - AzureEntityResource, - BaseResource, - ComponentLinkedStorageAccounts, - ComponentLinkedStorageAccountsPatch, - ComponentsResource, - ErrorResponse, - MyWorkbook, - MyWorkbookResource, - PrivateLinkScopedResource, - ProxyResource, - Resource, - TrackedResource, - WebTest, - WebTestGeolocation, - WebTestPropertiesConfiguration, - WebtestsResource, - Workbook, - WorkbookResource -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/componentQuotaStatusMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/componentQuotaStatusMappers.ts deleted file mode 100644 index 6b2bc91696da..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/componentQuotaStatusMappers.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponentQuotaStatus, - CloudError -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/componentsMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/componentsMappers.ts deleted file mode 100644 index a145168e704e..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/componentsMappers.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponent, - ApplicationInsightsComponentListResult, - ApplicationInsightsComponentProactiveDetectionConfiguration, - ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, - AzureEntityResource, - BaseResource, - CloudError, - ComponentLinkedStorageAccounts, - ComponentPurgeBody, - ComponentPurgeBodyFilters, - ComponentPurgeResponse, - ComponentPurgeStatusResponse, - ComponentsResource, - MyWorkbook, - MyWorkbookResource, - PrivateLinkScopedResource, - ProxyResource, - Resource, - TagsResource, - TrackedResource, - WebTest, - WebTestGeolocation, - WebTestPropertiesConfiguration, - WebtestsResource, - Workbook, - WorkbookResource -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/exportConfigurationsMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/exportConfigurationsMappers.ts deleted file mode 100644 index a5c3232aad4e..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/exportConfigurationsMappers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponentExportConfiguration, - ApplicationInsightsComponentExportRequest, - CloudError -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/favoritesMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/favoritesMappers.ts deleted file mode 100644 index d927641eeede..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/favoritesMappers.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponentFavorite, - CloudError -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/index.ts b/sdk/applicationinsights/arm-appinsights/src/models/index.ts index 9b42aa4deac2..079a9c7f62ac 100644 --- a/sdk/applicationinsights/arm-appinsights/src/models/index.ts +++ b/sdk/applicationinsights/arm-appinsights/src/models/index.ts @@ -1,3257 +1,2366 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; - -/** - * Error response indicates Insights service is not able to process the incoming request. The - * reason is provided in the error message. - */ -export interface ErrorResponse { - /** - * Error code. - */ - code?: string; - /** - * Error message indicating why the operation failed. - */ - message?: string; -} - -/** - * The object that represents the operation. - */ -export interface OperationDisplay { - /** - * Service provider: Microsoft.Cdn - */ - provider?: string; - /** - * Resource on which the operation is performed: Profile, endpoint, etc. - */ - resource?: string; - /** - * Operation type: Read, write, delete, etc. - */ - operation?: string; -} - -/** - * CDN REST API operation - */ -export interface Operation { - /** - * Operation name: {provider}/{resource}/{operation} - */ - name?: string; +/** Annotations list result. */ +export interface AnnotationsListResult { /** - * The object that represents the operation. + * An array of annotations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - display?: OperationDisplay; + readonly value?: Annotation[]; } -/** - * Annotation associated with an application insights resource. - */ +/** Annotation associated with an application insights resource. */ export interface Annotation { - /** - * Name of annotation - */ + /** Name of annotation */ annotationName?: string; - /** - * Category of annotation, free form - */ + /** Category of annotation, free form */ category?: string; - /** - * Time when event occurred - */ + /** Time when event occurred */ eventTime?: Date; - /** - * Unique Id for annotation - */ + /** Unique Id for annotation */ id?: string; - /** - * Serialized JSON object for detailed properties - */ + /** Serialized JSON object for detailed properties */ properties?: string; - /** - * Related parent annotation if any. Default value: 'null'. - */ + /** Related parent annotation if any */ relatedAnnotation?: string; } -/** - * Inner error - */ -export interface InnerError { - /** - * Provides correlation for request - */ - diagnosticcontext?: string; - /** - * Request time - */ - time?: Date; -} - -/** - * Error associated with trying to create annotation with Id that already exist - */ +/** Error associated with trying to create annotation with Id that already exist */ export interface AnnotationError { - /** - * Error detail code and explanation - */ + /** Error detail code and explanation */ code?: string; - /** - * Error message - */ + /** Error message */ message?: string; + /** Inner error */ innererror?: InnerError; } -/** - * An Application Insights component API Key creation request definition. - */ -export interface APIKeyRequest { - /** - * The name of the API Key. - */ - name?: string; - /** - * The read access rights of this API Key. - */ - linkedReadProperties?: string[]; - /** - * The write access rights of this API Key. - */ - linkedWriteProperties?: string[]; +/** Inner error */ +export interface InnerError { + /** Provides correlation for request */ + diagnosticcontext?: string; + /** Request time */ + time?: Date; } -/** - * Properties that define an API key of an Application Insights Component. - */ +/** Describes the list of API Keys of an Application Insights Component. */ +export interface ApplicationInsightsComponentAPIKeyListResult { + /** List of API Key definitions. */ + value: ApplicationInsightsComponentAPIKey[]; +} + +/** Properties that define an API key of an Application Insights Component. */ export interface ApplicationInsightsComponentAPIKey { /** - * The unique ID of the API key inside an Application Insights component. It is auto generated - * when the API key is created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The unique ID of the API key inside an Application Insights component. It is auto generated when the API key is created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * The API key value. It will be only return once when the API Key was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly apiKey?: string; - /** - * The create date of this API key. - */ + /** The create date of this API key. */ createdDate?: string; - /** - * The name of the API key. - */ + /** The name of the API key. */ name?: string; - /** - * The read access rights of this API Key. - */ + /** The read access rights of this API Key. */ linkedReadProperties?: string[]; - /** - * The write access rights of this API Key. - */ + /** The write access rights of this API Key. */ linkedWriteProperties?: string[]; } -/** - * An Application Insights component Continuous Export configuration request definition. - */ -export interface ApplicationInsightsComponentExportRequest { - /** - * The document types to be exported, as comma separated values. Allowed values include - * 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', - * 'PerformanceCounters', 'Availability', 'Messages'. - */ - recordTypes?: string; - /** - * The Continuous Export destination type. This has to be 'Blob'. - */ - destinationType?: string; - /** - * The SAS URL for the destination storage container. It must grant write permission. - */ - destinationAddress?: string; - /** - * Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to - * 'false'. - */ - isEnabled?: string; - /** - * Deprecated - */ - notificationQueueEnabled?: string; - /** - * Deprecated - */ - notificationQueueUri?: string; - /** - * The subscription ID of the destination storage container. - */ - destinationStorageSubscriptionId?: string; - /** - * The location ID of the destination storage container. - */ - destinationStorageLocationId?: string; - /** - * The name of destination storage account. - */ - destinationAccountId?: string; +/** An Application Insights component API Key creation request definition. */ +export interface APIKeyRequest { + /** The name of the API Key. */ + name?: string; + /** The read access rights of this API Key. */ + linkedReadProperties?: string[]; + /** The write access rights of this API Key. */ + linkedWriteProperties?: string[]; } -/** - * Properties that define a Continuous Export configuration. - */ +/** Properties that define a Continuous Export configuration. */ export interface ApplicationInsightsComponentExportConfiguration { /** - * The unique ID of the export configuration inside an Application Insights component. It is auto - * generated when the Continuous Export configuration is created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The unique ID of the export configuration inside an Application Insights component. It is auto generated when the Continuous Export configuration is created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly exportId?: string; /** * The instrumentation key of the Application Insights component. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly instrumentationKey?: string; - /** - * This comma separated list of document types that will be exported. The possible values include - * 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', - * 'PerformanceCounters', 'Availability', 'Messages'. - */ + /** This comma separated list of document types that will be exported. The possible values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. */ recordTypes?: string; /** * The name of the Application Insights component. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly applicationName?: string; /** * The subscription of the Application Insights component. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly subscriptionId?: string; /** * The resource group of the Application Insights component. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resourceGroup?: string; /** * The destination storage account subscription ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly destinationStorageSubscriptionId?: string; /** * The destination account location ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly destinationStorageLocationId?: string; /** * The name of destination account. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly destinationAccountId?: string; /** * The destination type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly destinationType?: string; /** - * This will be 'true' if the Continuous Export configuration is enabled, otherwise it will be - * 'false'. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This will be 'true' if the Continuous Export configuration is enabled, otherwise it will be 'false'. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isUserEnabled?: string; /** * Last time the Continuous Export configuration was updated. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastUserUpdate?: string; - /** - * Deprecated - */ + /** Deprecated */ notificationQueueEnabled?: string; /** - * This indicates current Continuous Export configuration status. The possible values are - * 'Preparing', 'Success', 'Failure'. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This indicates current Continuous Export configuration status. The possible values are 'Preparing', 'Success', 'Failure'. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly exportStatus?: string; /** - * The last time data was successfully delivered to the destination storage container for this - * Continuous Export configuration. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The last time data was successfully delivered to the destination storage container for this Continuous Export configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastSuccessTime?: string; /** * The last time the Continuous Export configuration started failing. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastGapTime?: string; /** - * This is the reason the Continuous Export configuration started failing. It can be - * 'AzureStorageNotFound' or 'AzureStorageAccessDenied'. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * This is the reason the Continuous Export configuration started failing. It can be 'AzureStorageNotFound' or 'AzureStorageAccessDenied'. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly permanentErrorReason?: string; /** * The name of the destination storage account. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly storageName?: string; /** * The name of the destination storage container. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly containerName?: string; } -/** - * An Application Insights component daily data volume cap - */ +/** An Application Insights component Continuous Export configuration request definition. */ +export interface ApplicationInsightsComponentExportRequest { + /** The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. */ + recordTypes?: string; + /** The Continuous Export destination type. This has to be 'Blob'. */ + destinationType?: string; + /** The SAS URL for the destination storage container. It must grant write permission. */ + destinationAddress?: string; + /** Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. */ + isEnabled?: string; + /** Deprecated */ + notificationQueueEnabled?: string; + /** Deprecated */ + notificationQueueUri?: string; + /** The subscription ID of the destination storage container. */ + destinationStorageSubscriptionId?: string; + /** The location ID of the destination storage container. */ + destinationStorageLocationId?: string; + /** The name of destination storage account. */ + destinationAccountId?: string; +} + +/** An Application Insights component billing features */ +export interface ApplicationInsightsComponentBillingFeatures { + /** An Application Insights component daily data volume cap */ + dataVolumeCap?: ApplicationInsightsComponentDataVolumeCap; + /** Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. */ + currentBillingFeatures?: string[]; +} + +/** An Application Insights component daily data volume cap */ export interface ApplicationInsightsComponentDataVolumeCap { - /** - * Daily data volume cap in GB. - */ + /** Daily data volume cap in GB. */ cap?: number; /** * Daily data volume cap UTC reset hour. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resetTime?: number; - /** - * Reserved, not used for now. - */ + /** Reserved, not used for now. */ warningThreshold?: number; - /** - * Reserved, not used for now. - */ + /** Reserved, not used for now. */ stopSendNotificationWhenHitThreshold?: boolean; - /** - * Do not send a notification email when the daily data volume cap is met. - */ + /** Do not send a notification email when the daily data volume cap is met. */ stopSendNotificationWhenHitCap?: boolean; /** * Maximum daily data volume cap that the user can set for this component. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly maxHistoryCap?: number; } -/** - * An Application Insights component billing features - */ -export interface ApplicationInsightsComponentBillingFeatures { - /** - * An Application Insights component daily data volume cap - */ - dataVolumeCap?: ApplicationInsightsComponentDataVolumeCap; - /** - * Current enabled pricing plan. When the component is in the Enterprise plan, this will list - * both 'Basic' and 'Application Insights Enterprise'. - */ - currentBillingFeatures?: string[]; -} - -/** - * An Application Insights component daily data volume cap status - */ +/** An Application Insights component daily data volume cap status */ export interface ApplicationInsightsComponentQuotaStatus { /** * The Application ID for the Application Insights component. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly appId?: string; /** * The daily data volume cap is met, and data ingestion will be stopped. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly shouldBeThrottled?: boolean; /** * Date and time when the daily data volume cap will be reset, and data ingestion will resume. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly expirationTime?: string; } -/** - * An Application Insights component feature capabilities - */ +/** An Application Insights component feature capabilities */ export interface ApplicationInsightsComponentFeatureCapabilities { /** * Whether allow to use continuous export feature. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly supportExportData?: boolean; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly burstThrottlePolicy?: string; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly metadataClass?: string; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly liveStreamMetrics?: boolean; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly applicationMap?: boolean; /** * Whether allow to use work item integration feature. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly workItemIntegration?: boolean; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly powerBIIntegration?: boolean; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly openSchema?: boolean; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly proactiveDetection?: boolean; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly analyticsIntegration?: boolean; /** * Whether allow to use multiple steps web test feature. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly multipleStepWebTest?: boolean; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly apiAccessLevel?: string; /** * The application insights component used tracking type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly trackingType?: string; /** * Daily data volume cap in GB. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly dailyCap?: number; /** * Daily data volume cap UTC reset hour. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly dailyCapResetTime?: number; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly throttleRate?: number; } -/** - * An Application Insights component feature capability - */ -export interface ApplicationInsightsComponentFeatureCapability { - /** - * The name of the capability. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The description of the capability. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly description?: string; - /** - * The value of the capability. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly value?: string; - /** - * The unit of the capability. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly unit?: string; - /** - * The meter used for the capability. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly meterId?: string; +/** An Application Insights component available features. */ +export interface ApplicationInsightsComponentAvailableFeatures { /** - * The meter rate of the meter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * A list of Application Insights component feature. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly meterRateFrequency?: string; + readonly result?: ApplicationInsightsComponentFeature[]; } -/** - * An Application Insights component daily data volume cap status - */ +/** An Application Insights component daily data volume cap status */ export interface ApplicationInsightsComponentFeature { /** * The pricing feature name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly featureName?: string; /** * The meter id used for the feature. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly meterId?: string; /** * The meter rate for the feature's meter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly meterRateFrequency?: string; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resouceId?: string; /** * Reserved, not used now. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isHidden?: boolean; /** * A list of Application Insights component feature capability. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly capabilities?: ApplicationInsightsComponentFeatureCapability[]; /** * Display name of the feature. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly title?: string; /** * Whether can apply addon feature on to it. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isMainFeature?: boolean; /** * The add on features on main feature. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly supportedAddonFeatures?: string; } -/** - * An Application Insights component available features. - */ -export interface ApplicationInsightsComponentAvailableFeatures { +/** An Application Insights component feature capability */ +export interface ApplicationInsightsComponentFeatureCapability { /** - * A list of Application Insights component feature. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the capability. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly result?: ApplicationInsightsComponentFeature[]; -} - -/** - * Static definitions of the ProactiveDetection configuration rule (same values for all - * components). - */ -export interface ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions { + readonly name?: string; /** - * The rule name + * The description of the capability. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name?: string; + readonly description?: string; /** - * The rule name as it is displayed in UI + * The value of the capability. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - displayName?: string; + readonly value?: string; /** - * The rule description + * The unit of the capability. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; + readonly unit?: string; /** - * URL which displays additional info about the proactive detection rule + * The meter used for the capability. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - helpUrl?: string; + readonly meterId?: string; /** - * A flag indicating whether the rule is hidden (from the UI) + * The meter rate of the meter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly meterRateFrequency?: string; +} + +/** Properties that define a ProactiveDetection configuration. */ +export interface ApplicationInsightsComponentProactiveDetectionConfiguration { + /** The rule name */ + name?: string; + /** A flag that indicates whether this rule is enabled by the user */ + enabled?: boolean; + /** A flag that indicated whether notifications on this rule should be sent to subscription owners */ + sendEmailsToSubscriptionOwners?: boolean; + /** Custom email addresses for this rule notifications */ + customEmails?: string[]; + /** The last time this rule was updated */ + lastUpdatedTime?: string; + /** Static definitions of the ProactiveDetection configuration rule (same values for all components). */ + ruleDefinitions?: ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions; +} + +/** Static definitions of the ProactiveDetection configuration rule (same values for all components). */ +export interface ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions { + /** The rule name */ + name?: string; + /** The rule name as it is displayed in UI */ + displayName?: string; + /** The rule description */ + description?: string; + /** URL which displays additional info about the proactive detection rule */ + helpUrl?: string; + /** A flag indicating whether the rule is hidden (from the UI) */ isHidden?: boolean; - /** - * A flag indicating whether the rule is enabled by default - */ + /** A flag indicating whether the rule is enabled by default */ isEnabledByDefault?: boolean; - /** - * A flag indicating whether the rule is in preview - */ + /** A flag indicating whether the rule is in preview */ isInPreview?: boolean; - /** - * A flag indicating whether email notifications are supported for detections for this rule - */ + /** A flag indicating whether email notifications are supported for detections for this rule */ supportsEmailNotifications?: boolean; } -/** - * Properties that define a ProactiveDetection configuration. - */ -export interface ApplicationInsightsComponentProactiveDetectionConfiguration extends BaseResource { +/** Work item configuration list result. */ +export interface WorkItemConfigurationsListResult { /** - * The rule name + * An array of work item configurations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name?: string; - /** - * A flag that indicates whether this rule is enabled by the user - */ - enabled?: boolean; - /** - * A flag that indicated whether notifications on this rule should be sent to subscription owners - */ - sendEmailsToSubscriptionOwners?: boolean; - /** - * Custom email addresses for this rule notifications - */ - customEmails?: string[]; - /** - * The last time this rule was updated - */ - lastUpdatedTime?: string; - /** - * Static definitions of the ProactiveDetection configuration rule (same values for all - * components). - */ - ruleDefinitions?: ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions; + readonly value?: WorkItemConfiguration[]; } -/** - * Work item configuration associated with an application insights resource. - */ +/** Work item configuration associated with an application insights resource. */ export interface WorkItemConfiguration { - /** - * Connector identifier where work item is created - */ + /** Connector identifier where work item is created */ connectorId?: string; - /** - * Configuration friendly name - */ + /** Configuration friendly name */ configDisplayName?: string; - /** - * Boolean value indicating whether configuration is default - */ + /** Boolean value indicating whether configuration is default */ isDefault?: boolean; - /** - * Unique Id for work item - */ + /** Unique Id for work item */ id?: string; - /** - * Serialized JSON object for detailed properties - */ + /** Serialized JSON object for detailed properties */ configProperties?: string; } -/** - * Work item configuration creation payload - */ +/** Error associated with trying to get work item configuration or configurations */ +export interface WorkItemConfigurationError { + /** Error detail code and explanation */ + code?: string; + /** Error message */ + message?: string; + /** Inner error */ + innererror?: InnerError; +} + +/** Work item configuration creation payload */ export interface WorkItemCreateConfiguration { - /** - * Unique connector id - */ + /** Unique connector id */ connectorId?: string; - /** - * Serialized JSON object for detailed properties - */ + /** Serialized JSON object for detailed properties */ connectorDataConfiguration?: string; - /** - * Boolean indicating validate only - */ + /** Boolean indicating validate only */ validateOnly?: boolean; - /** - * Custom work item properties - */ + /** Custom work item properties */ workItemProperties?: { [propertyName: string]: string }; } -/** - * Error associated with trying to get work item configuration or configurations - */ -export interface WorkItemConfigurationError { - /** - * Error detail code and explanation - */ - code?: string; - /** - * Error message - */ - message?: string; - innererror?: InnerError; -} - -/** - * Properties that define a favorite that is associated to an Application Insights component. - */ +/** Properties that define a favorite that is associated to an Application Insights component. */ export interface ApplicationInsightsComponentFavorite { - /** - * The user-defined name of the favorite. - */ + /** The user-defined name of the favorite. */ name?: string; - /** - * Configuration of this particular favorite, which are driven by the Azure portal UX. - * Configuration data is a string containing valid JSON - */ + /** Configuration of this particular favorite, which are driven by the Azure portal UX. Configuration data is a string containing valid JSON */ config?: string; - /** - * This instance's version of the data model. This can change as new features are added that can - * be marked favorite. Current examples include MetricsExplorer (ME) and Search. - */ + /** This instance's version of the data model. This can change as new features are added that can be marked favorite. Current examples include MetricsExplorer (ME) and Search. */ version?: string; /** * Internally assigned unique id of the favorite definition. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly favoriteId?: string; - /** - * Enum indicating if this favorite definition is owned by a specific user or is shared between - * all users with access to the Application Insights component. Possible values include: - * 'shared', 'user' - */ + /** Enum indicating if this favorite definition is owned by a specific user or is shared between all users with access to the Application Insights component. */ favoriteType?: FavoriteType; - /** - * The source of the favorite definition. - */ + /** The source of the favorite definition. */ sourceType?: string; /** * Date and time in UTC of the last modification that was made to this favorite definition. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly timeModified?: string; - /** - * A list of 0 or more tags that are associated with this favorite definition - */ + /** A list of 0 or more tags that are associated with this favorite definition */ tags?: string[]; - /** - * Favorite category, as defined by the user at creation time. - */ + /** Favorite category, as defined by the user at creation time. */ category?: string; - /** - * Flag denoting wether or not this favorite was generated from a template. - */ + /** Flag denoting wether or not this favorite was generated from a template. */ isGeneratedFromTemplate?: boolean; /** * Unique user id of the specific user that owns this favorite. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly userId?: string; } -/** - * Properties that define a web test location available to an Application Insights Component. - */ +/** Describes the list of web test locations available to an Application Insights Component. */ +export interface ApplicationInsightsWebTestLocationsListResult { + /** List of web test locations. */ + value: ApplicationInsightsComponentWebTestLocation[]; +} + +/** Properties that define a web test location available to an Application Insights Component. */ export interface ApplicationInsightsComponentWebTestLocation { /** * The display name of the web test location. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly displayName?: string; /** * Internally defined geographic location tag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tag?: string; } -/** - * An azure resource object - */ -export interface WebtestsResource extends BaseResource { - /** - * Azure resource Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Azure resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Azure resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * Resource location - */ - location: string; - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; -} - -/** - * A container holding only the Tags for a resource, allowing the user to update the tags on a - * WebTest instance. - */ -export interface TagsResource { - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; +/** A list of 0 or more Application Insights web test definitions. */ +export interface WebTestListResult { + /** Set of Application Insights web test definitions. */ + value: WebTest[]; + /** The link to get the next part of the returned list of web tests, should the return set be too large for a single request. May be null. */ + nextLink?: string; } -/** - * Geo-physical location to run a web test from. You must specify one or more locations for the - * test to run from. - */ +/** Geo-physical location to run a web test from. You must specify one or more locations for the test to run from. */ export interface WebTestGeolocation { - /** - * Location ID for the webtest to run from. - */ + /** Location ID for the webtest to run from. */ location?: string; } -/** - * An XML configuration specification for a WebTest. - */ +/** An XML configuration specification for a WebTest. */ export interface WebTestPropertiesConfiguration { - /** - * The XML specification of a WebTest to run against an application. - */ + /** The XML specification of a WebTest to run against an application. */ webTest?: string; } -/** - * An Application Insights web test definition. - */ -export interface WebTest extends WebtestsResource { - /** - * The kind of web test that this web test watches. Choices are ping and multistep. Possible - * values include: 'ping', 'multistep'. Default value: 'ping'. - */ - kind?: WebTestKind; - /** - * Unique ID of this WebTest. This is typically the same value as the Name field. - */ - syntheticMonitorId: string; - /** - * User defined name if this WebTest. - */ - webTestName: string; - /** - * Purpose/user defined descriptive test for this WebTest. - */ - description?: string; - /** - * Is the test actively being monitored. - */ - enabled?: boolean; - /** - * Interval in seconds between test runs for this WebTest. Default value is 300. Default value: - * 300. - */ - frequency?: number; - /** - * Seconds until this WebTest will timeout and fail. Default value is 30. Default value: 30. - */ - timeout?: number; +/** An azure resource object */ +export interface WebtestsResource { /** - * The kind of web test this is, valid choices are ping and multistep. Possible values include: - * 'ping', 'multistep'. Default value: 'ping'. - */ - webTestKind: WebTestKind; - /** - * Allow for retries should this WebTest fail. - */ - retryEnabled?: boolean; - /** - * A list of where to physically run the tests from to give global coverage for accessibility of - * your application. + * Azure resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - locations: WebTestGeolocation[]; + readonly id?: string; /** - * An XML configuration specification for a WebTest. + * Azure resource name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - configuration?: WebTestPropertiesConfiguration; + readonly name?: string; /** - * Current state of this component, whether or not is has been provisioned within the resource - * group it is defined. Users cannot change this value but are able to read from it. Values will - * include Succeeded, Deploying, Canceled, and Failed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Azure resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly type?: string; + /** Resource location */ + location: string; + /** Resource tags */ + tags?: { [propertyName: string]: string }; } -/** - * A set of properties that can be defined in the context of a specific item type. Each type may - * have its own properties. - */ -export interface ApplicationInsightsComponentAnalyticsItemProperties { - /** - * A function alias, used when the type of the item is Function - */ - functionAlias?: string; +/** A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. */ +export interface TagsResource { + /** Resource tags */ + tags?: { [propertyName: string]: string }; } -/** - * Properties that define an Analytics item that is associated to an Application Insights - * component. - */ +/** Properties that define an Analytics item that is associated to an Application Insights component. */ export interface ApplicationInsightsComponentAnalyticsItem { - /** - * Internally assigned unique id of the item definition. - */ + /** Internally assigned unique id of the item definition. */ id?: string; - /** - * The user-defined name of the item. - */ + /** The user-defined name of the item. */ name?: string; - /** - * The content of this item - */ + /** The content of this item */ content?: string; /** * This instance's version of the data model. This can change as new features are added. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly version?: string; - /** - * Enum indicating if this item definition is owned by a specific user or is shared between all - * users with access to the Application Insights component. Possible values include: 'shared', - * 'user' - */ + /** Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. */ scope?: ItemScope; - /** - * Enum indicating the type of the Analytics item. Possible values include: 'query', 'function', - * 'folder', 'recent' - */ + /** Enum indicating the type of the Analytics item. */ type?: ItemType; /** * Date and time in UTC when this item was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly timeCreated?: string; /** * Date and time in UTC of the last modification that was made to this item. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly timeModified?: string; + /** A set of properties that can be defined in the context of a specific item type. Each type may have its own properties. */ properties?: ApplicationInsightsComponentAnalyticsItemProperties; } -/** - * An azure resource object - */ -export interface WorkbookResource extends BaseResource { +/** A set of properties that can be defined in the context of a specific item type. Each type may have its own properties. */ +export interface ApplicationInsightsComponentAnalyticsItemProperties { + /** A function alias, used when the type of the item is Function */ + functionAlias?: string; +} + +/** WorkbookTemplate list result. */ +export interface WorkbookTemplatesListResult { + /** An array of workbook templates. */ + value?: WorkbookTemplate[]; +} + +/** Gallery information for a workbook template. */ +export interface WorkbookTemplateGallery { + /** Name of the workbook template in the gallery. */ + name?: string; + /** Category for the gallery. */ + category?: string; + /** Type of workbook supported by the workbook template. */ + type?: string; + /** Order of the template within the gallery. */ + order?: number; + /** Azure resource type supported by the gallery. */ + resourceType?: string; +} + +/** Localized template data and gallery information. */ +export interface WorkbookTemplateLocalizedGallery { + /** Valid JSON object containing workbook template payload. */ + templateData?: Record; + /** Workbook galleries supported by the template. */ + galleries?: WorkbookTemplateGallery[]; +} + +/** An azure resource object */ +export interface WorkbookTemplateResource { /** * Azure resource Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * Azure resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Azure resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * Azure resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; + /** Resource location */ + location: string; + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** Error message that will indicate why the operation failed. */ +export interface WorkbookTemplateError { + /** Error message object that will indicate why the operation failed. */ + error?: WorkbookTemplateErrorBody; +} + +/** Error message body that will indicate why the operation failed. */ +export interface WorkbookTemplateErrorBody { + /** Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. */ + code?: string; + /** Human-readable representation of the error. */ + message?: string; + /** The list of invalid fields send in request, in case of validation error. */ + details?: WorkbookTemplateErrorFieldContract[]; +} + +/** Error Field contract. */ +export interface WorkbookTemplateErrorFieldContract { + /** Property level error code. */ + code?: string; + /** Human-readable representation of property-level error. */ + message?: string; + /** Property name. */ + target?: string; +} + +/** The parameters that can be provided when updating workbook template. */ +export interface WorkbookTemplateUpdateParameters { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. */ + priority?: number; + /** Information about the author of the workbook template. */ + author?: string; + /** Valid JSON object containing workbook template payload. */ + templateData?: Record; + /** Workbook galleries supported by the template. */ + galleries?: WorkbookTemplateGallery[]; + /** Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. */ + localized?: { [propertyName: string]: WorkbookTemplateLocalizedGallery[] }; +} + +/** Workbook list result. */ +export interface MyWorkbooksListResult { /** - * Resource location + * An array of private workbooks. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly value?: MyWorkbook[]; + nextLink?: string; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** An azure resource object */ +export interface MyWorkbookResource { + /** Identity used for BYOS */ + identity?: MyWorkbookManagedIdentity; + /** Azure resource Id */ + id?: string; + /** Azure resource name */ + name?: string; + /** Azure resource type */ + type?: string; + /** Resource location */ location?: string; - /** - * Resource tags - */ + /** Resource tags */ tags?: { [propertyName: string]: string }; + /** Resource etag */ + etag?: { [propertyName: string]: string }; } -/** - * An Application Insights workbook definition. - */ -export interface Workbook extends WorkbookResource { - /** - * The kind of workbook. Choices are user and shared. Possible values include: 'user', 'shared' - */ - kind?: SharedTypeKind; +/** Customer Managed Identity */ +export interface MyWorkbookManagedIdentity { + /** Customer Managed Identity */ + userAssignedIdentities?: MyWorkbookUserAssignedIdentities; + /** The identity type. */ + type?: MyWorkbookManagedIdentityType; +} + +/** Customer Managed Identity */ +export interface MyWorkbookUserAssignedIdentities { /** - * The user-defined name of the workbook. + * The principal ID of resource identity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - workbookName: string; + readonly principalId?: string; /** - * Configuration of this particular workbook. Configuration data is a string containing valid - * JSON + * The tenant ID of resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serializedData: string; + readonly tenantId?: string; +} + +/** Error response. */ +export interface MyWorkbookError { + /** The error details. */ + error?: ErrorDefinition; +} + +/** Error definition. */ +export interface ErrorDefinition { /** - * This instance's version of the data model. This can change as new features are added that can - * be marked workbook. + * Service specific error code which serves as the substatus for the HTTP error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - version?: string; + readonly code?: string; /** - * Internally assigned unique id of the workbook definition. + * Description of the error. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - workbookId: string; + readonly message?: string; /** - * Enum indicating if this workbook definition is owned by a specific user or is shared between - * all users with access to the Application Insights component. Possible values include: 'user', - * 'shared'. Default value: 'shared'. + * Internal error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sharedTypeKind: SharedTypeKind; + readonly innererror?: any; +} + +/** Workbook list result. */ +export interface WorkbooksListResult { /** - * Date and time in UTC of the last modification that was made to this workbook definition. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * An array of workbooks. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly timeModified?: string; + readonly value?: Workbook[]; + nextLink?: string; +} + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { /** - * Workbook category, as defined by the user at creation time. + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - category: string; + readonly principalId?: string; /** - * A list of 0 or more tags that are associated with this workbook definition + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - workbookTags?: string[]; + readonly tenantId?: string; + /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ + type: ManagedServiceIdentityType; + /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { /** - * Unique user id of the specific user that owns this workbook. + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - userId: string; + readonly principalId?: string; /** - * Optional resourceId for a source resource. + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sourceResourceId?: string; + readonly clientId?: string; } -/** - * Contains a sourceId and workbook resource id to link two resources. - */ -export interface LinkProperties { +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * The source Azure resource id + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sourceId?: string; + readonly id?: string; /** - * The workbook Azure resource id + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - targetId?: string; + readonly name?: string; /** - * The category of workbook + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. */ - category?: string; + readonly type?: string; } -/** - * Error Field contract. - */ -export interface ErrorFieldContract { +/** Error response. */ +export interface WorkbookError { + /** The error details. */ + error?: WorkbookErrorDefinition; +} + +/** Error definition. */ +export interface WorkbookErrorDefinition { /** - * Property level error code. + * Service specific error code which serves as the substatus for the HTTP error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - code?: string; + readonly code?: string; /** - * Human-readable representation of property-level error. + * Description of the error. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - message?: string; + readonly message?: string; /** - * Property name. + * Internal error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - target?: string; + readonly innerError?: any; } -/** - * Error message body that will indicate why the operation failed. - */ -export interface WorkbookError { - /** - * Service-defined error code. This code serves as a sub-status for the HTTP error code specified - * in the response. - */ - code?: string; - /** - * Human-readable representation of the error. - */ - message?: string; - /** - * The list of invalid fields send in request, in case of validation error. - */ - details?: ErrorFieldContract[]; +/** The parameters that can be provided when updating workbook properties properties. */ +export interface WorkbookUpdateParameters { + /** The kind of workbook. Choices are user and shared. */ + kind?: SharedTypeKind; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The user-defined name (display name) of the workbook. */ + displayName?: string; + /** Configuration of this particular workbook. Configuration data is a string containing valid JSON */ + serializedData?: string; + /** Workbook category, as defined by the user at creation time. */ + category?: string; + /** A list of 0 or more tags that are associated with this workbook definition */ + tagsPropertiesTags?: string[]; + /** The description of the workbook. */ + description?: string; + /** The unique revision id for this workbook definition */ + revision?: string; } -/** - * An azure resource object - */ -export interface MyWorkbookResource extends BaseResource { +/** Describes the list of Application Insights Resources. */ +export interface ApplicationInsightsComponentListResult { + /** List of Application Insights component definitions. */ + value: ApplicationInsightsComponent[]; + /** The URI to get the next set of Application Insights component definitions if too many components where returned in the result set. */ + nextLink?: string; +} + +/** The private link scope resource reference. */ +export interface PrivateLinkScopedResource { + /** The full resource Id of the private link scope resource. */ + resourceId?: string; + /** The private link scope unique Identifier. */ + scopeId?: string; +} + +/** An azure resource object */ +export interface ComponentsResource { /** * Azure resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - id?: string; + readonly id?: string; /** * Azure resource name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name?: string; + readonly name?: string; /** * Azure resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ - type?: string; - /** - * Resource location - */ - location?: string; - /** - * Resource tags - */ + readonly type?: string; + /** Resource location */ + location: string; + /** Resource tags */ tags?: { [propertyName: string]: string }; } -/** - * An Application Insights private workbook definition. - */ -export interface MyWorkbook extends MyWorkbookResource { - /** - * The kind of workbook. Choices are user and shared. Possible values include: 'user', 'shared' - */ - kind?: SharedTypeKind; - /** - * The user-defined name of the private workbook. - */ - displayName: string; - /** - * Configuration of this particular private workbook. Configuration data is a string containing - * valid JSON - */ - serializedData: string; - /** - * This instance's version of the data model. This can change as new features are added that can - * be marked private workbook. - */ - version?: string; - /** - * Date and time in UTC of the last modification that was made to this private workbook - * definition. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly timeModified?: string; - /** - * Workbook category, as defined by the user at creation time. - */ - category: string; - /** - * A list of 0 or more tags that are associated with this private workbook definition - */ - myWorkbookTags?: string[]; +/** Describes the body of a purge request for an App Insights component */ +export interface ComponentPurgeBody { + /** Table from which to purge data. */ + table: string; + /** The set of columns and filters (queries) to run over them to purge the resulting data. */ + filters: ComponentPurgeBodyFilters[]; +} + +/** User-defined filters to return data which will be purged from the table. */ +export interface ComponentPurgeBodyFilters { + /** The column of the table over which the given query should run */ + column?: string; + /** A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query. */ + operator?: string; + /** the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. */ + value?: any; + /** When filtering over custom dimensions, this key will be used as the name of the custom dimension. */ + key?: string; +} + +/** Response containing operationId for a specific purge action. */ +export interface ComponentPurgeResponse { + /** Id to use when querying for status for a particular purge operation. */ + operationId: string; +} + +/** Response containing status for a specific purge operation. */ +export interface ComponentPurgeStatusResponse { + /** Status of the operation represented by the requested Id. */ + status: PurgeState; +} + +export interface ErrorResponseLinkedStorage { + /** Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. */ + error?: ErrorResponseLinkedStorageError; +} + +/** Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. */ +export interface ErrorResponseLinkedStorageError { /** - * Unique user id of the specific user that owns this private workbook. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly userId?: string; + readonly code?: string; /** - * Optional resourceId for a source resource. + * Error message indicating why the operation failed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sourceId?: string; + readonly message?: string; } -/** - * Error message body that will indicate why the operation failed. - */ -export interface MyWorkbookError { +/** An Application Insights component linked storage accounts patch */ +export interface ComponentLinkedStorageAccountsPatch { + /** Linked storage account resource ID */ + linkedStorageAccount?: string; +} + +/** Result of the List Operations operation */ +export interface OperationsListResult { + /** A collection of operations */ + value?: OperationLive[]; + /** URL to get the next set of operation list results if there are any. */ + nextLink?: string; +} + +/** Represents an operation returned by the GetOperations request */ +export interface OperationLive { + /** Name of the operation */ + name?: string; + /** Display name of the operation */ + display?: OperationInfo; + /** Origin of the operation */ + origin?: string; + /** Properties of the operation */ + properties?: Record; +} + +/** Information about an operation */ +export interface OperationInfo { + /** Name of the provider */ + provider?: string; + /** Name of the resource type */ + resource?: string; + /** Name of the operation */ + operation?: string; + /** Description of the operation */ + description?: string; +} + +/** The response to a live token query. */ +export interface LiveTokenResponse { /** - * Service-defined error code. This code serves as a sub-status for the HTTP error code specified - * in the response. + * JWT token for accessing live metrics stream data. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly liveToken?: string; +} + +/** Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. */ +export interface ErrorResponse { + /** Error code. */ code?: string; - /** - * Human-readable representation of the error. - */ + /** Error message indicating why the operation failed. */ message?: string; +} + +/** CDN REST API operation */ +export interface Operation { + /** Operation name: {provider}/{resource}/{operation} */ + name?: string; + /** The object that represents the operation. */ + display?: OperationDisplay; +} + +/** The object that represents the operation. */ +export interface OperationDisplay { + /** Service provider: Microsoft.Cdn */ + provider?: string; + /** Resource on which the operation is performed: Profile, endpoint, etc. */ + resource?: string; + /** Operation type: Read, write, delete, etc. */ + operation?: string; +} + +/** Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. */ +export interface OperationListResult { + /** List of CDN operations supported by the CDN resource provider. */ + value?: Operation[]; + /** URL to get the next set of operation list results if there are any. */ + nextLink?: string; +} + +/** Error details */ +export interface InnerErrorTrace { /** - * The list of invalid fields send in request, in case of validation error. + * detailed error trace + * NOTE: This property will not be serialized. It can only be populated by the server. */ - details?: ErrorFieldContract[]; + readonly trace?: string[]; } -/** - * An azure resource object - */ -export interface ComponentsResource extends BaseResource { +/** Error details */ +export interface WorkbookInnerErrorTrace { /** - * Azure resource Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * detailed error trace + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly trace?: string[]; +} + +/** An Application Insights web test definition. */ +export type WebTest = WebtestsResource & { + /** The kind of web test that this web test watches. Choices are ping and multistep. */ + kind?: WebTestKind; + /** Unique ID of this WebTest. This is typically the same value as the Name field. */ + syntheticMonitorId?: string; + /** User defined name if this WebTest. */ + webTestName?: string; + /** Purpose/user defined descriptive test for this WebTest. */ + description?: string; + /** Is the test actively being monitored. */ + enabled?: boolean; + /** Interval in seconds between test runs for this WebTest. Default value is 300. */ + frequency?: number; + /** Seconds until this WebTest will timeout and fail. Default value is 30. */ + timeout?: number; + /** The kind of web test this is, valid choices are ping and multistep. */ + webTestKind?: WebTestKind; + /** Allow for retries should this WebTest fail. */ + retryEnabled?: boolean; + /** A list of where to physically run the tests from to give global coverage for accessibility of your application. */ + locations?: WebTestGeolocation[]; + /** An XML configuration specification for a WebTest. */ + configuration?: WebTestPropertiesConfiguration; /** - * Azure resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly provisioningState?: string; +}; + +/** An Application Insights workbook template definition. */ +export type WorkbookTemplate = WorkbookTemplateResource & { + /** Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. */ + priority?: number; + /** Information about the author of the workbook template. */ + author?: string; + /** Valid JSON object containing workbook template payload. */ + templateData?: Record; + /** Workbook galleries supported by the template. */ + galleries?: WorkbookTemplateGallery[]; + /** Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. */ + localized?: { [propertyName: string]: WorkbookTemplateLocalizedGallery[] }; +}; + +/** An Application Insights private workbook definition. */ +export type MyWorkbook = MyWorkbookResource & { + /** The kind of workbook. Choices are user and shared. */ + kind?: Kind; /** - * Azure resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly systemData?: SystemData; + /** The user-defined name of the private workbook. */ + displayName?: string; + /** Configuration of this particular private workbook. Configuration data is a string containing valid JSON */ + serializedData?: string; + /** This instance's version of the data model. This can change as new features are added that can be marked private workbook. */ + version?: string; /** - * Resource location + * Date and time in UTC of the last modification that was made to this private workbook definition. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location: string; + readonly timeModified?: string; + /** Workbook category, as defined by the user at creation time. */ + category?: string; + /** A list of 0 or more tags that are associated with this private workbook definition */ + tagsPropertiesTags?: string[]; /** - * Resource tags + * Unique user id of the specific user that owns this private workbook. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly userId?: string; + /** Optional resourceId for a source resource. */ + sourceId?: string; + /** BYOS Storage Account URI */ + storageUri?: string; +}; + +/** Identity used for BYOS */ +export type WorkbookResourceIdentity = ManagedServiceIdentity & {}; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ tags?: { [propertyName: string]: string }; -} + /** The geo-location where the resource lives */ + location: string; +}; -/** - * The private link scope resource reference. - */ -export interface PrivateLinkScopedResource { - /** - * The full resource Id of the private link scope resource. - */ - resourceId?: string; - /** - * The private link scope unique Identifier. - */ - scopeId?: string; -} +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export type ProxyResource = Resource & {}; -/** - * An Application Insights component definition. - */ -export interface ApplicationInsightsComponent extends ComponentsResource { - /** - * The kind of application that this component refers to, used to customize UI. This value is a - * freeform string, values should typically be one of the following: web, ios, other, store, - * java, phone. - */ +/** An Application Insights component definition. */ +export type ApplicationInsightsComponent = ComponentsResource & { + /** The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. */ kind: string; /** * The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly applicationId?: string; /** * Application Insights Unique ID for your Application. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly appId?: string; - /** - * Type of application being monitored. Possible values include: 'web', 'other'. Default value: - * 'web'. - */ - applicationType: ApplicationType; - /** - * Used by the Application Insights system to determine what kind of flow this component was - * created by. This is to be set to 'Bluefield' when creating/updating a component via the REST - * API. Possible values include: 'Bluefield'. Default value: 'Bluefield'. - */ + /** Type of application being monitored. */ + applicationType?: ApplicationType; + /** Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API. */ flowType?: FlowType; - /** - * Describes what tool created this Application Insights component. Customers using this API - * should set this to the default 'rest'. Possible values include: 'rest'. Default value: 'rest'. - */ + /** Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. */ requestSource?: RequestSource; /** - * Application Insights Instrumentation key. A read-only value that applications can use to - * identify the destination for all telemetry sent to Azure Application Insights. This value will - * be supplied upon construction of each new Application Insights component. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application Insights component. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly instrumentationKey?: string; /** * Creation Date for the Application Insights component, in ISO 8601 format. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly creationDate?: Date; /** * Azure Tenant Id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tenantId?: string; - /** - * The unique application ID created when a new application is added to HockeyApp, used for - * communications with HockeyApp. - */ + /** The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. */ hockeyAppId?: string; /** * Token used to authenticate communications with between Application Insights and HockeyApp. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly hockeyAppToken?: string; /** - * Current state of this component: whether or not is has been provisioned within the resource - * group it is defined. Users cannot change this value but are able to read from it. Values will - * include Succeeded, Deploying, Canceled, and Failed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; - /** - * Percentage of the data produced by the application being monitored that is being sampled for - * Application Insights telemetry. - */ + /** Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. */ samplingPercentage?: number; /** * Application Insights component connection string. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly connectionString?: string; - /** - * Retention period in days. Default value: 90. - */ + /** Retention period in days. */ retentionInDays?: number; - /** - * Disable IP masking. - */ + /** Disable IP masking. */ disableIpMasking?: boolean; - /** - * Purge data immediately after 30 days. - */ + /** Purge data immediately after 30 days. */ immediatePurgeDataOn30Days?: boolean; /** * List of linked private link scope resources. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly privateLinkScopedResources?: PrivateLinkScopedResource[]; - /** - * The network access type for accessing Application Insights ingestion. Possible values include: - * 'Enabled', 'Disabled'. Default value: 'Enabled'. - */ + /** The network access type for accessing Application Insights ingestion. */ publicNetworkAccessForIngestion?: PublicNetworkAccessType; - /** - * The network access type for accessing Application Insights query. Possible values include: - * 'Enabled', 'Disabled'. Default value: 'Enabled'. - */ + /** The network access type for accessing Application Insights query. */ publicNetworkAccessForQuery?: PublicNetworkAccessType; - /** - * Indicates the flow of the ingestion. Possible values include: 'ApplicationInsights', - * 'ApplicationInsightsWithDiagnosticSettings', 'LogAnalytics'. Default value: - * 'ApplicationInsights'. - */ + /** Indicates the flow of the ingestion. */ ingestionMode?: IngestionMode; -} +}; -/** - * User-defined filters to return data which will be purged from the table. - */ -export interface ComponentPurgeBodyFilters { +/** An azure resource object */ +export type WorkbookResource = TrackedResource & { + /** Identity used for BYOS */ + identity?: WorkbookResourceIdentity; + /** The kind of workbook. Choices are user and shared. */ + kind?: Kind; + /** Resource etag */ + etag?: string; +}; + +/** An Application Insights component linked storage accounts */ +export type ComponentLinkedStorageAccounts = ProxyResource & { + /** Linked storage account resource ID */ + linkedStorageAccount?: string; +}; + +/** An Application Insights workbook definition. */ +export type Workbook = WorkbookResource & { /** - * The column of the table over which the given query should run + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - column?: string; + readonly systemData?: SystemData; + /** The user-defined name (display name) of the workbook. */ + displayName?: string; + /** Configuration of this particular workbook. Configuration data is a string containing valid JSON */ + serializedData?: string; + /** Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData */ + version?: string; /** - * A query operator to evaluate over the provided column and value(s). Supported operators are - * ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL - * query. + * Date and time in UTC of the last modification that was made to this workbook definition. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - operator?: string; + readonly timeModified?: Date; + /** Workbook category, as defined by the user at creation time. */ + category?: string; + /** Being deprecated, please use the other tags field */ + tagsPropertiesTags?: string[]; /** - * the value for the operator to function over. This can be a number (e.g., > 100), a string - * (timestamp >= '2017-09-01') or array of values. + * Unique user id of the specific user that owns this workbook. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - value?: any; + readonly userId?: string; + /** ResourceId for a source resource. */ + sourceId?: string; + /** The resourceId to the storage account when bring your own storage is used */ + storageUri?: string; + /** The description of the workbook. */ + description?: string; /** - * When filtering over custom dimensions, this key will be used as the name of the custom - * dimension. + * The unique revision id for this workbook definition + * NOTE: This property will not be serialized. It can only be populated by the server. */ - key?: string; + readonly revision?: string; +}; + +/** Known values of {@link FavoriteSourceType} that the service accepts. */ +export enum KnownFavoriteSourceType { + Retention = "retention", + Notebook = "notebook", + Sessions = "sessions", + Events = "events", + Userflows = "userflows", + Funnel = "funnel", + Impact = "impact", + Segmentation = "segmentation" } /** - * Describes the body of a purge request for an App Insights component + * Defines values for FavoriteSourceType. \ + * {@link KnownFavoriteSourceType} can be used interchangeably with FavoriteSourceType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **retention** \ + * **notebook** \ + * **sessions** \ + * **events** \ + * **userflows** \ + * **funnel** \ + * **impact** \ + * **segmentation** */ -export interface ComponentPurgeBody { - /** - * Table from which to purge data. - */ - table: string; - /** - * The set of columns and filters (queries) to run over them to purge the resulting data. - */ - filters: ComponentPurgeBodyFilters[]; +export type FavoriteSourceType = string; + +/** Known values of {@link ItemScopePath} that the service accepts. */ +export enum KnownItemScopePath { + AnalyticsItems = "analyticsItems", + MyanalyticsItems = "myanalyticsItems" } /** - * Response containing operationId for a specific purge action. + * Defines values for ItemScopePath. \ + * {@link KnownItemScopePath} can be used interchangeably with ItemScopePath, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **analyticsItems** \ + * **myanalyticsItems** */ -export interface ComponentPurgeResponse { - /** - * Id to use when querying for status for a particular purge operation. - */ - operationId: string; +export type ItemScopePath = string; + +/** Known values of {@link ItemScope} that the service accepts. */ +export enum KnownItemScope { + Shared = "shared", + User = "user" } /** - * Response containing status for a specific purge operation. + * Defines values for ItemScope. \ + * {@link KnownItemScope} can be used interchangeably with ItemScope, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **shared** \ + * **user** */ -export interface ComponentPurgeStatusResponse { - /** - * Status of the operation represented by the requested Id. Possible values include: 'pending', - * 'completed' - */ - status: PurgeState; +export type ItemScope = string; + +/** Known values of {@link ItemTypeParameter} that the service accepts. */ +export enum KnownItemTypeParameter { + None = "none", + Query = "query", + Function = "function", + Folder = "folder", + Recent = "recent" } /** - * An interface representing Resource. + * Defines values for ItemTypeParameter. \ + * {@link KnownItemTypeParameter} can be used interchangeably with ItemTypeParameter, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **none** \ + * **query** \ + * **function** \ + * **folder** \ + * **recent** */ -export interface Resource extends BaseResource { - /** - * Fully qualified resource Id for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The name of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The type of the resource. Ex- Microsoft.Compute/virtualMachines or - * Microsoft.Storage/storageAccounts. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; +export type ItemTypeParameter = string; + +/** Known values of {@link ItemType} that the service accepts. */ +export enum KnownItemType { + None = "none", + Query = "query", + Recent = "recent", + Function = "function" } /** - * The resource model definition for a ARM proxy resource. It will have everything other than - * required location and tags + * Defines values for ItemType. \ + * {@link KnownItemType} can be used interchangeably with ItemType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **none** \ + * **query** \ + * **recent** \ + * **function** */ -export interface ProxyResource extends Resource { +export type ItemType = string; + +/** Known values of {@link CategoryType} that the service accepts. */ +export enum KnownCategoryType { + Workbook = "workbook", + TSG = "TSG", + Performance = "performance", + Retention = "retention" } /** - * An Application Insights component linked storage accounts + * Defines values for CategoryType. \ + * {@link KnownCategoryType} can be used interchangeably with CategoryType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **workbook** \ + * **TSG** \ + * **performance** \ + * **retention** */ -export interface ComponentLinkedStorageAccounts extends ProxyResource { - /** - * Linked storage account resource ID - */ - linkedStorageAccount?: string; -} +export type CategoryType = string; -/** - * An Application Insights component linked storage accounts patch - */ -export interface ComponentLinkedStorageAccountsPatch { - /** - * Linked storage account resource ID - */ - linkedStorageAccount?: string; +/** Known values of {@link Kind} that the service accepts. */ +export enum KnownKind { + User = "user", + Shared = "shared" } /** - * The resource model definition for a ARM tracked top level resource + * Defines values for Kind. \ + * {@link KnownKind} can be used interchangeably with Kind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **shared** */ -export interface TrackedResource extends Resource { - /** - * Resource tags. - */ - tags?: { [propertyName: string]: string }; - /** - * The geo-location where the resource lives - */ - location: string; -} +export type Kind = string; -/** - * The resource model definition for a Azure Resource Manager resource with an etag. - */ -export interface AzureEntityResource extends Resource { - /** - * Resource Etag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly etag?: string; +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" } /** - * The response to a live token query. + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** */ -export interface LiveTokenResponse { - /** - * JWT token for accessing live metrics stream data. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly liveToken?: string; -} +export type CreatedByType = string; -/** - * Information about an operation - */ -export interface OperationInfo { - /** - * Name of the provider - */ - provider?: string; - /** - * Name of the resource type - */ - resource?: string; - /** - * Name of the operation - */ - operation?: string; - /** - * Description of the operation - */ - description?: string; +/** Known values of {@link MyWorkbookManagedIdentityType} that the service accepts. */ +export enum KnownMyWorkbookManagedIdentityType { + UserAssigned = "UserAssigned", + None = "None" } /** - * Represents an operation returned by the GetOperations request + * Defines values for MyWorkbookManagedIdentityType. \ + * {@link KnownMyWorkbookManagedIdentityType} can be used interchangeably with MyWorkbookManagedIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **UserAssigned** \ + * **None** */ -export interface OperationLive { - /** - * Name of the operation - */ - name?: string; - /** - * Display name of the operation - */ - display?: OperationInfo; - /** - * Origin of the operation - */ - origin?: string; - /** - * Properties of the operation - */ - properties?: any; -} +export type MyWorkbookManagedIdentityType = string; -/** - * Optional Parameters. - */ -export interface FavoritesListOptionalParams extends msRest.RequestOptionsBase { - /** - * The type of favorite. Value can be either shared or user. Possible values include: 'shared', - * 'user'. Default value: 'shared'. - */ - favoriteType?: FavoriteType; - /** - * Source type of favorite to return. When left out, the source type defaults to 'other' (not - * present in this enum). Possible values include: 'retention', 'notebook', 'sessions', 'events', - * 'userflows', 'funnel', 'impact', 'segmentation' - */ - sourceType?: FavoriteSourceType; - /** - * Flag indicating whether or not to return the full content for each applicable favorite. If - * false, only return summary content for favorites. - */ - canFetchContent?: boolean; - /** - * Tags that must be present on each favorite returned. - */ - tags?: string[]; +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + UserAssigned = "UserAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned" } /** - * Optional Parameters. + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned,UserAssigned** */ -export interface AnalyticsItemsListOptionalParams extends msRest.RequestOptionsBase { - /** - * Enum indicating if this item definition is owned by a specific user or is shared between all - * users with access to the Application Insights component. Possible values include: 'shared', - * 'user'. Default value: 'shared'. - */ - scope?: ItemScope; - /** - * Enum indicating the type of the Analytics item. Possible values include: 'none', 'query', - * 'function', 'folder', 'recent'. Default value: 'none'. - */ - type?: ItemTypeParameter; - /** - * Flag indicating whether or not to return the content of each applicable item. If false, only - * return the item information. - */ - includeContent?: boolean; -} +export type ManagedServiceIdentityType = string; -/** - * Optional Parameters. - */ -export interface AnalyticsItemsGetOptionalParams extends msRest.RequestOptionsBase { - /** - * The Id of a specific item defined in the Application Insights component - */ - id?: string; - /** - * The name of a specific item defined in the Application Insights component - */ - name?: string; +/** Known values of {@link SharedTypeKind} that the service accepts. */ +export enum KnownSharedTypeKind { + User = "user", + Shared = "shared" } /** - * Optional Parameters. + * Defines values for SharedTypeKind. \ + * {@link KnownSharedTypeKind} can be used interchangeably with SharedTypeKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **shared** */ -export interface AnalyticsItemsPutOptionalParams extends msRest.RequestOptionsBase { - /** - * Flag indicating whether or not to force save an item. This allows overriding an item if it - * already exists. - */ - overrideItem?: boolean; -} +export type SharedTypeKind = string; -/** - * Optional Parameters. - */ -export interface AnalyticsItemsDeleteMethodOptionalParams extends msRest.RequestOptionsBase { - /** - * The Id of a specific item defined in the Application Insights component - */ - id?: string; - /** - * The name of a specific item defined in the Application Insights component - */ - name?: string; +/** Known values of {@link ApplicationType} that the service accepts. */ +export enum KnownApplicationType { + Web = "web", + Other = "other" } /** - * Optional Parameters. + * Defines values for ApplicationType. \ + * {@link KnownApplicationType} can be used interchangeably with ApplicationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **web** \ + * **other** */ -export interface WorkbooksListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * Tags presents on each workbook returned. - */ - tags?: string[]; - /** - * Flag indicating whether or not to return the full content for each applicable workbook. If - * false, only return summary content for workbooks. - */ - canFetchContent?: boolean; -} +export type ApplicationType = string; -/** - * Optional Parameters. - */ -export interface MyWorkbooksListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * Tags presents on each workbook returned. - */ - tags?: string[]; - /** - * Flag indicating whether or not to return the full content for each applicable workbook. If - * false, only return summary content for workbooks. - */ - canFetchContent?: boolean; +/** Known values of {@link FlowType} that the service accepts. */ +export enum KnownFlowType { + Bluefield = "Bluefield" } /** - * Optional Parameters. + * Defines values for FlowType. \ + * {@link KnownFlowType} can be used interchangeably with FlowType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Bluefield** */ -export interface MyWorkbooksListBySubscriptionOptionalParams extends msRest.RequestOptionsBase { - /** - * Tags presents on each workbook returned. - */ - tags?: string[]; - /** - * Flag indicating whether or not to return the full content for each applicable workbook. If - * false, only return summary content for workbooks. - */ - canFetchContent?: boolean; -} +export type FlowType = string; -/** - * An interface representing ApplicationInsightsManagementClientOptions. - */ -export interface ApplicationInsightsManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; +/** Known values of {@link RequestSource} that the service accepts. */ +export enum KnownRequestSource { + Rest = "rest" } /** - * @interface - * Result of the request to list CDN operations. It contains a list of operations and a URL link to - * get the next set of results. - * @extends Array + * Defines values for RequestSource. \ + * {@link KnownRequestSource} can be used interchangeably with RequestSource, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **rest** */ -export interface OperationListResult extends Array { - /** - * URL to get the next set of operation list results if there are any. - */ - nextLink?: string; -} +export type RequestSource = string; -/** - * @interface - * Result of the List Operations operation - * @extends Array - */ -export interface OperationsListResult extends Array { - /** - * URL to get the next set of operation list results if there are any. - */ - nextLink?: string; +/** Known values of {@link PublicNetworkAccessType} that the service accepts. */ +export enum KnownPublicNetworkAccessType { + /** Enables connectivity to Application Insights through public DNS. */ + Enabled = "Enabled", + /** Disables public connectivity to Application Insights through public DNS. */ + Disabled = "Disabled" } /** - * @interface - * Annotations list result. - * @extends Array + * Defines values for PublicNetworkAccessType. \ + * {@link KnownPublicNetworkAccessType} can be used interchangeably with PublicNetworkAccessType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled**: Enables connectivity to Application Insights through public DNS. \ + * **Disabled**: Disables public connectivity to Application Insights through public DNS. */ -export interface AnnotationsListResult extends Array { -} +export type PublicNetworkAccessType = string; -/** - * @interface - * Describes the list of API Keys of an Application Insights Component. - * @extends Array - */ -export interface ApplicationInsightsComponentAPIKeyListResult extends Array { +/** Known values of {@link IngestionMode} that the service accepts. */ +export enum KnownIngestionMode { + ApplicationInsights = "ApplicationInsights", + ApplicationInsightsWithDiagnosticSettings = "ApplicationInsightsWithDiagnosticSettings", + LogAnalytics = "LogAnalytics" } /** - * @interface - * Work item configuration list result. - * @extends Array + * Defines values for IngestionMode. \ + * {@link KnownIngestionMode} can be used interchangeably with IngestionMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ApplicationInsights** \ + * **ApplicationInsightsWithDiagnosticSettings** \ + * **LogAnalytics** */ -export interface WorkItemConfigurationsListResult extends Array { -} +export type IngestionMode = string; -/** - * @interface - * Describes the list of web test locations available to an Application Insights Component. - * @extends Array - */ -export interface ApplicationInsightsWebTestLocationsListResult extends Array { +/** Known values of {@link PurgeState} that the service accepts. */ +export enum KnownPurgeState { + Pending = "pending", + Completed = "completed" } /** - * @interface - * A list of 0 or more Application Insights web test definitions. - * @extends Array + * Defines values for PurgeState. \ + * {@link KnownPurgeState} can be used interchangeably with PurgeState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **pending** \ + * **completed** */ -export interface WebTestListResult extends Array { - /** - * The link to get the next part of the returned list of web tests, should the return set be too - * large for a single request. May be null. - */ - nextLink?: string; -} +export type PurgeState = string; -/** - * @interface - * Workbook list result. - * @extends Array - */ -export interface WorkbooksListResult extends Array { +/** Known values of {@link StorageType} that the service accepts. */ +export enum KnownStorageType { + ServiceProfiler = "ServiceProfiler" } /** - * @interface - * Workbook list result. - * @extends Array + * Defines values for StorageType. \ + * {@link KnownStorageType} can be used interchangeably with StorageType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ServiceProfiler** */ -export interface MyWorkbooksListResult extends Array { -} +export type StorageType = string; +/** Defines values for FavoriteType. */ +export type FavoriteType = "shared" | "user"; +/** Defines values for WebTestKind. */ +export type WebTestKind = "ping" | "multistep"; -/** - * @interface - * Describes the list of Application Insights Resources. - * @extends Array - */ -export interface ApplicationInsightsComponentListResult extends Array { - /** - * The URI to get the next set of Application Insights component definitions if too many - * components where returned in the result set. - */ - nextLink?: string; -} +/** Optional parameters. */ +export interface AnnotationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for FavoriteType. - * Possible values include: 'shared', 'user' - * @readonly - * @enum {string} - */ -export type FavoriteType = 'shared' | 'user'; +/** Contains response data for the list operation. */ +export type AnnotationsListResponse = AnnotationsListResult; -/** - * Defines values for WebTestKind. - * Possible values include: 'ping', 'multistep' - * @readonly - * @enum {string} - */ -export type WebTestKind = 'ping' | 'multistep'; +/** Optional parameters. */ +export interface AnnotationsCreateOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ItemScope. - * Possible values include: 'shared', 'user' - * @readonly - * @enum {string} - */ -export type ItemScope = 'shared' | 'user'; +/** Contains response data for the create operation. */ +export type AnnotationsCreateResponse = Annotation[]; -/** - * Defines values for ItemType. - * Possible values include: 'query', 'function', 'folder', 'recent' - * @readonly - * @enum {string} - */ -export type ItemType = 'query' | 'function' | 'folder' | 'recent'; +/** Optional parameters. */ +export interface AnnotationsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for SharedTypeKind. - * Possible values include: 'user', 'shared' - * @readonly - * @enum {string} - */ -export type SharedTypeKind = 'user' | 'shared'; +/** Optional parameters. */ +export interface AnnotationsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ApplicationType. - * Possible values include: 'web', 'other' - * @readonly - * @enum {string} - */ -export type ApplicationType = 'web' | 'other'; +/** Contains response data for the get operation. */ +export type AnnotationsGetResponse = Annotation[]; -/** - * Defines values for FlowType. - * Possible values include: 'Bluefield' - * @readonly - * @enum {string} - */ -export type FlowType = 'Bluefield'; +/** Optional parameters. */ +export interface APIKeysListOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for RequestSource. - * Possible values include: 'rest' - * @readonly - * @enum {string} - */ -export type RequestSource = 'rest'; +/** Contains response data for the list operation. */ +export type APIKeysListResponse = ApplicationInsightsComponentAPIKeyListResult; -/** - * Defines values for PublicNetworkAccessType. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type PublicNetworkAccessType = 'Enabled' | 'Disabled'; +/** Optional parameters. */ +export interface APIKeysCreateOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for IngestionMode. - * Possible values include: 'ApplicationInsights', 'ApplicationInsightsWithDiagnosticSettings', - * 'LogAnalytics' - * @readonly - * @enum {string} - */ -export type IngestionMode = 'ApplicationInsights' | 'ApplicationInsightsWithDiagnosticSettings' | 'LogAnalytics'; +/** Contains response data for the create operation. */ +export type APIKeysCreateResponse = ApplicationInsightsComponentAPIKey; -/** - * Defines values for PurgeState. - * Possible values include: 'pending', 'completed' - * @readonly - * @enum {string} - */ -export type PurgeState = 'pending' | 'completed'; +/** Optional parameters. */ +export interface APIKeysDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for FavoriteSourceType. - * Possible values include: 'retention', 'notebook', 'sessions', 'events', 'userflows', 'funnel', - * 'impact', 'segmentation' - * @readonly - * @enum {string} - */ -export type FavoriteSourceType = 'retention' | 'notebook' | 'sessions' | 'events' | 'userflows' | 'funnel' | 'impact' | 'segmentation'; +/** Contains response data for the delete operation. */ +export type APIKeysDeleteResponse = ApplicationInsightsComponentAPIKey; -/** - * Defines values for ItemScopePath. - * Possible values include: 'analyticsItems', 'myanalyticsItems' - * @readonly - * @enum {string} - */ -export type ItemScopePath = 'analyticsItems' | 'myanalyticsItems'; +/** Optional parameters. */ +export interface APIKeysGetOptionalParams extends coreClient.OperationOptions {} -/** - * Defines values for ItemTypeParameter. - * Possible values include: 'none', 'query', 'function', 'folder', 'recent' - * @readonly - * @enum {string} - */ -export type ItemTypeParameter = 'none' | 'query' | 'function' | 'folder' | 'recent'; +/** Contains response data for the get operation. */ +export type APIKeysGetResponse = ApplicationInsightsComponentAPIKey; -/** - * Defines values for CategoryType. - * Possible values include: 'workbook', 'TSG', 'performance', 'retention' - * @readonly - * @enum {string} - */ -export type CategoryType = 'workbook' | 'TSG' | 'performance' | 'retention'; +/** Optional parameters. */ +export interface ExportConfigurationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the list operation. */ +export type ExportConfigurationsListResponse = ApplicationInsightsComponentExportConfiguration[]; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Optional parameters. */ +export interface ExportConfigurationsCreateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list1 operation. - */ -export type OperationsList1Response = OperationsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the create operation. */ +export type ExportConfigurationsCreateResponse = ApplicationInsightsComponentExportConfiguration[]; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationsListResult; - }; -}; +/** Optional parameters. */ +export interface ExportConfigurationsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type OperationsListNextResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the delete operation. */ +export type ExportConfigurationsDeleteResponse = ApplicationInsightsComponentExportConfiguration; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Optional parameters. */ +export interface ExportConfigurationsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list1Next operation. - */ -export type OperationsList1NextResponse = OperationsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type ExportConfigurationsGetResponse = ApplicationInsightsComponentExportConfiguration; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationsListResult; - }; -}; +/** Optional parameters. */ +export interface ExportConfigurationsUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type AnnotationsListResponse = AnnotationsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the update operation. */ +export type ExportConfigurationsUpdateResponse = ApplicationInsightsComponentExportConfiguration; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AnnotationsListResult; - }; -}; +/** Optional parameters. */ +export interface ComponentCurrentBillingFeaturesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the create operation. - */ -export type AnnotationsCreateResponse = Array & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type ComponentCurrentBillingFeaturesGetResponse = ApplicationInsightsComponentBillingFeatures; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Annotation[]; - }; -}; +/** Optional parameters. */ +export interface ComponentCurrentBillingFeaturesUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type AnnotationsGetResponse = Array & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the update operation. */ +export type ComponentCurrentBillingFeaturesUpdateResponse = ApplicationInsightsComponentBillingFeatures; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Annotation[]; - }; -}; +/** Optional parameters. */ +export interface ComponentQuotaStatusGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type APIKeysListResponse = ApplicationInsightsComponentAPIKeyListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type ComponentQuotaStatusGetResponse = ApplicationInsightsComponentQuotaStatus; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentAPIKeyListResult; - }; -}; +/** Optional parameters. */ +export interface ComponentFeatureCapabilitiesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the create operation. - */ -export type APIKeysCreateResponse = ApplicationInsightsComponentAPIKey & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type ComponentFeatureCapabilitiesGetResponse = ApplicationInsightsComponentFeatureCapabilities; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentAPIKey; - }; -}; +/** Optional parameters. */ +export interface ComponentAvailableFeaturesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the deleteMethod operation. - */ -export type APIKeysDeleteMethodResponse = ApplicationInsightsComponentAPIKey & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type ComponentAvailableFeaturesGetResponse = ApplicationInsightsComponentAvailableFeatures; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentAPIKey; - }; -}; +/** Optional parameters. */ +export interface ProactiveDetectionConfigurationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type APIKeysGetResponse = ApplicationInsightsComponentAPIKey & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the list operation. */ +export type ProactiveDetectionConfigurationsListResponse = ApplicationInsightsComponentProactiveDetectionConfiguration[]; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentAPIKey; - }; -}; +/** Optional parameters. */ +export interface ProactiveDetectionConfigurationsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type ExportConfigurationsListResponse = Array & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type ProactiveDetectionConfigurationsGetResponse = ApplicationInsightsComponentProactiveDetectionConfiguration; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentExportConfiguration[]; - }; -}; +/** Optional parameters. */ +export interface ProactiveDetectionConfigurationsUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the create operation. - */ -export type ExportConfigurationsCreateResponse = Array & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the update operation. */ +export type ProactiveDetectionConfigurationsUpdateResponse = ApplicationInsightsComponentProactiveDetectionConfiguration; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentExportConfiguration[]; - }; -}; +/** Optional parameters. */ +export interface WorkItemConfigurationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the deleteMethod operation. - */ -export type ExportConfigurationsDeleteMethodResponse = ApplicationInsightsComponentExportConfiguration & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the list operation. */ +export type WorkItemConfigurationsListResponse = WorkItemConfigurationsListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentExportConfiguration; - }; -}; +/** Optional parameters. */ +export interface WorkItemConfigurationsCreateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ExportConfigurationsGetResponse = ApplicationInsightsComponentExportConfiguration & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the create operation. */ +export type WorkItemConfigurationsCreateResponse = WorkItemConfiguration; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentExportConfiguration; - }; -}; +/** Optional parameters. */ +export interface WorkItemConfigurationsGetDefaultOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type ExportConfigurationsUpdateResponse = ApplicationInsightsComponentExportConfiguration & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the getDefault operation. */ +export type WorkItemConfigurationsGetDefaultResponse = WorkItemConfiguration; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentExportConfiguration; - }; -}; +/** Optional parameters. */ +export interface WorkItemConfigurationsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ComponentCurrentBillingFeaturesGetResponse = ApplicationInsightsComponentBillingFeatures & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WorkItemConfigurationsGetItemOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentBillingFeatures; - }; -}; +/** Contains response data for the getItem operation. */ +export type WorkItemConfigurationsGetItemResponse = WorkItemConfiguration; -/** - * Contains response data for the update operation. - */ -export type ComponentCurrentBillingFeaturesUpdateResponse = ApplicationInsightsComponentBillingFeatures & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WorkItemConfigurationsUpdateItemOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentBillingFeatures; - }; -}; +/** Contains response data for the updateItem operation. */ +export type WorkItemConfigurationsUpdateItemResponse = WorkItemConfiguration; -/** - * Contains response data for the get operation. - */ -export type ComponentQuotaStatusGetResponse = ApplicationInsightsComponentQuotaStatus & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface FavoritesListOptionalParams + extends coreClient.OperationOptions { + /** The type of favorite. Value can be either shared or user. */ + favoriteType?: FavoriteType; + /** Source type of favorite to return. When left out, the source type defaults to 'other' (not present in this enum). */ + sourceType?: FavoriteSourceType; + /** Flag indicating whether or not to return the full content for each applicable favorite. If false, only return summary content for favorites. */ + canFetchContent?: boolean; + /** Tags that must be present on each favorite returned. */ + tags?: string[]; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentQuotaStatus; - }; -}; +/** Contains response data for the list operation. */ +export type FavoritesListResponse = ApplicationInsightsComponentFavorite[]; -/** - * Contains response data for the get operation. - */ -export type ComponentFeatureCapabilitiesGetResponse = ApplicationInsightsComponentFeatureCapabilities & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface FavoritesGetOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentFeatureCapabilities; - }; -}; +/** Contains response data for the get operation. */ +export type FavoritesGetResponse = ApplicationInsightsComponentFavorite; -/** - * Contains response data for the get operation. - */ -export type ComponentAvailableFeaturesGetResponse = ApplicationInsightsComponentAvailableFeatures & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface FavoritesAddOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentAvailableFeatures; - }; -}; +/** Contains response data for the add operation. */ +export type FavoritesAddResponse = ApplicationInsightsComponentFavorite; -/** - * Contains response data for the list operation. - */ -export type ProactiveDetectionConfigurationsListResponse = Array & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface FavoritesUpdateOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentProactiveDetectionConfiguration[]; - }; -}; +/** Contains response data for the update operation. */ +export type FavoritesUpdateResponse = ApplicationInsightsComponentFavorite; -/** - * Contains response data for the get operation. - */ -export type ProactiveDetectionConfigurationsGetResponse = ApplicationInsightsComponentProactiveDetectionConfiguration & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface FavoritesDeleteOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentProactiveDetectionConfiguration; - }; -}; +/** Optional parameters. */ +export interface WebTestLocationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type ProactiveDetectionConfigurationsUpdateResponse = ApplicationInsightsComponentProactiveDetectionConfiguration & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the list operation. */ +export type WebTestLocationsListResponse = ApplicationInsightsWebTestLocationsListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentProactiveDetectionConfiguration; - }; -}; +/** Optional parameters. */ +export interface WebTestsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type WorkItemConfigurationsListResponse = WorkItemConfigurationsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByResourceGroup operation. */ +export type WebTestsListByResourceGroupResponse = WebTestListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: WorkItemConfigurationsListResult; - }; -}; +/** Optional parameters. */ +export interface WebTestsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the create operation. - */ -export type WorkItemConfigurationsCreateResponse = WorkItemConfiguration & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type WebTestsGetResponse = WebTest; - /** - * The response body as parsed JSON or XML - */ - parsedBody: WorkItemConfiguration; - }; -}; +/** Optional parameters. */ +export interface WebTestsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getDefault operation. - */ -export type WorkItemConfigurationsGetDefaultResponse = WorkItemConfiguration & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the createOrUpdate operation. */ +export type WebTestsCreateOrUpdateResponse = WebTest; - /** - * The response body as parsed JSON or XML - */ - parsedBody: WorkItemConfiguration; - }; -}; +/** Optional parameters. */ +export interface WebTestsUpdateTagsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getItem operation. - */ -export type WorkItemConfigurationsGetItemResponse = WorkItemConfiguration & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the updateTags operation. */ +export type WebTestsUpdateTagsResponse = WebTest; - /** - * The response body as parsed JSON or XML - */ - parsedBody: WorkItemConfiguration; - }; -}; +/** Optional parameters. */ +export interface WebTestsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the updateItem operation. - */ -export type WorkItemConfigurationsUpdateItemResponse = WorkItemConfiguration & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WebTestsListOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: WorkItemConfiguration; - }; -}; +/** Contains response data for the list operation. */ +export type WebTestsListResponse = WebTestListResult; -/** - * Contains response data for the list operation. - */ -export type FavoritesListResponse = Array & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WebTestsListByComponentOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentFavorite[]; - }; -}; +/** Contains response data for the listByComponent operation. */ +export type WebTestsListByComponentResponse = WebTestListResult; -/** - * Contains response data for the get operation. - */ -export type FavoritesGetResponse = ApplicationInsightsComponentFavorite & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WebTestsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentFavorite; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type WebTestsListByResourceGroupNextResponse = WebTestListResult; -/** - * Contains response data for the add operation. - */ -export type FavoritesAddResponse = ApplicationInsightsComponentFavorite & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WebTestsListNextOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentFavorite; - }; -}; +/** Contains response data for the listNext operation. */ +export type WebTestsListNextResponse = WebTestListResult; -/** - * Contains response data for the update operation. - */ -export type FavoritesUpdateResponse = ApplicationInsightsComponentFavorite & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WebTestsListByComponentNextOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentFavorite; - }; -}; +/** Contains response data for the listByComponentNext operation. */ +export type WebTestsListByComponentNextResponse = WebTestListResult; -/** - * Contains response data for the list operation. - */ -export type WebTestLocationsListResponse = ApplicationInsightsWebTestLocationsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface AnalyticsItemsListOptionalParams + extends coreClient.OperationOptions { + /** Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. */ + scope?: ItemScope; + /** Enum indicating the type of the Analytics item. */ + typeParam?: ItemTypeParameter; + /** Flag indicating whether or not to return the content of each applicable item. If false, only return the item information. */ + includeContent?: boolean; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsWebTestLocationsListResult; - }; -}; +/** Contains response data for the list operation. */ +export type AnalyticsItemsListResponse = ApplicationInsightsComponentAnalyticsItem[]; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type WebTestsListByResourceGroupResponse = WebTestListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface AnalyticsItemsGetOptionalParams + extends coreClient.OperationOptions { + /** The Id of a specific item defined in the Application Insights component */ + id?: string; + /** The name of a specific item defined in the Application Insights component */ + name?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: WebTestListResult; - }; -}; +/** Contains response data for the get operation. */ +export type AnalyticsItemsGetResponse = ApplicationInsightsComponentAnalyticsItem; -/** - * Contains response data for the get operation. - */ -export type WebTestsGetResponse = WebTest & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface AnalyticsItemsPutOptionalParams + extends coreClient.OperationOptions { + /** Flag indicating whether or not to force save an item. This allows overriding an item if it already exists. */ + overrideItem?: boolean; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: WebTest; - }; -}; +/** Contains response data for the put operation. */ +export type AnalyticsItemsPutResponse = ApplicationInsightsComponentAnalyticsItem; -/** - * Contains response data for the createOrUpdate operation. - */ -export type WebTestsCreateOrUpdateResponse = WebTest & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface AnalyticsItemsDeleteOptionalParams + extends coreClient.OperationOptions { + /** The Id of a specific item defined in the Application Insights component */ + id?: string; + /** The name of a specific item defined in the Application Insights component */ + name?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: WebTest; - }; -}; +/** Optional parameters. */ +export interface WorkbookTemplatesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the updateTags operation. - */ -export type WebTestsUpdateTagsResponse = WebTest & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByResourceGroup operation. */ +export type WorkbookTemplatesListByResourceGroupResponse = WorkbookTemplatesListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: WebTest; - }; -}; +/** Optional parameters. */ +export interface WorkbookTemplatesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type WebTestsListResponse = WebTestListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type WorkbookTemplatesGetResponse = WorkbookTemplate; - /** - * The response body as parsed JSON or XML - */ - parsedBody: WebTestListResult; - }; -}; +/** Optional parameters. */ +export interface WorkbookTemplatesDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByComponent operation. - */ -export type WebTestsListByComponentResponse = WebTestListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WorkbookTemplatesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: WebTestListResult; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type WorkbookTemplatesCreateOrUpdateResponse = WorkbookTemplate; -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type WebTestsListByResourceGroupNextResponse = WebTestListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WorkbookTemplatesUpdateOptionalParams + extends coreClient.OperationOptions { + /** Properties that need to be specified to patch a workbook template. */ + workbookTemplateUpdateParameters?: WorkbookTemplateUpdateParameters; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: WebTestListResult; - }; -}; +/** Contains response data for the update operation. */ +export type WorkbookTemplatesUpdateResponse = WorkbookTemplate; -/** - * Contains response data for the listNext operation. - */ -export type WebTestsListNextResponse = WebTestListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface MyWorkbooksListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. */ + canFetchContent?: boolean; + /** Tags presents on each workbook returned. */ + tags?: string[]; + /** Azure Resource Id that will fetch all linked workbooks. */ + sourceId?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: WebTestListResult; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type MyWorkbooksListByResourceGroupResponse = MyWorkbooksListResult; -/** - * Contains response data for the listByComponentNext operation. - */ -export type WebTestsListByComponentNextResponse = WebTestListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface MyWorkbooksListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. */ + canFetchContent?: boolean; + /** Tags presents on each workbook returned. */ + tags?: string[]; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: WebTestListResult; - }; -}; +/** Contains response data for the listBySubscription operation. */ +export type MyWorkbooksListBySubscriptionResponse = MyWorkbooksListResult; -/** - * Contains response data for the list operation. - */ -export type AnalyticsItemsListResponse = Array & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface MyWorkbooksGetOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentAnalyticsItem[]; - }; -}; +/** Contains response data for the get operation. */ +export type MyWorkbooksGetResponse = MyWorkbook; -/** - * Contains response data for the get operation. - */ -export type AnalyticsItemsGetResponse = ApplicationInsightsComponentAnalyticsItem & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface MyWorkbooksDeleteOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentAnalyticsItem; - }; -}; +/** Optional parameters. */ +export interface MyWorkbooksCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Azure Resource Id that will fetch all linked workbooks. */ + sourceId?: string; +} -/** - * Contains response data for the put operation. - */ -export type AnalyticsItemsPutResponse = ApplicationInsightsComponentAnalyticsItem & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the createOrUpdate operation. */ +export type MyWorkbooksCreateOrUpdateResponse = MyWorkbook; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentAnalyticsItem; - }; -}; +/** Optional parameters. */ +export interface MyWorkbooksUpdateOptionalParams + extends coreClient.OperationOptions { + /** Azure Resource Id that will fetch all linked workbooks. */ + sourceId?: string; +} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type WorkbooksListByResourceGroupResponse = WorkbooksListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the update operation. */ +export type MyWorkbooksUpdateResponse = MyWorkbook; - /** - * The response body as parsed JSON or XML - */ - parsedBody: WorkbooksListResult; - }; -}; +/** Optional parameters. */ +export interface MyWorkbooksListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. */ + canFetchContent?: boolean; + /** Tags presents on each workbook returned. */ + tags?: string[]; + /** Azure Resource Id that will fetch all linked workbooks. */ + sourceId?: string; +} -/** - * Contains response data for the get operation. - */ -export type WorkbooksGetResponse = Workbook & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByResourceGroupNext operation. */ +export type MyWorkbooksListByResourceGroupNextResponse = MyWorkbooksListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Workbook; - }; -}; +/** Optional parameters. */ +export interface MyWorkbooksListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. */ + canFetchContent?: boolean; + /** Tags presents on each workbook returned. */ + tags?: string[]; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type WorkbooksCreateOrUpdateResponse = Workbook & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listBySubscriptionNext operation. */ +export type MyWorkbooksListBySubscriptionNextResponse = MyWorkbooksListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Workbook; - }; -}; +/** Optional parameters. */ +export interface WorkbooksListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. */ + canFetchContent?: boolean; + /** Tags presents on each workbook returned. */ + tags?: string[]; +} -/** - * Contains response data for the update operation. - */ -export type WorkbooksUpdateResponse = Workbook & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listBySubscription operation. */ +export type WorkbooksListBySubscriptionResponse = WorkbooksListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Workbook; - }; -}; +/** Optional parameters. */ +export interface WorkbooksListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. */ + canFetchContent?: boolean; + /** Tags presents on each workbook returned. */ + tags?: string[]; + /** Azure Resource Id that will fetch all linked workbooks. */ + sourceId?: string; +} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type MyWorkbooksListByResourceGroupResponse = MyWorkbooksListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByResourceGroup operation. */ +export type WorkbooksListByResourceGroupResponse = WorkbooksListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MyWorkbooksListResult; - }; -}; +/** Optional parameters. */ +export interface WorkbooksGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listBySubscription operation. - */ -export type MyWorkbooksListBySubscriptionResponse = MyWorkbooksListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type WorkbooksGetResponse = Workbook; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MyWorkbooksListResult; - }; -}; +/** Optional parameters. */ +export interface WorkbooksDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type MyWorkbooksGetResponse = MyWorkbook & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WorkbooksCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Azure Resource Id that will fetch all linked workbooks. */ + sourceId?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: MyWorkbook; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type WorkbooksCreateOrUpdateResponse = Workbook; -/** - * Contains response data for the createOrUpdate operation. - */ -export type MyWorkbooksCreateOrUpdateResponse = MyWorkbook & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WorkbooksUpdateOptionalParams + extends coreClient.OperationOptions { + /** Azure Resource Id that will fetch all linked workbooks. */ + sourceId?: string; + /** Properties that need to be specified to create a new workbook. */ + workbookUpdateParameters?: WorkbookUpdateParameters; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: MyWorkbook; - }; -}; +/** Contains response data for the update operation. */ +export type WorkbooksUpdateResponse = Workbook; -/** - * Contains response data for the update operation. - */ -export type MyWorkbooksUpdateResponse = MyWorkbook & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WorkbooksRevisionsListOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: MyWorkbook; - }; -}; +/** Contains response data for the revisionsList operation. */ +export type WorkbooksRevisionsListResponse = WorkbooksListResult; -/** - * Contains response data for the list operation. - */ -export type ComponentsListResponse = ApplicationInsightsComponentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WorkbooksRevisionGetOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentListResult; - }; -}; +/** Contains response data for the revisionGet operation. */ +export type WorkbooksRevisionGetResponse = Workbook; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ComponentsListByResourceGroupResponse = ApplicationInsightsComponentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WorkbooksListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. */ + canFetchContent?: boolean; + /** Tags presents on each workbook returned. */ + tags?: string[]; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentListResult; - }; -}; +/** Contains response data for the listBySubscriptionNext operation. */ +export type WorkbooksListBySubscriptionNextResponse = WorkbooksListResult; -/** - * Contains response data for the get operation. - */ -export type ComponentsGetResponse = ApplicationInsightsComponent & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WorkbooksListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. */ + canFetchContent?: boolean; + /** Tags presents on each workbook returned. */ + tags?: string[]; + /** Azure Resource Id that will fetch all linked workbooks. */ + sourceId?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponent; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type WorkbooksListByResourceGroupNextResponse = WorkbooksListResult; -/** - * Contains response data for the createOrUpdate operation. - */ -export type ComponentsCreateOrUpdateResponse = ApplicationInsightsComponent & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface WorkbooksRevisionsListNextOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponent; - }; -}; +/** Contains response data for the revisionsListNext operation. */ +export type WorkbooksRevisionsListNextResponse = WorkbooksListResult; -/** - * Contains response data for the updateTags operation. - */ -export type ComponentsUpdateTagsResponse = ApplicationInsightsComponent & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface ComponentsListOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponent; - }; -}; +/** Contains response data for the list operation. */ +export type ComponentsListResponse = ApplicationInsightsComponentListResult; -/** - * Contains response data for the purge operation. - */ -export type ComponentsPurgeResponse = ComponentPurgeResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface ComponentsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ComponentPurgeResponse; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type ComponentsListByResourceGroupResponse = ApplicationInsightsComponentListResult; -/** - * Contains response data for the getPurgeStatus operation. - */ -export type ComponentsGetPurgeStatusResponse = ComponentPurgeStatusResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface ComponentsDeleteOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ComponentPurgeStatusResponse; - }; -}; +/** Optional parameters. */ +export interface ComponentsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type ComponentsListNextResponse = ApplicationInsightsComponentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type ComponentsGetResponse = ApplicationInsightsComponent; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentListResult; - }; -}; +/** Optional parameters. */ +export interface ComponentsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type ComponentsListByResourceGroupNextResponse = ApplicationInsightsComponentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the createOrUpdate operation. */ +export type ComponentsCreateOrUpdateResponse = ApplicationInsightsComponent; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApplicationInsightsComponentListResult; - }; -}; +/** Optional parameters. */ +export interface ComponentsUpdateTagsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ComponentLinkedStorageAccountsGetResponse = ComponentLinkedStorageAccounts & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the updateTags operation. */ +export type ComponentsUpdateTagsResponse = ApplicationInsightsComponent; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ComponentLinkedStorageAccounts; - }; -}; +/** Optional parameters. */ +export interface ComponentsPurgeOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createAndUpdate operation. - */ -export type ComponentLinkedStorageAccountsCreateAndUpdateResponse = ComponentLinkedStorageAccounts & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the purge operation. */ +export type ComponentsPurgeResponse = ComponentPurgeResponse; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ComponentLinkedStorageAccounts; - }; -}; +/** Optional parameters. */ +export interface ComponentsGetPurgeStatusOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type ComponentLinkedStorageAccountsUpdateResponse = ComponentLinkedStorageAccounts & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the getPurgeStatus operation. */ +export type ComponentsGetPurgeStatusResponse = ComponentPurgeStatusResponse; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ComponentLinkedStorageAccounts; - }; -}; +/** Optional parameters. */ +export interface ComponentsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type LiveTokenGetResponse = LiveTokenResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listNext operation. */ +export type ComponentsListNextResponse = ApplicationInsightsComponentListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: LiveTokenResponse; - }; -}; +/** Optional parameters. */ +export interface ComponentsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ComponentsListByResourceGroupNextResponse = ApplicationInsightsComponentListResult; + +/** Optional parameters. */ +export interface ComponentLinkedStorageAccountsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ComponentLinkedStorageAccountsGetResponse = ComponentLinkedStorageAccounts; + +/** Optional parameters. */ +export interface ComponentLinkedStorageAccountsCreateAndUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createAndUpdate operation. */ +export type ComponentLinkedStorageAccountsCreateAndUpdateResponse = ComponentLinkedStorageAccounts; + +/** Optional parameters. */ +export interface ComponentLinkedStorageAccountsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ComponentLinkedStorageAccountsUpdateResponse = ComponentLinkedStorageAccounts; + +/** Optional parameters. */ +export interface ComponentLinkedStorageAccountsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationsListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationsListResult; + +/** Optional parameters. */ +export interface LiveTokenGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type LiveTokenGetResponse = LiveTokenResponse; + +/** Optional parameters. */ +export interface ApplicationInsightsManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/models/liveTokenMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/liveTokenMappers.ts deleted file mode 100644 index be3acaac607d..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/liveTokenMappers.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorResponse, - LiveTokenResponse -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/mappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/mappers.ts index facff92bf4e6..bae6de63330d 100644 --- a/sdk/applicationinsights/arm-appinsights/src/models/mappers.ts +++ b/sdk/applicationinsights/arm-appinsights/src/models/mappers.ts @@ -1,92 +1,36 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, - message: { - serializedName: "message", - type: { - name: "String" - } - } - } - } -}; - -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - type: { - name: "String" - } - } - } - } -}; - -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const AnnotationsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "AnnotationsListResult", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - display: { - serializedName: "display", + value: { + serializedName: "value", + readOnly: true, type: { - name: "Composite", - className: "OperationDisplay" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Annotation" + } + } } } } } }; -export const Annotation: msRest.CompositeMapper = { - serializedName: "Annotation", +export const Annotation: coreClient.CompositeMapper = { type: { name: "Composite", className: "Annotation", @@ -122,40 +66,17 @@ export const Annotation: msRest.CompositeMapper = { } }, relatedAnnotation: { + defaultValue: "null", serializedName: "RelatedAnnotation", - defaultValue: 'null', - type: { - name: "String" - } - } - } - } -}; - -export const InnerError: msRest.CompositeMapper = { - serializedName: "InnerError", - type: { - name: "Composite", - className: "InnerError", - modelProperties: { - diagnosticcontext: { - serializedName: "diagnosticcontext", type: { name: "String" } - }, - time: { - serializedName: "time", - type: { - name: "DateTime" - } } } } }; -export const AnnotationError: msRest.CompositeMapper = { - serializedName: "AnnotationError", +export const AnnotationError: coreClient.CompositeMapper = { type: { name: "Composite", className: "AnnotationError", @@ -183,36 +104,41 @@ export const AnnotationError: msRest.CompositeMapper = { } }; -export const APIKeyRequest: msRest.CompositeMapper = { - serializedName: "APIKeyRequest", +export const InnerError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "APIKeyRequest", + className: "InnerError", modelProperties: { - name: { - serializedName: "name", + diagnosticcontext: { + serializedName: "diagnosticcontext", type: { name: "String" } }, - linkedReadProperties: { - serializedName: "linkedReadProperties", + time: { + serializedName: "time", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTime" } - }, - linkedWriteProperties: { - serializedName: "linkedWriteProperties", + } + } + } +}; + +export const ApplicationInsightsComponentAPIKeyListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApplicationInsightsComponentAPIKeyListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "ApplicationInsightsComponentAPIKey" } } } @@ -221,22 +147,21 @@ export const APIKeyRequest: msRest.CompositeMapper = { } }; -export const ApplicationInsightsComponentAPIKey: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentAPIKey", +export const ApplicationInsightsComponentAPIKey: coreClient.CompositeMapper = { type: { name: "Composite", className: "ApplicationInsightsComponentAPIKey", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, apiKey: { - readOnly: true, serializedName: "apiKey", + readOnly: true, type: { name: "String" } @@ -279,86 +204,58 @@ export const ApplicationInsightsComponentAPIKey: msRest.CompositeMapper = { } }; -export const ApplicationInsightsComponentExportRequest: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentExportRequest", +export const APIKeyRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplicationInsightsComponentExportRequest", + className: "APIKeyRequest", modelProperties: { - recordTypes: { - serializedName: "RecordTypes", - type: { - name: "String" - } - }, - destinationType: { - serializedName: "DestinationType", - type: { - name: "String" - } - }, - destinationAddress: { - serializedName: "DestinationAddress", - type: { - name: "String" - } - }, - isEnabled: { - serializedName: "IsEnabled", - type: { - name: "String" - } - }, - notificationQueueEnabled: { - serializedName: "NotificationQueueEnabled", - type: { - name: "String" - } - }, - notificationQueueUri: { - serializedName: "NotificationQueueUri", - type: { - name: "String" - } - }, - destinationStorageSubscriptionId: { - serializedName: "DestinationStorageSubscriptionId", + name: { + serializedName: "name", type: { name: "String" } }, - destinationStorageLocationId: { - serializedName: "DestinationStorageLocationId", + linkedReadProperties: { + serializedName: "linkedReadProperties", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - destinationAccountId: { - serializedName: "DestinationAccountId", + linkedWriteProperties: { + serializedName: "linkedWriteProperties", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const ApplicationInsightsComponentExportConfiguration: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentExportConfiguration", +export const ApplicationInsightsComponentExportConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", className: "ApplicationInsightsComponentExportConfiguration", modelProperties: { exportId: { - readOnly: true, serializedName: "ExportId", + readOnly: true, type: { name: "String" } }, instrumentationKey: { - readOnly: true, serializedName: "InstrumentationKey", + readOnly: true, type: { name: "String" } @@ -370,64 +267,64 @@ export const ApplicationInsightsComponentExportConfiguration: msRest.CompositeMa } }, applicationName: { - readOnly: true, serializedName: "ApplicationName", + readOnly: true, type: { name: "String" } }, subscriptionId: { - readOnly: true, serializedName: "SubscriptionId", + readOnly: true, type: { name: "String" } }, resourceGroup: { - readOnly: true, serializedName: "ResourceGroup", + readOnly: true, type: { name: "String" } }, destinationStorageSubscriptionId: { - readOnly: true, serializedName: "DestinationStorageSubscriptionId", + readOnly: true, type: { name: "String" } }, destinationStorageLocationId: { - readOnly: true, serializedName: "DestinationStorageLocationId", + readOnly: true, type: { name: "String" } }, destinationAccountId: { - readOnly: true, serializedName: "DestinationAccountId", + readOnly: true, type: { name: "String" } }, destinationType: { - readOnly: true, serializedName: "DestinationType", + readOnly: true, type: { name: "String" } }, isUserEnabled: { - readOnly: true, serializedName: "IsUserEnabled", + readOnly: true, type: { name: "String" } }, lastUserUpdate: { - readOnly: true, serializedName: "LastUserUpdate", + readOnly: true, type: { name: "String" } @@ -439,43 +336,43 @@ export const ApplicationInsightsComponentExportConfiguration: msRest.CompositeMa } }, exportStatus: { - readOnly: true, serializedName: "ExportStatus", + readOnly: true, type: { name: "String" } }, lastSuccessTime: { - readOnly: true, serializedName: "LastSuccessTime", + readOnly: true, type: { name: "String" } }, lastGapTime: { - readOnly: true, serializedName: "LastGapTime", + readOnly: true, type: { name: "String" } }, permanentErrorReason: { - readOnly: true, serializedName: "PermanentErrorReason", + readOnly: true, type: { name: "String" } }, storageName: { - readOnly: true, serializedName: "StorageName", + readOnly: true, type: { name: "String" } }, containerName: { - readOnly: true, serializedName: "ContainerName", + readOnly: true, type: { name: "String" } @@ -484,56 +381,70 @@ export const ApplicationInsightsComponentExportConfiguration: msRest.CompositeMa } }; -export const ApplicationInsightsComponentDataVolumeCap: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentDataVolumeCap", +export const ApplicationInsightsComponentExportRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplicationInsightsComponentDataVolumeCap", + className: "ApplicationInsightsComponentExportRequest", modelProperties: { - cap: { - serializedName: "Cap", + recordTypes: { + serializedName: "RecordTypes", type: { - name: "Number" + name: "String" } }, - resetTime: { - readOnly: true, - serializedName: "ResetTime", + destinationType: { + serializedName: "DestinationType", type: { - name: "Number" + name: "String" } }, - warningThreshold: { - serializedName: "WarningThreshold", + destinationAddress: { + serializedName: "DestinationAddress", type: { - name: "Number" + name: "String" } }, - stopSendNotificationWhenHitThreshold: { - serializedName: "StopSendNotificationWhenHitThreshold", + isEnabled: { + serializedName: "IsEnabled", type: { - name: "Boolean" + name: "String" } }, - stopSendNotificationWhenHitCap: { - serializedName: "StopSendNotificationWhenHitCap", - type: { - name: "Boolean" + notificationQueueEnabled: { + serializedName: "NotificationQueueEnabled", + type: { + name: "String" } }, - maxHistoryCap: { - readOnly: true, - serializedName: "MaxHistoryCap", + notificationQueueUri: { + serializedName: "NotificationQueueUri", type: { - name: "Number" + name: "String" + } + }, + destinationStorageSubscriptionId: { + serializedName: "DestinationStorageSubscriptionId", + type: { + name: "String" + } + }, + destinationStorageLocationId: { + serializedName: "DestinationStorageLocationId", + type: { + name: "String" + } + }, + destinationAccountId: { + serializedName: "DestinationAccountId", + type: { + name: "String" } } } } }; -export const ApplicationInsightsComponentBillingFeatures: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentBillingFeatures", +export const ApplicationInsightsComponentBillingFeatures: coreClient.CompositeMapper = { type: { name: "Composite", className: "ApplicationInsightsComponentBillingFeatures", @@ -560,29 +471,75 @@ export const ApplicationInsightsComponentBillingFeatures: msRest.CompositeMapper } }; -export const ApplicationInsightsComponentQuotaStatus: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentQuotaStatus", +export const ApplicationInsightsComponentDataVolumeCap: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApplicationInsightsComponentDataVolumeCap", + modelProperties: { + cap: { + serializedName: "Cap", + type: { + name: "Number" + } + }, + resetTime: { + serializedName: "ResetTime", + readOnly: true, + type: { + name: "Number" + } + }, + warningThreshold: { + serializedName: "WarningThreshold", + type: { + name: "Number" + } + }, + stopSendNotificationWhenHitThreshold: { + serializedName: "StopSendNotificationWhenHitThreshold", + type: { + name: "Boolean" + } + }, + stopSendNotificationWhenHitCap: { + serializedName: "StopSendNotificationWhenHitCap", + type: { + name: "Boolean" + } + }, + maxHistoryCap: { + serializedName: "MaxHistoryCap", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ApplicationInsightsComponentQuotaStatus: coreClient.CompositeMapper = { type: { name: "Composite", className: "ApplicationInsightsComponentQuotaStatus", modelProperties: { appId: { - readOnly: true, serializedName: "AppId", + readOnly: true, type: { name: "String" } }, shouldBeThrottled: { - readOnly: true, serializedName: "ShouldBeThrottled", + readOnly: true, type: { name: "Boolean" } }, expirationTime: { - readOnly: true, serializedName: "ExpirationTime", + readOnly: true, type: { name: "String" } @@ -591,120 +548,119 @@ export const ApplicationInsightsComponentQuotaStatus: msRest.CompositeMapper = { } }; -export const ApplicationInsightsComponentFeatureCapabilities: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentFeatureCapabilities", +export const ApplicationInsightsComponentFeatureCapabilities: coreClient.CompositeMapper = { type: { name: "Composite", className: "ApplicationInsightsComponentFeatureCapabilities", modelProperties: { supportExportData: { - readOnly: true, serializedName: "SupportExportData", + readOnly: true, type: { name: "Boolean" } }, burstThrottlePolicy: { - readOnly: true, serializedName: "BurstThrottlePolicy", + readOnly: true, type: { name: "String" } }, metadataClass: { - readOnly: true, serializedName: "MetadataClass", + readOnly: true, type: { name: "String" } }, liveStreamMetrics: { - readOnly: true, serializedName: "LiveStreamMetrics", + readOnly: true, type: { name: "Boolean" } }, applicationMap: { - readOnly: true, serializedName: "ApplicationMap", + readOnly: true, type: { name: "Boolean" } }, workItemIntegration: { - readOnly: true, serializedName: "WorkItemIntegration", + readOnly: true, type: { name: "Boolean" } }, powerBIIntegration: { - readOnly: true, serializedName: "PowerBIIntegration", + readOnly: true, type: { name: "Boolean" } }, openSchema: { - readOnly: true, serializedName: "OpenSchema", + readOnly: true, type: { name: "Boolean" } }, proactiveDetection: { - readOnly: true, serializedName: "ProactiveDetection", + readOnly: true, type: { name: "Boolean" } }, analyticsIntegration: { - readOnly: true, serializedName: "AnalyticsIntegration", + readOnly: true, type: { name: "Boolean" } }, multipleStepWebTest: { - readOnly: true, serializedName: "MultipleStepWebTest", + readOnly: true, type: { name: "Boolean" } }, apiAccessLevel: { - readOnly: true, serializedName: "ApiAccessLevel", + readOnly: true, type: { name: "String" } }, trackingType: { - readOnly: true, serializedName: "TrackingType", + readOnly: true, type: { name: "String" } }, dailyCap: { - readOnly: true, serializedName: "DailyCap", + readOnly: true, type: { name: "Number" } }, dailyCapResetTime: { - readOnly: true, serializedName: "DailyCapResetTime", + readOnly: true, type: { name: "Number" } }, throttleRate: { - readOnly: true, serializedName: "ThrottleRate", + readOnly: true, type: { name: "Number" } @@ -713,102 +669,71 @@ export const ApplicationInsightsComponentFeatureCapabilities: msRest.CompositeMa } }; -export const ApplicationInsightsComponentFeatureCapability: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentFeatureCapability", +export const ApplicationInsightsComponentAvailableFeatures: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplicationInsightsComponentFeatureCapability", + className: "ApplicationInsightsComponentAvailableFeatures", modelProperties: { - name: { - readOnly: true, - serializedName: "Name", - type: { - name: "String" - } - }, - description: { - readOnly: true, - serializedName: "Description", - type: { - name: "String" - } - }, - value: { - readOnly: true, - serializedName: "Value", - type: { - name: "String" - } - }, - unit: { - readOnly: true, - serializedName: "Unit", - type: { - name: "String" - } - }, - meterId: { - readOnly: true, - serializedName: "MeterId", - type: { - name: "String" - } - }, - meterRateFrequency: { + result: { + serializedName: "Result", readOnly: true, - serializedName: "MeterRateFrequency", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplicationInsightsComponentFeature" + } + } } } } } }; -export const ApplicationInsightsComponentFeature: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentFeature", +export const ApplicationInsightsComponentFeature: coreClient.CompositeMapper = { type: { name: "Composite", className: "ApplicationInsightsComponentFeature", modelProperties: { featureName: { - readOnly: true, serializedName: "FeatureName", + readOnly: true, type: { name: "String" } }, meterId: { - readOnly: true, serializedName: "MeterId", + readOnly: true, type: { name: "String" } }, meterRateFrequency: { - readOnly: true, serializedName: "MeterRateFrequency", + readOnly: true, type: { name: "String" } }, resouceId: { - readOnly: true, serializedName: "ResouceId", + readOnly: true, type: { name: "String" } }, isHidden: { - readOnly: true, serializedName: "IsHidden", + readOnly: true, type: { name: "Boolean" } }, capabilities: { - readOnly: true, serializedName: "Capabilities", + readOnly: true, type: { name: "Sequence", element: { @@ -820,113 +745,82 @@ export const ApplicationInsightsComponentFeature: msRest.CompositeMapper = { } }, title: { - readOnly: true, serializedName: "Title", + readOnly: true, type: { name: "String" } }, isMainFeature: { - readOnly: true, serializedName: "IsMainFeature", + readOnly: true, type: { name: "Boolean" } }, supportedAddonFeatures: { - readOnly: true, serializedName: "SupportedAddonFeatures", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationInsightsComponentAvailableFeatures: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentAvailableFeatures", - type: { - name: "Composite", - className: "ApplicationInsightsComponentAvailableFeatures", - modelProperties: { - result: { readOnly: true, - serializedName: "Result", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationInsightsComponentFeature" - } - } + name: "String" } } } } }; -export const ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentProactiveDetectionConfiguration_RuleDefinitions", +export const ApplicationInsightsComponentFeatureCapability: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions", + className: "ApplicationInsightsComponentFeatureCapability", modelProperties: { name: { serializedName: "Name", - type: { - name: "String" - } - }, - displayName: { - serializedName: "DisplayName", + readOnly: true, type: { name: "String" } }, description: { serializedName: "Description", + readOnly: true, type: { name: "String" } }, - helpUrl: { - serializedName: "HelpUrl", + value: { + serializedName: "Value", + readOnly: true, type: { name: "String" } }, - isHidden: { - serializedName: "IsHidden", - type: { - name: "Boolean" - } - }, - isEnabledByDefault: { - serializedName: "IsEnabledByDefault", + unit: { + serializedName: "Unit", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - isInPreview: { - serializedName: "IsInPreview", + meterId: { + serializedName: "MeterId", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - supportsEmailNotifications: { - serializedName: "SupportsEmailNotifications", + meterRateFrequency: { + serializedName: "MeterRateFrequency", + readOnly: true, type: { - name: "Boolean" + name: "String" } } } } }; -export const ApplicationInsightsComponentProactiveDetectionConfiguration: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentProactiveDetectionConfiguration", +export const ApplicationInsightsComponentProactiveDetectionConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", className: "ApplicationInsightsComponentProactiveDetectionConfiguration", @@ -970,58 +864,98 @@ export const ApplicationInsightsComponentProactiveDetectionConfiguration: msRest serializedName: "RuleDefinitions", type: { name: "Composite", - className: "ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions" + className: + "ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions" } } } } }; -export const WorkItemConfiguration: msRest.CompositeMapper = { - serializedName: "WorkItemConfiguration", +export const ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WorkItemConfiguration", + className: + "ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions", modelProperties: { - connectorId: { - serializedName: "ConnectorId", + name: { + serializedName: "Name", type: { name: "String" } }, - configDisplayName: { - serializedName: "ConfigDisplayName", + displayName: { + serializedName: "DisplayName", type: { name: "String" } }, - isDefault: { - serializedName: "IsDefault", + description: { + serializedName: "Description", type: { - name: "Boolean" + name: "String" } }, - id: { - serializedName: "Id", + helpUrl: { + serializedName: "HelpUrl", type: { name: "String" } }, - configProperties: { - serializedName: "ConfigProperties", + isHidden: { + serializedName: "IsHidden", type: { - name: "String" + name: "Boolean" + } + }, + isEnabledByDefault: { + serializedName: "IsEnabledByDefault", + type: { + name: "Boolean" + } + }, + isInPreview: { + serializedName: "IsInPreview", + type: { + name: "Boolean" + } + }, + supportsEmailNotifications: { + serializedName: "SupportsEmailNotifications", + type: { + name: "Boolean" } } } } }; -export const WorkItemCreateConfiguration: msRest.CompositeMapper = { - serializedName: "WorkItemCreateConfiguration", +export const WorkItemConfigurationsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WorkItemCreateConfiguration", + className: "WorkItemConfigurationsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WorkItemConfiguration" + } + } + } + } + } + } +}; + +export const WorkItemConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkItemConfiguration", modelProperties: { connectorId: { serializedName: "ConnectorId", @@ -1029,35 +963,35 @@ export const WorkItemCreateConfiguration: msRest.CompositeMapper = { name: "String" } }, - connectorDataConfiguration: { - serializedName: "ConnectorDataConfiguration", + configDisplayName: { + serializedName: "ConfigDisplayName", type: { name: "String" } }, - validateOnly: { - serializedName: "ValidateOnly", + isDefault: { + serializedName: "IsDefault", type: { name: "Boolean" } }, - workItemProperties: { - serializedName: "WorkItemProperties", + id: { + serializedName: "Id", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" + } + }, + configProperties: { + serializedName: "ConfigProperties", + type: { + name: "String" } } } } }; -export const WorkItemConfigurationError: msRest.CompositeMapper = { - serializedName: "WorkItemConfigurationError", +export const WorkItemConfigurationError: coreClient.CompositeMapper = { type: { name: "Composite", className: "WorkItemConfigurationError", @@ -1085,8 +1019,41 @@ export const WorkItemConfigurationError: msRest.CompositeMapper = { } }; -export const ApplicationInsightsComponentFavorite: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentFavorite", +export const WorkItemCreateConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkItemCreateConfiguration", + modelProperties: { + connectorId: { + serializedName: "ConnectorId", + type: { + name: "String" + } + }, + connectorDataConfiguration: { + serializedName: "ConnectorDataConfiguration", + type: { + name: "String" + } + }, + validateOnly: { + serializedName: "ValidateOnly", + type: { + name: "Boolean" + } + }, + workItemProperties: { + serializedName: "WorkItemProperties", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ApplicationInsightsComponentFavorite: coreClient.CompositeMapper = { type: { name: "Composite", className: "ApplicationInsightsComponentFavorite", @@ -1110,8 +1077,8 @@ export const ApplicationInsightsComponentFavorite: msRest.CompositeMapper = { } }, favoriteId: { - readOnly: true, serializedName: "FavoriteId", + readOnly: true, type: { name: "String" } @@ -1120,10 +1087,7 @@ export const ApplicationInsightsComponentFavorite: msRest.CompositeMapper = { serializedName: "FavoriteType", type: { name: "Enum", - allowedValues: [ - "shared", - "user" - ] + allowedValues: ["shared", "user"] } }, sourceType: { @@ -1133,8 +1097,8 @@ export const ApplicationInsightsComponentFavorite: msRest.CompositeMapper = { } }, timeModified: { - readOnly: true, serializedName: "TimeModified", + readOnly: true, type: { name: "String" } @@ -1163,8 +1127,8 @@ export const ApplicationInsightsComponentFavorite: msRest.CompositeMapper = { } }, userId: { - readOnly: true, serializedName: "UserId", + readOnly: true, type: { name: "String" } @@ -1173,102 +1137,80 @@ export const ApplicationInsightsComponentFavorite: msRest.CompositeMapper = { } }; -export const ApplicationInsightsComponentWebTestLocation: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentWebTestLocation", +export const ApplicationInsightsWebTestLocationsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplicationInsightsComponentWebTestLocation", + className: "ApplicationInsightsWebTestLocationsListResult", modelProperties: { - displayName: { - readOnly: true, - serializedName: "DisplayName", - type: { - name: "String" - } - }, - tag: { - readOnly: true, - serializedName: "Tag", + value: { + serializedName: "value", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplicationInsightsComponentWebTestLocation" + } + } } } } } }; -export const WebtestsResource: msRest.CompositeMapper = { - serializedName: "WebtestsResource", +export const ApplicationInsightsComponentWebTestLocation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WebtestsResource", + className: "ApplicationInsightsComponentWebTestLocation", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { + displayName: { + serializedName: "DisplayName", readOnly: true, - serializedName: "name", type: { name: "String" } }, - type: { + tag: { + serializedName: "Tag", readOnly: true, - serializedName: "type", - type: { - name: "String" - } - }, - location: { - required: true, - serializedName: "location", type: { name: "String" } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } } } } }; -export const TagsResource: msRest.CompositeMapper = { - serializedName: "TagsResource", +export const WebTestListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TagsResource", + className: "WebTestListResult", modelProperties: { - tags: { - serializedName: "tags", + value: { + serializedName: "value", + required: true, type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "WebTest" } } } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } } } } }; -export const WebTestGeolocation: msRest.CompositeMapper = { - serializedName: "WebTestGeolocation", +export const WebTestGeolocation: coreClient.CompositeMapper = { type: { name: "Composite", className: "WebTestGeolocation", @@ -1283,8 +1225,7 @@ export const WebTestGeolocation: msRest.CompositeMapper = { } }; -export const WebTestPropertiesConfiguration: msRest.CompositeMapper = { - serializedName: "WebTestProperties_Configuration", +export const WebTestPropertiesConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", className: "WebTestPropertiesConfiguration", @@ -1299,131 +1240,67 @@ export const WebTestPropertiesConfiguration: msRest.CompositeMapper = { } }; -export const WebTest: msRest.CompositeMapper = { - serializedName: "WebTest", +export const WebtestsResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WebTest", + className: "WebtestsResource", modelProperties: { - ...WebtestsResource.type.modelProperties, - kind: { - serializedName: "kind", - defaultValue: 'ping', - type: { - name: "Enum", - allowedValues: [ - "ping", - "multistep" - ] - } - }, - syntheticMonitorId: { - required: true, - serializedName: "properties.SyntheticMonitorId", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - webTestName: { - required: true, - serializedName: "properties.Name", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - description: { - serializedName: "properties.Description", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - enabled: { - serializedName: "properties.Enabled", + location: { + serializedName: "location", + required: true, type: { - name: "Boolean" + name: "String" } }, - frequency: { - serializedName: "properties.Frequency", - defaultValue: 300, + tags: { + serializedName: "tags", type: { - name: "Number" + name: "Dictionary", + value: { type: { name: "String" } } } - }, - timeout: { - serializedName: "properties.Timeout", - defaultValue: 30, + } + } + } +}; + +export const TagsResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsResource", + modelProperties: { + tags: { + serializedName: "tags", type: { - name: "Number" - } - }, - webTestKind: { - required: true, - serializedName: "properties.Kind", - defaultValue: 'ping', - type: { - name: "Enum", - allowedValues: [ - "ping", - "multistep" - ] - } - }, - retryEnabled: { - serializedName: "properties.RetryEnabled", - type: { - name: "Boolean" - } - }, - locations: { - required: true, - serializedName: "properties.Locations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WebTestGeolocation" - } - } - } - }, - configuration: { - serializedName: "properties.Configuration", - type: { - name: "Composite", - className: "WebTestPropertiesConfiguration" - } - }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationInsightsComponentAnalyticsItemProperties: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentAnalyticsItemProperties", - type: { - name: "Composite", - className: "ApplicationInsightsComponentAnalyticsItemProperties", - modelProperties: { - functionAlias: { - serializedName: "functionAlias", - type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const ApplicationInsightsComponentAnalyticsItem: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentAnalyticsItem", +export const ApplicationInsightsComponentAnalyticsItem: coreClient.CompositeMapper = { type: { name: "Composite", className: "ApplicationInsightsComponentAnalyticsItem", @@ -1447,8 +1324,8 @@ export const ApplicationInsightsComponentAnalyticsItem: msRest.CompositeMapper = } }, version: { - readOnly: true, serializedName: "Version", + readOnly: true, type: { name: "String" } @@ -1466,15 +1343,15 @@ export const ApplicationInsightsComponentAnalyticsItem: msRest.CompositeMapper = } }, timeCreated: { - readOnly: true, serializedName: "TimeCreated", + readOnly: true, type: { name: "String" } }, timeModified: { - readOnly: true, serializedName: "TimeModified", + readOnly: true, type: { name: "String" } @@ -1490,46 +1367,34 @@ export const ApplicationInsightsComponentAnalyticsItem: msRest.CompositeMapper = } }; -export const WorkbookResource: msRest.CompositeMapper = { - serializedName: "WorkbookResource", +export const ApplicationInsightsComponentAnalyticsItemProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WorkbookResource", + className: "ApplicationInsightsComponentAnalyticsItemProperties", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } - }, - location: { - serializedName: "location", + functionAlias: { + serializedName: "functionAlias", type: { name: "String" } - }, - tags: { - serializedName: "tags", + } + } + } +}; + +export const WorkbookTemplatesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbookTemplatesListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "WorkbookTemplate" } } } @@ -1538,129 +1403,137 @@ export const WorkbookResource: msRest.CompositeMapper = { } }; -export const Workbook: msRest.CompositeMapper = { - serializedName: "Workbook", +export const WorkbookTemplateGallery: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Workbook", + className: "WorkbookTemplateGallery", modelProperties: { - ...WorkbookResource.type.modelProperties, - kind: { - serializedName: "kind", + name: { + serializedName: "name", type: { name: "String" } }, - workbookName: { - required: true, - serializedName: "properties.name", + category: { + serializedName: "category", type: { name: "String" } }, - serializedData: { - required: true, - serializedName: "properties.serializedData", + type: { + serializedName: "type", type: { name: "String" } }, - version: { - serializedName: "properties.version", + order: { + serializedName: "order", type: { - name: "String" + name: "Number" } }, - workbookId: { - required: true, - serializedName: "properties.workbookId", + resourceType: { + serializedName: "resourceType", type: { name: "String" } - }, - sharedTypeKind: { - required: true, - serializedName: "properties.kind", - defaultValue: 'shared', + } + } + } +}; + +export const WorkbookTemplateLocalizedGallery: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbookTemplateLocalizedGallery", + modelProperties: { + templateData: { + serializedName: "templateData", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } }, - timeModified: { + galleries: { + serializedName: "galleries", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WorkbookTemplateGallery" + } + } + } + } + } + } +}; + +export const WorkbookTemplateResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbookTemplateResource", + modelProperties: { + id: { + serializedName: "id", readOnly: true, - serializedName: "properties.timeModified", type: { name: "String" } }, - category: { - required: true, - serializedName: "properties.category", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - workbookTags: { - serializedName: "properties.tags", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - userId: { + location: { + serializedName: "location", required: true, - serializedName: "properties.userId", type: { name: "String" } }, - sourceResourceId: { - serializedName: "properties.sourceResourceId", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const LinkProperties: msRest.CompositeMapper = { - serializedName: "LinkProperties", +export const WorkbookTemplateError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LinkProperties", + className: "WorkbookTemplateError", modelProperties: { - sourceId: { - serializedName: "sourceId", - type: { - name: "String" - } - }, - targetId: { - serializedName: "targetId", - type: { - name: "String" - } - }, - category: { - serializedName: "category", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "WorkbookTemplateErrorBody" } } } } }; -export const ErrorFieldContract: msRest.CompositeMapper = { - serializedName: "ErrorFieldContract", +export const WorkbookTemplateErrorBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorFieldContract", + className: "WorkbookTemplateErrorBody", modelProperties: { code: { serializedName: "code", @@ -1674,21 +1547,26 @@ export const ErrorFieldContract: msRest.CompositeMapper = { name: "String" } }, - target: { - serializedName: "target", + details: { + serializedName: "details", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WorkbookTemplateErrorFieldContract" + } + } } } } } }; -export const WorkbookError: msRest.CompositeMapper = { - serializedName: "WorkbookError", +export const WorkbookTemplateErrorFieldContract: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WorkbookError", + className: "WorkbookTemplateErrorFieldContract", modelProperties: { code: { serializedName: "code", @@ -1702,59 +1580,72 @@ export const WorkbookError: msRest.CompositeMapper = { name: "String" } }, - details: { - serializedName: "details", + target: { + serializedName: "target", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorFieldContract" - } - } + name: "String" } } } } }; -export const MyWorkbookResource: msRest.CompositeMapper = { - serializedName: "MyWorkbookResource", +export const WorkbookTemplateUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MyWorkbookResource", + className: "WorkbookTemplateUpdateParameters", modelProperties: { - id: { - serializedName: "id", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - name: { - serializedName: "name", + priority: { + serializedName: "properties.priority", type: { - name: "String" + name: "Number" } }, - type: { - serializedName: "type", + author: { + serializedName: "properties.author", type: { name: "String" } }, - location: { - serializedName: "location", + templateData: { + serializedName: "properties.templateData", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } }, - tags: { - serializedName: "tags", + galleries: { + serializedName: "properties.galleries", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WorkbookTemplateGallery" + } + } + } + }, + localized: { + serializedName: "properties.localized", type: { name: "Dictionary", value: { type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WorkbookTemplateLocalizedGallery" + } + } } } } @@ -1763,73 +1654,26 @@ export const MyWorkbookResource: msRest.CompositeMapper = { } }; -export const MyWorkbook: msRest.CompositeMapper = { - serializedName: "MyWorkbook", +export const MyWorkbooksListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MyWorkbook", + className: "MyWorkbooksListResult", modelProperties: { - ...MyWorkbookResource.type.modelProperties, - kind: { - serializedName: "kind", - type: { - name: "String" - } - }, - displayName: { - required: true, - serializedName: "properties.displayName", - type: { - name: "String" - } - }, - serializedData: { - required: true, - serializedName: "properties.serializedData", - type: { - name: "String" - } - }, - version: { - serializedName: "properties.version", - type: { - name: "String" - } - }, - timeModified: { - readOnly: true, - serializedName: "properties.timeModified", - type: { - name: "String" - } - }, - category: { - required: true, - serializedName: "properties.category", - type: { - name: "String" - } - }, - myWorkbookTags: { - serializedName: "properties.tags", + value: { + serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "MyWorkbook" } } } }, - userId: { - readOnly: true, - serializedName: "properties.userId", - type: { - name: "String" - } - }, - sourceId: { - serializedName: "properties.sourceId", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -1838,69 +1682,82 @@ export const MyWorkbook: msRest.CompositeMapper = { } }; -export const MyWorkbookError: msRest.CompositeMapper = { - serializedName: "MyWorkbookError", +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MyWorkbookError", + className: "SystemData", modelProperties: { - code: { - serializedName: "code", + createdBy: { + serializedName: "createdBy", type: { name: "String" } }, - message: { - serializedName: "message", + createdByType: { + serializedName: "createdByType", type: { name: "String" } }, - details: { - serializedName: "details", + createdAt: { + serializedName: "createdAt", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorFieldContract" - } - } + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" } } } } }; -export const ComponentsResource: msRest.CompositeMapper = { - serializedName: "ComponentsResource", +export const MyWorkbookResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ComponentsResource", + className: "MyWorkbookResource", modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "MyWorkbookManagedIdentity" + } + }, id: { - readOnly: true, serializedName: "id", type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", type: { name: "String" } }, location: { - required: true, serializedName: "location", type: { name: "String" @@ -1910,31 +1767,34 @@ export const ComponentsResource: msRest.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } + } + }, + etag: { + serializedName: "etag", + type: { + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const PrivateLinkScopedResource: msRest.CompositeMapper = { - serializedName: "PrivateLinkScopedResource", +export const MyWorkbookManagedIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkScopedResource", + className: "MyWorkbookManagedIdentity", modelProperties: { - resourceId: { - serializedName: "ResourceId", + userAssignedIdentities: { + serializedName: "userAssignedIdentities", type: { - name: "String" + name: "Composite", + className: "MyWorkbookUserAssignedIdentities" } }, - scopeId: { - serializedName: "ScopeId", + type: { + serializedName: "type", type: { name: "String" } @@ -1943,240 +1803,326 @@ export const PrivateLinkScopedResource: msRest.CompositeMapper = { } }; -export const ApplicationInsightsComponent: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponent", +export const MyWorkbookUserAssignedIdentities: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplicationInsightsComponent", + className: "MyWorkbookUserAssignedIdentities", modelProperties: { - ...ComponentsResource.type.modelProperties, - kind: { - required: true, - serializedName: "kind", + principalId: { + serializedName: "principalId", + readOnly: true, type: { name: "String" } }, - applicationId: { + tenantId: { + serializedName: "tenantId", readOnly: true, - serializedName: "properties.ApplicationId", type: { name: "String" } - }, - appId: { + } + } + } +}; + +export const MyWorkbookError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MyWorkbookError", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDefinition" + } + } + } + } +}; + +export const ErrorDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDefinition", + modelProperties: { + code: { + serializedName: "code", readOnly: true, - serializedName: "properties.AppId", type: { name: "String" } }, - applicationType: { - required: true, - serializedName: "properties.Application_Type", - defaultValue: 'web', + message: { + serializedName: "message", + readOnly: true, type: { name: "String" } }, - flowType: { - serializedName: "properties.Flow_Type", - defaultValue: 'Bluefield', + innererror: { + serializedName: "innererror", + readOnly: true, type: { - name: "String" + name: "any" } - }, - requestSource: { - serializedName: "properties.Request_Source", - defaultValue: 'rest', + } + } + } +}; + +export const WorkbooksListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbooksListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Workbook" + } + } } }, - instrumentationKey: { - readOnly: true, - serializedName: "properties.InstrumentationKey", + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - creationDate: { + } + } + } +}; + +export const ManagedServiceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedServiceIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", readOnly: true, - serializedName: "properties.CreationDate", type: { - name: "DateTime" + name: "Uuid" } }, tenantId: { + serializedName: "tenantId", readOnly: true, - serializedName: "properties.TenantId", type: { - name: "String" + name: "Uuid" } }, - hockeyAppId: { - serializedName: "properties.HockeyAppId", + type: { + serializedName: "type", + required: true, type: { name: "String" } }, - hockeyAppToken: { - readOnly: true, - serializedName: "properties.HockeyAppToken", + userAssignedIdentities: { + serializedName: "userAssignedIdentities", type: { - name: "String" + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } } - }, - provisioningState: { + } + } + } +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", readOnly: true, - serializedName: "properties.provisioningState", type: { - name: "String" + name: "Uuid" } }, - samplingPercentage: { - serializedName: "properties.SamplingPercentage", + clientId: { + serializedName: "clientId", + readOnly: true, type: { - name: "Number" + name: "Uuid" } - }, - connectionString: { + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", readOnly: true, - serializedName: "properties.ConnectionString", type: { name: "String" } }, - retentionInDays: { - serializedName: "properties.RetentionInDays", - defaultValue: 90, - type: { - name: "Number" - } - }, - disableIpMasking: { - serializedName: "properties.DisableIpMasking", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - immediatePurgeDataOn30Days: { - serializedName: "properties.ImmediatePurgeDataOn30Days", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Boolean" + name: "String" } - }, - privateLinkScopedResources: { - readOnly: true, - serializedName: "properties.PrivateLinkScopedResources", + } + } + } +}; + +export const WorkbookError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbookError", + modelProperties: { + error: { + serializedName: "error", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateLinkScopedResource" - } - } + name: "Composite", + className: "WorkbookErrorDefinition" } - }, - publicNetworkAccessForIngestion: { - serializedName: "properties.publicNetworkAccessForIngestion", - defaultValue: 'Enabled', + } + } + } +}; + +export const WorkbookErrorDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbookErrorDefinition", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, type: { name: "String" } }, - publicNetworkAccessForQuery: { - serializedName: "properties.publicNetworkAccessForQuery", - defaultValue: 'Enabled', + message: { + serializedName: "message", + readOnly: true, type: { name: "String" } }, - ingestionMode: { - serializedName: "properties.IngestionMode", - defaultValue: 'ApplicationInsights', + innerError: { + serializedName: "innerError", + readOnly: true, type: { - name: "String" + name: "any" } } } } }; -export const ComponentPurgeBodyFilters: msRest.CompositeMapper = { - serializedName: "ComponentPurgeBodyFilters", +export const WorkbookUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ComponentPurgeBodyFilters", + className: "WorkbookUpdateParameters", modelProperties: { - column: { - serializedName: "column", + kind: { + serializedName: "kind", type: { name: "String" } }, - operator: { - serializedName: "operator", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - value: { - serializedName: "value", + displayName: { + serializedName: "properties.displayName", type: { - name: "Object" + name: "String" } }, - key: { - serializedName: "key", + serializedData: { + serializedName: "properties.serializedData", type: { name: "String" } - } - } - } -}; - -export const ComponentPurgeBody: msRest.CompositeMapper = { - serializedName: "ComponentPurgeBody", - type: { - name: "Composite", - className: "ComponentPurgeBody", - modelProperties: { - table: { - required: true, - serializedName: "table", + }, + category: { + serializedName: "properties.category", type: { name: "String" } }, - filters: { - required: true, - serializedName: "filters", + tagsPropertiesTags: { + serializedName: "properties.tags", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "ComponentPurgeBodyFilters" + name: "String" } } } + }, + description: { + serializedName: "properties.description", + nullable: true, + type: { + name: "String" + } + }, + revision: { + serializedName: "properties.revision", + nullable: true, + type: { + name: "String" + } } } } }; -export const ComponentPurgeResponse: msRest.CompositeMapper = { - serializedName: "ComponentPurgeResponse", +export const ApplicationInsightsComponentListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ComponentPurgeResponse", + className: "ApplicationInsightsComponentListResult", modelProperties: { - operationId: { + value: { + serializedName: "value", required: true, - serializedName: "operationId", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplicationInsightsComponent" + } + } + } + }, + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -2185,15 +2131,19 @@ export const ComponentPurgeResponse: msRest.CompositeMapper = { } }; -export const ComponentPurgeStatusResponse: msRest.CompositeMapper = { - serializedName: "ComponentPurgeStatusResponse", +export const PrivateLinkScopedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ComponentPurgeStatusResponse", + className: "PrivateLinkScopedResource", modelProperties: { - status: { - required: true, - serializedName: "status", + resourceId: { + serializedName: "ResourceId", + type: { + name: "String" + } + }, + scopeId: { + serializedName: "ScopeId", type: { name: "String" } @@ -2202,73 +2152,104 @@ export const ComponentPurgeStatusResponse: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const ComponentsResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ComponentsResource", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + required: true, type: { name: "String" } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } } } } }; -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties - } - } -}; - -export const ComponentLinkedStorageAccounts: msRest.CompositeMapper = { - serializedName: "ComponentLinkedStorageAccounts", +export const ComponentPurgeBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ComponentLinkedStorageAccounts", + className: "ComponentPurgeBody", modelProperties: { - ...ProxyResource.type.modelProperties, - linkedStorageAccount: { - serializedName: "properties.linkedStorageAccount", + table: { + serializedName: "table", + required: true, type: { name: "String" } + }, + filters: { + serializedName: "filters", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ComponentPurgeBodyFilters" + } + } + } } } } }; -export const ComponentLinkedStorageAccountsPatch: msRest.CompositeMapper = { - serializedName: "ComponentLinkedStorageAccountsPatch", +export const ComponentPurgeBodyFilters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ComponentLinkedStorageAccountsPatch", + className: "ComponentPurgeBodyFilters", modelProperties: { - linkedStorageAccount: { - serializedName: "properties.linkedStorageAccount", + column: { + serializedName: "column", + type: { + name: "String" + } + }, + operator: { + serializedName: "operator", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "any" + } + }, + key: { + serializedName: "key", type: { name: "String" } @@ -2277,27 +2258,14 @@ export const ComponentLinkedStorageAccountsPatch: msRest.CompositeMapper = { } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const ComponentPurgeResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "ComponentPurgeResponse", modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - location: { + operationId: { + serializedName: "operationId", required: true, - serializedName: "location", type: { name: "String" } @@ -2306,16 +2274,14 @@ export const TrackedResource: msRest.CompositeMapper = { } }; -export const AzureEntityResource: msRest.CompositeMapper = { - serializedName: "AzureEntityResource", +export const ComponentPurgeStatusResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureEntityResource", + className: "ComponentPurgeStatusResponse", modelProperties: { - ...Resource.type.modelProperties, - etag: { - readOnly: true, - serializedName: "etag", + status: { + serializedName: "status", + required: true, type: { name: "String" } @@ -2324,49 +2290,37 @@ export const AzureEntityResource: msRest.CompositeMapper = { } }; -export const LiveTokenResponse: msRest.CompositeMapper = { - serializedName: "LiveTokenResponse", +export const ErrorResponseLinkedStorage: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LiveTokenResponse", + className: "ErrorResponseLinkedStorage", modelProperties: { - liveToken: { - readOnly: true, - serializedName: "liveToken", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "ErrorResponseLinkedStorageError" } } } } }; -export const OperationInfo: msRest.CompositeMapper = { - serializedName: "OperationInfo", +export const ErrorResponseLinkedStorageError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationInfo", + className: "ErrorResponseLinkedStorageError", modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", + code: { + serializedName: "code", + readOnly: true, type: { name: "String" } }, - description: { - serializedName: "description", + message: { + serializedName: "message", + readOnly: true, type: { name: "String" } @@ -2375,13 +2329,54 @@ export const OperationInfo: msRest.CompositeMapper = { } }; -export const OperationLive: msRest.CompositeMapper = { - serializedName: "OperationLive", +export const ComponentLinkedStorageAccountsPatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationLive", + className: "ComponentLinkedStorageAccountsPatch", modelProperties: { - name: { + linkedStorageAccount: { + serializedName: "properties.linkedStorageAccount", + type: { + name: "String" + } + } + } + } +}; + +export const OperationsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationLive" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationLive: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationLive", + modelProperties: { + name: { serializedName: "name", type: { name: "String" @@ -2403,61 +2398,39 @@ export const OperationLive: msRest.CompositeMapper = { properties: { serializedName: "properties", type: { - name: "Object" + name: "Dictionary", + value: { type: { name: "any" } } } } } } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const OperationInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "OperationInfo", modelProperties: { - value: { - serializedName: "", + provider: { + serializedName: "provider", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + resource: { + serializedName: "resource", type: { name: "String" } - } - } - } -}; - -export const OperationsListResult: msRest.CompositeMapper = { - serializedName: "OperationsListResult", - type: { - name: "Composite", - className: "OperationsListResult", - modelProperties: { - value: { - serializedName: "", + }, + operation: { + serializedName: "operation", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationLive" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + description: { + serializedName: "description", type: { name: "String" } @@ -2466,113 +2439,105 @@ export const OperationsListResult: msRest.CompositeMapper = { } }; -export const AnnotationsListResult: msRest.CompositeMapper = { - serializedName: "AnnotationsListResult", +export const LiveTokenResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AnnotationsListResult", + className: "LiveTokenResponse", modelProperties: { - value: { + liveToken: { + serializedName: "liveToken", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Annotation" - } - } + name: "String" } } } } }; -export const ApplicationInsightsComponentAPIKeyListResult: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentAPIKeyListResult", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplicationInsightsComponentAPIKeyListResult", + className: "ErrorResponse", modelProperties: { - value: { - required: true, - serializedName: "", + code: { + serializedName: "code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationInsightsComponentAPIKey" - } - } + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" } } } } }; -export const WorkItemConfigurationsListResult: msRest.CompositeMapper = { - serializedName: "WorkItemConfigurationsListResult", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WorkItemConfigurationsListResult", + className: "Operation", modelProperties: { - value: { - readOnly: true, - serializedName: "", + name: { + serializedName: "name", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WorkItemConfiguration" - } - } + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" } } } } }; -export const ApplicationInsightsWebTestLocationsListResult: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsWebTestLocationsListResult", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplicationInsightsWebTestLocationsListResult", + className: "OperationDisplay", modelProperties: { - value: { - required: true, - serializedName: "", + provider: { + serializedName: "provider", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationInsightsComponentWebTestLocation" - } - } + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" } } } } }; -export const WebTestListResult: msRest.CompositeMapper = { - serializedName: "webTestListResult", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WebTestListResult", + className: "OperationListResult", modelProperties: { value: { - required: true, - serializedName: "", + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "WebTest" + className: "Operation" } } } @@ -2587,21 +2552,19 @@ export const WebTestListResult: msRest.CompositeMapper = { } }; -export const WorkbooksListResult: msRest.CompositeMapper = { - serializedName: "WorkbooksListResult", +export const InnerErrorTrace: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WorkbooksListResult", + className: "InnerErrorTrace", modelProperties: { - value: { + trace: { + serializedName: "trace", readOnly: true, - serializedName: "", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Workbook" + name: "String" } } } @@ -2610,21 +2573,19 @@ export const WorkbooksListResult: msRest.CompositeMapper = { } }; -export const MyWorkbooksListResult: msRest.CompositeMapper = { - serializedName: "MyWorkbooksListResult", +export const WorkbookInnerErrorTrace: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MyWorkbooksListResult", + className: "WorkbookInnerErrorTrace", modelProperties: { - value: { + trace: { + serializedName: "trace", readOnly: true, - serializedName: "", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "MyWorkbook" + name: "String" } } } @@ -2633,27 +2594,579 @@ export const MyWorkbooksListResult: msRest.CompositeMapper = { } }; -export const ApplicationInsightsComponentListResult: msRest.CompositeMapper = { - serializedName: "ApplicationInsightsComponentListResult", +export const WebTest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplicationInsightsComponentListResult", + className: "WebTest", modelProperties: { - value: { - required: true, - serializedName: "", + ...WebtestsResource.type.modelProperties, + kind: { + serializedName: "kind", + type: { + name: "Enum", + allowedValues: ["ping", "multistep"] + } + }, + syntheticMonitorId: { + serializedName: "properties.SyntheticMonitorId", + type: { + name: "String" + } + }, + webTestName: { + serializedName: "properties.Name", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.Description", + type: { + name: "String" + } + }, + enabled: { + serializedName: "properties.Enabled", + type: { + name: "Boolean" + } + }, + frequency: { + defaultValue: 300, + serializedName: "properties.Frequency", + type: { + name: "Number" + } + }, + timeout: { + defaultValue: 30, + serializedName: "properties.Timeout", + type: { + name: "Number" + } + }, + webTestKind: { + serializedName: "properties.Kind", + type: { + name: "Enum", + allowedValues: ["ping", "multistep"] + } + }, + retryEnabled: { + serializedName: "properties.RetryEnabled", + type: { + name: "Boolean" + } + }, + locations: { + serializedName: "properties.Locations", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ApplicationInsightsComponent" + className: "WebTestGeolocation" } } } }, - nextLink: { - serializedName: "nextLink", + configuration: { + serializedName: "properties.Configuration", + type: { + name: "Composite", + className: "WebTestPropertiesConfiguration" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const WorkbookTemplate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbookTemplate", + modelProperties: { + ...WorkbookTemplateResource.type.modelProperties, + priority: { + serializedName: "properties.priority", + type: { + name: "Number" + } + }, + author: { + serializedName: "properties.author", + type: { + name: "String" + } + }, + templateData: { + serializedName: "properties.templateData", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + galleries: { + serializedName: "properties.galleries", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WorkbookTemplateGallery" + } + } + } + }, + localized: { + serializedName: "properties.localized", + type: { + name: "Dictionary", + value: { + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WorkbookTemplateLocalizedGallery" + } + } + } + } + } + } + } + } +}; + +export const MyWorkbook: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MyWorkbook", + modelProperties: { + ...MyWorkbookResource.type.modelProperties, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + serializedData: { + serializedName: "properties.serializedData", + nullable: true, + type: { + name: "String" + } + }, + version: { + serializedName: "properties.version", + type: { + name: "String" + } + }, + timeModified: { + serializedName: "properties.timeModified", + readOnly: true, + type: { + name: "String" + } + }, + category: { + serializedName: "properties.category", + type: { + name: "String" + } + }, + tagsPropertiesTags: { + serializedName: "properties.tags", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + userId: { + serializedName: "properties.userId", + readOnly: true, + type: { + name: "String" + } + }, + sourceId: { + serializedName: "properties.sourceId", + type: { + name: "String" + } + }, + storageUri: { + serializedName: "properties.storageUri", + nullable: true, + type: { + name: "String" + } + } + } + } +}; + +export const WorkbookResourceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbookResourceIdentity", + modelProperties: { + ...ManagedServiceIdentity.type.modelProperties + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const ApplicationInsightsComponent: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApplicationInsightsComponent", + modelProperties: { + ...ComponentsResource.type.modelProperties, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" + } + }, + applicationId: { + serializedName: "properties.ApplicationId", + readOnly: true, + type: { + name: "String" + } + }, + appId: { + serializedName: "properties.AppId", + readOnly: true, + type: { + name: "String" + } + }, + applicationType: { + defaultValue: "web", + serializedName: "properties.Application_Type", + type: { + name: "String" + } + }, + flowType: { + defaultValue: "Bluefield", + serializedName: "properties.Flow_Type", + type: { + name: "String" + } + }, + requestSource: { + defaultValue: "rest", + serializedName: "properties.Request_Source", + type: { + name: "String" + } + }, + instrumentationKey: { + serializedName: "properties.InstrumentationKey", + readOnly: true, + type: { + name: "String" + } + }, + creationDate: { + serializedName: "properties.CreationDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + tenantId: { + serializedName: "properties.TenantId", + readOnly: true, + type: { + name: "String" + } + }, + hockeyAppId: { + serializedName: "properties.HockeyAppId", + type: { + name: "String" + } + }, + hockeyAppToken: { + serializedName: "properties.HockeyAppToken", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + samplingPercentage: { + serializedName: "properties.SamplingPercentage", + type: { + name: "Number" + } + }, + connectionString: { + serializedName: "properties.ConnectionString", + readOnly: true, + type: { + name: "String" + } + }, + retentionInDays: { + defaultValue: 90, + serializedName: "properties.RetentionInDays", + type: { + name: "Number" + } + }, + disableIpMasking: { + serializedName: "properties.DisableIpMasking", + type: { + name: "Boolean" + } + }, + immediatePurgeDataOn30Days: { + serializedName: "properties.ImmediatePurgeDataOn30Days", + type: { + name: "Boolean" + } + }, + privateLinkScopedResources: { + serializedName: "properties.PrivateLinkScopedResources", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkScopedResource" + } + } + } + }, + publicNetworkAccessForIngestion: { + defaultValue: "Enabled", + serializedName: "properties.publicNetworkAccessForIngestion", + type: { + name: "String" + } + }, + publicNetworkAccessForQuery: { + defaultValue: "Enabled", + serializedName: "properties.publicNetworkAccessForQuery", + type: { + name: "String" + } + }, + ingestionMode: { + defaultValue: "ApplicationInsights", + serializedName: "properties.IngestionMode", + type: { + name: "String" + } + } + } + } +}; + +export const WorkbookResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbookResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "WorkbookResourceIdentity" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const ComponentLinkedStorageAccounts: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ComponentLinkedStorageAccounts", + modelProperties: { + ...ProxyResource.type.modelProperties, + linkedStorageAccount: { + serializedName: "properties.linkedStorageAccount", + type: { + name: "String" + } + } + } + } +}; + +export const Workbook: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Workbook", + modelProperties: { + ...WorkbookResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + serializedData: { + serializedName: "properties.serializedData", + nullable: true, + type: { + name: "String" + } + }, + version: { + serializedName: "properties.version", + type: { + name: "String" + } + }, + timeModified: { + serializedName: "properties.timeModified", + readOnly: true, + type: { + name: "DateTime" + } + }, + category: { + serializedName: "properties.category", + type: { + name: "String" + } + }, + tagsPropertiesTags: { + serializedName: "properties.tags", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + userId: { + serializedName: "properties.userId", + readOnly: true, + type: { + name: "String" + } + }, + sourceId: { + serializedName: "properties.sourceId", + type: { + name: "String" + } + }, + storageUri: { + serializedName: "properties.storageUri", + nullable: true, + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + nullable: true, + type: { + name: "String" + } + }, + revision: { + serializedName: "properties.revision", + readOnly: true, + nullable: true, type: { name: "String" } diff --git a/sdk/applicationinsights/arm-appinsights/src/models/myWorkbooksMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/myWorkbooksMappers.ts deleted file mode 100644 index 10b24a7aaea7..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/myWorkbooksMappers.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponent, - ApplicationInsightsComponentProactiveDetectionConfiguration, - ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, - AzureEntityResource, - BaseResource, - ComponentLinkedStorageAccounts, - ComponentsResource, - ErrorFieldContract, - MyWorkbook, - MyWorkbookError, - MyWorkbookResource, - MyWorkbooksListResult, - PrivateLinkScopedResource, - ProxyResource, - Resource, - TrackedResource, - WebTest, - WebTestGeolocation, - WebTestPropertiesConfiguration, - WebtestsResource, - Workbook, - WorkbookResource -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/operationsMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/operationsMappers.ts deleted file mode 100644 index cdf9b64cd39d..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/operationsMappers.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CloudError, - ErrorResponse, - Operation, - OperationDisplay, - OperationInfo, - OperationListResult, - OperationLive, - OperationsListResult -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/parameters.ts b/sdk/applicationinsights/arm-appinsights/src/models/parameters.ts index 6e3e12a770dc..ee1eede7e29b 100644 --- a/sdk/applicationinsights/arm-appinsights/src/models/parameters.ts +++ b/sdk/applicationinsights/arm-appinsights/src/models/parameters.ts @@ -1,417 +1,601 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + Annotation as AnnotationMapper, + APIKeyRequest as APIKeyRequestMapper, + ApplicationInsightsComponentExportRequest as ApplicationInsightsComponentExportRequestMapper, + ApplicationInsightsComponentBillingFeatures as ApplicationInsightsComponentBillingFeaturesMapper, + ApplicationInsightsComponentProactiveDetectionConfiguration as ApplicationInsightsComponentProactiveDetectionConfigurationMapper, + WorkItemCreateConfiguration as WorkItemCreateConfigurationMapper, + ApplicationInsightsComponentFavorite as ApplicationInsightsComponentFavoriteMapper, + WebTest as WebTestMapper, + TagsResource as TagsResourceMapper, + ApplicationInsightsComponentAnalyticsItem as ApplicationInsightsComponentAnalyticsItemMapper, + WorkbookTemplate as WorkbookTemplateMapper, + WorkbookTemplateUpdateParameters as WorkbookTemplateUpdateParametersMapper, + MyWorkbook as MyWorkbookMapper, + Workbook as WorkbookMapper, + WorkbookUpdateParameters as WorkbookUpdateParametersMapper, + ApplicationInsightsComponent as ApplicationInsightsComponentMapper, + ComponentPurgeBody as ComponentPurgeBodyMapper, + ComponentLinkedStorageAccounts as ComponentLinkedStorageAccountsMapper, + ComponentLinkedStorageAccountsPatch as ComponentLinkedStorageAccountsPatchMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const annotationId: msRest.OperationURLParameter = { - parameterPath: "annotationId", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "annotationId", type: { name: "String" } - } + }, + skipEncoding: true }; -export const apiVersion0: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { - required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2015-05-01', constraints: { + MaxLength: 90, MinLength: 1 }, + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const apiVersion1: msRest.OperationQueryParameter = { + +export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - required: true, + defaultValue: "2015-05-01", isConstant: true, serializedName: "api-version", - defaultValue: '2020-06-02-preview', - constraints: { - MinLength: 1 - }, type: { name: "String" } } }; -export const apiVersion2: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { - required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2018-05-01-preview', constraints: { MinLength: 1 }, + serializedName: "subscriptionId", + required: true, type: { name: "String" } } }; -export const apiVersion3: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const resourceName: OperationURLParameter = { + parameterPath: "resourceName", mapper: { + serializedName: "resourceName", required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2020-03-01-preview', - constraints: { - MinLength: 1 - }, type: { name: "String" } } }; -export const canFetchContent: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "canFetchContent" - ], + +export const start: OperationQueryParameter = { + parameterPath: "start", mapper: { - serializedName: "canFetchContent", + serializedName: "start", + required: true, type: { - name: "Boolean" + name: "String" } } }; -export const category: msRest.OperationQueryParameter = { - parameterPath: "category", + +export const end: OperationQueryParameter = { + parameterPath: "end", mapper: { + serializedName: "end", required: true, - serializedName: "category", type: { name: "String" } } }; -export const componentName: msRest.OperationURLParameter = { - parameterPath: "componentName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "componentName", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const configurationId: msRest.OperationURLParameter = { - parameterPath: "configurationId", + +export const annotationProperties: OperationParameter = { + parameterPath: "annotationProperties", + mapper: AnnotationMapper +}; + +export const annotationId: OperationURLParameter = { + parameterPath: "annotationId", mapper: { + serializedName: "annotationId", required: true, - serializedName: "ConfigurationId", type: { name: "String" } } }; -export const end: msRest.OperationQueryParameter = { - parameterPath: "end", + +export const aPIKeyProperties: OperationParameter = { + parameterPath: "aPIKeyProperties", + mapper: APIKeyRequestMapper +}; + +export const keyId: OperationURLParameter = { + parameterPath: "keyId", mapper: { + serializedName: "keyId", required: true, - serializedName: "end", type: { name: "String" } } }; -export const exportId: msRest.OperationURLParameter = { + +export const exportProperties: OperationParameter = { + parameterPath: "exportProperties", + mapper: ApplicationInsightsComponentExportRequestMapper +}; + +export const exportId: OperationURLParameter = { parameterPath: "exportId", mapper: { - required: true, serializedName: "exportId", + required: true, type: { name: "String" } } }; -export const favoriteId: msRest.OperationURLParameter = { - parameterPath: "favoriteId", + +export const billingFeaturesProperties: OperationParameter = { + parameterPath: "billingFeaturesProperties", + mapper: ApplicationInsightsComponentBillingFeaturesMapper +}; + +export const configurationId: OperationURLParameter = { + parameterPath: "configurationId", mapper: { + serializedName: "ConfigurationId", required: true, - serializedName: "favoriteId", type: { name: "String" } } }; -export const favoriteType: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "favoriteType" - ], + +export const proactiveDetectionProperties: OperationParameter = { + parameterPath: "proactiveDetectionProperties", + mapper: ApplicationInsightsComponentProactiveDetectionConfigurationMapper +}; + +export const workItemConfigurationProperties: OperationParameter = { + parameterPath: "workItemConfigurationProperties", + mapper: WorkItemCreateConfigurationMapper +}; + +export const workItemConfigId: OperationURLParameter = { + parameterPath: "workItemConfigId", + mapper: { + serializedName: "workItemConfigId", + required: true, + type: { + name: "String" + } + } +}; + +export const favoriteType: OperationQueryParameter = { + parameterPath: ["options", "favoriteType"], mapper: { serializedName: "favoriteType", - defaultValue: 'shared', type: { name: "Enum", - allowedValues: [ - "shared", - "user" - ] + allowedValues: ["shared", "user"] } } }; -export const id: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "id" - ], + +export const sourceType: OperationQueryParameter = { + parameterPath: ["options", "sourceType"], mapper: { - serializedName: "id", + serializedName: "sourceType", type: { name: "String" } } }; -export const includeContent: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "includeContent" - ], + +export const canFetchContent: OperationQueryParameter = { + parameterPath: ["options", "canFetchContent"], mapper: { - serializedName: "includeContent", + serializedName: "canFetchContent", type: { name: "Boolean" } } }; -export const keyId: msRest.OperationURLParameter = { - parameterPath: "keyId", + +export const tags: OperationQueryParameter = { + parameterPath: ["options", "tags"], mapper: { + serializedName: "tags", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: "CSV" +}; + +export const favoriteId: OperationURLParameter = { + parameterPath: "favoriteId", + mapper: { + serializedName: "favoriteId", required: true, - serializedName: "keyId", type: { name: "String" } } }; -export const name: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "name" - ], + +export const favoriteProperties: OperationParameter = { + parameterPath: "favoriteProperties", + mapper: ApplicationInsightsComponentFavoriteMapper +}; + +export const webTestName: OperationURLParameter = { + parameterPath: "webTestName", mapper: { - serializedName: "name", + serializedName: "webTestName", + required: true, type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const webTestDefinition: OperationParameter = { + parameterPath: "webTestDefinition", + mapper: WebTestMapper +}; + +export const webTestTags: OperationParameter = { + parameterPath: "webTestTags", + mapper: TagsResourceMapper +}; + +export const componentName: OperationURLParameter = { + parameterPath: "componentName", mapper: { + serializedName: "componentName", required: true, + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { serializedName: "nextLink", + required: true, type: { name: "String" } }, skipEncoding: true }; -export const overrideItem: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "overrideItem" - ], + +export const scopePath: OperationURLParameter = { + parameterPath: "scopePath", mapper: { - serializedName: "overrideItem", + serializedName: "scopePath", + required: true, + type: { + name: "String" + } + } +}; + +export const scope: OperationQueryParameter = { + parameterPath: ["options", "scope"], + mapper: { + serializedName: "scope", + type: { + name: "String" + } + } +}; + +export const typeParam: OperationQueryParameter = { + parameterPath: ["options", "typeParam"], + mapper: { + defaultValue: "none", + serializedName: "type", + type: { + name: "String" + } + } +}; + +export const includeContent: OperationQueryParameter = { + parameterPath: ["options", "includeContent"], + mapper: { + serializedName: "includeContent", type: { name: "Boolean" } } }; -export const purgeId: msRest.OperationURLParameter = { - parameterPath: "purgeId", + +export const id: OperationQueryParameter = { + parameterPath: ["options", "id"], mapper: { - required: true, - serializedName: "purgeId", + serializedName: "id", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const name: OperationQueryParameter = { + parameterPath: ["options", "name"], mapper: { - required: true, - serializedName: "resourceGroupName", - constraints: { - MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ - }, + serializedName: "name", type: { name: "String" } } }; -export const resourceName: msRest.OperationURLParameter = { - parameterPath: "resourceName", + +export const itemProperties: OperationParameter = { + parameterPath: "itemProperties", + mapper: ApplicationInsightsComponentAnalyticsItemMapper +}; + +export const overrideItem: OperationQueryParameter = { + parameterPath: ["options", "overrideItem"], mapper: { - required: true, - serializedName: "resourceName", + serializedName: "overrideItem", + type: { + name: "Boolean" + } + } +}; + +export const apiVersion1: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2020-11-20", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const resourceUri: msRest.OperationURLParameter = { - parameterPath: "resourceUri", + +export const workbookTemplateProperties: OperationParameter = { + parameterPath: "workbookTemplateProperties", + mapper: WorkbookTemplateMapper +}; + +export const workbookTemplateUpdateParameters: OperationParameter = { + parameterPath: ["options", "workbookTemplateUpdateParameters"], + mapper: WorkbookTemplateUpdateParametersMapper +}; + +export const category: OperationQueryParameter = { + parameterPath: "category", mapper: { + serializedName: "category", required: true, - serializedName: "resourceUri", type: { name: "String" } - }, - skipEncoding: true + } }; -export const scope: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "scope" - ], + +export const sourceId: OperationQueryParameter = { + parameterPath: ["options", "sourceId"], mapper: { - serializedName: "scope", - defaultValue: 'shared', + serializedName: "sourceId", type: { name: "String" } } }; -export const scopePath: msRest.OperationURLParameter = { - parameterPath: "scopePath", + +export const apiVersion2: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "scopePath", + defaultValue: "2021-03-08", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const sourceType: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "sourceType" - ], + +export const workbookProperties: OperationParameter = { + parameterPath: "workbookProperties", + mapper: MyWorkbookMapper +}; + +export const apiVersion3: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - serializedName: "sourceType", + defaultValue: "2021-08-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const start: msRest.OperationQueryParameter = { - parameterPath: "start", + +export const workbookProperties1: OperationParameter = { + parameterPath: "workbookProperties", + mapper: WorkbookMapper +}; + +export const workbookUpdateParameters: OperationParameter = { + parameterPath: ["options", "workbookUpdateParameters"], + mapper: WorkbookUpdateParametersMapper +}; + +export const revisionId: OperationURLParameter = { + parameterPath: "revisionId", mapper: { + serializedName: "revisionId", required: true, - serializedName: "start", type: { name: "String" } } }; -export const storageType: msRest.OperationURLParameter = { - parameterPath: "storageType", + +export const apiVersion4: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, + defaultValue: "2018-05-01-preview", isConstant: true, - serializedName: "storageType", - defaultValue: 'ServiceProfiler', + serializedName: "api-version", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const insightProperties: OperationParameter = { + parameterPath: "insightProperties", + mapper: ApplicationInsightsComponentMapper +}; + +export const componentTags: OperationParameter = { + parameterPath: "componentTags", + mapper: TagsResourceMapper +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: ComponentPurgeBodyMapper +}; + +export const purgeId: OperationURLParameter = { + parameterPath: "purgeId", mapper: { + serializedName: "purgeId", required: true, - serializedName: "subscriptionId", - constraints: { - MinLength: 1 - }, type: { name: "String" } } }; -export const tags: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "tags" - ], + +export const apiVersion5: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - serializedName: "tags", + defaultValue: "2020-03-01-preview", + isConstant: true, + serializedName: "api-version", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } - }, - collectionFormat: msRest.QueryCollectionFormat.Csv + } }; -export const type: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "type" - ], + +export const storageType: OperationURLParameter = { + parameterPath: "storageType", mapper: { - serializedName: "type", - defaultValue: 'none', + serializedName: "storageType", + required: true, type: { name: "String" } } }; -export const webTestName: msRest.OperationURLParameter = { - parameterPath: "webTestName", + +export const linkedStorageAccountsProperties: OperationParameter = { + parameterPath: "linkedStorageAccountsProperties", + mapper: ComponentLinkedStorageAccountsMapper +}; + +export const linkedStorageAccountsProperties1: OperationParameter = { + parameterPath: "linkedStorageAccountsProperties", + mapper: ComponentLinkedStorageAccountsPatchMapper +}; + +export const apiVersion6: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "webTestName", + defaultValue: "2020-06-02-preview", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const workItemConfigId: msRest.OperationURLParameter = { - parameterPath: "workItemConfigId", + +export const resourceUri: OperationURLParameter = { + parameterPath: "resourceUri", mapper: { + serializedName: "resourceUri", required: true, - serializedName: "workItemConfigId", type: { name: "String" } - } + }, + skipEncoding: true }; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/proactiveDetectionConfigurationsMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/proactiveDetectionConfigurationsMappers.ts deleted file mode 100644 index ebd37de45598..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/proactiveDetectionConfigurationsMappers.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponent, - ApplicationInsightsComponentProactiveDetectionConfiguration, - ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, - AzureEntityResource, - BaseResource, - CloudError, - ComponentLinkedStorageAccounts, - ComponentsResource, - MyWorkbook, - MyWorkbookResource, - PrivateLinkScopedResource, - ProxyResource, - Resource, - TrackedResource, - WebTest, - WebTestGeolocation, - WebTestPropertiesConfiguration, - WebtestsResource, - Workbook, - WorkbookResource -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/webTestLocationsMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/webTestLocationsMappers.ts deleted file mode 100644 index 97c2505df574..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/webTestLocationsMappers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponentWebTestLocation, - ApplicationInsightsWebTestLocationsListResult, - CloudError -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/webTestsMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/webTestsMappers.ts deleted file mode 100644 index ec04977b0d47..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/webTestsMappers.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponent, - ApplicationInsightsComponentProactiveDetectionConfiguration, - ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, - AzureEntityResource, - BaseResource, - CloudError, - ComponentLinkedStorageAccounts, - ComponentsResource, - MyWorkbook, - MyWorkbookResource, - PrivateLinkScopedResource, - ProxyResource, - Resource, - TagsResource, - TrackedResource, - WebTest, - WebTestGeolocation, - WebTestListResult, - WebTestPropertiesConfiguration, - WebtestsResource, - Workbook, - WorkbookResource -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/workItemConfigurationsMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/workItemConfigurationsMappers.ts deleted file mode 100644 index 27d2702c8d87..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/workItemConfigurationsMappers.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CloudError, - InnerError, - WorkItemConfiguration, - WorkItemConfigurationError, - WorkItemConfigurationsListResult, - WorkItemCreateConfiguration -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/models/workbooksMappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/workbooksMappers.ts deleted file mode 100644 index f3c315638737..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/models/workbooksMappers.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApplicationInsightsComponent, - ApplicationInsightsComponentProactiveDetectionConfiguration, - ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, - AzureEntityResource, - BaseResource, - ComponentLinkedStorageAccounts, - ComponentsResource, - ErrorFieldContract, - MyWorkbook, - MyWorkbookResource, - PrivateLinkScopedResource, - ProxyResource, - Resource, - TrackedResource, - WebTest, - WebTestGeolocation, - WebTestPropertiesConfiguration, - WebtestsResource, - Workbook, - WorkbookError, - WorkbookResource, - WorkbooksListResult -} from "../models/mappers"; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/aPIKeys.ts b/sdk/applicationinsights/arm-appinsights/src/operations/aPIKeys.ts index b4f369ebc52b..8ae689bbaeb3 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/aPIKeys.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/aPIKeys.ts @@ -1,28 +1,40 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/aPIKeysMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { APIKeys } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + ApplicationInsightsComponentAPIKey, + APIKeysListOptionalParams, + APIKeysListResponse, + APIKeyRequest, + APIKeysCreateOptionalParams, + APIKeysCreateResponse, + APIKeysDeleteOptionalParams, + APIKeysDeleteResponse, + APIKeysGetOptionalParams, + APIKeysGetResponse +} from "../models"; -/** Class representing a APIKeys. */ -export class APIKeys { - private readonly client: ApplicationInsightsManagementClientContext; +/// +/** Class containing APIKeys operations. */ +export class APIKeysImpl implements APIKeys { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a APIKeys. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class APIKeys class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,71 +42,85 @@ export class APIKeys { * Gets a list of API keys of an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + public list( + resourceGroupName: string, + resourceName: string, + options?: APIKeysListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, resourceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, resourceName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + resourceName: string, + options?: APIKeysListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, resourceName, options); + yield result.value || []; + } + + private async *listPagingAll( + resourceGroupName: string, + resourceName: string, + options?: APIKeysListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + /** + * Gets a list of API keys of an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + resourceGroupName: string, + resourceName: string, + options?: APIKeysListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + listOperationSpec + ); } /** * Create an API Key of an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param aPIKeyProperties Properties that need to be specified to create an API key of a - * Application Insights component. - * @param [options] The optional parameters - * @returns Promise - */ - create(resourceGroupName: string, resourceName: string, aPIKeyProperties: Models.APIKeyRequest, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param aPIKeyProperties Properties that need to be specified to create an API key of a - * Application Insights component. - * @param callback The callback - */ - create(resourceGroupName: string, resourceName: string, aPIKeyProperties: Models.APIKeyRequest, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param aPIKeyProperties Properties that need to be specified to create an API key of a - * Application Insights component. - * @param options The optional parameters - * @param callback The callback + * @param aPIKeyProperties Properties that need to be specified to create an API key of a Application + * Insights component. + * @param options The options parameters. */ - create(resourceGroupName: string, resourceName: string, aPIKeyProperties: Models.APIKeyRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - create(resourceGroupName: string, resourceName: string, aPIKeyProperties: Models.APIKeyRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + create( + resourceGroupName: string, + resourceName: string, + aPIKeyProperties: APIKeyRequest, + options?: APIKeysCreateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - aPIKeyProperties, - options - }, - createOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, aPIKeyProperties, options }, + createOperationSpec + ); } /** @@ -102,35 +128,18 @@ export class APIKeys { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param keyId The API Key ID. This is unique within a Application Insights component. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, resourceName: string, keyId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param keyId The API Key ID. This is unique within a Application Insights component. - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, keyId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param keyId The API Key ID. This is unique within a Application Insights component. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, resourceName: string, keyId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceName: string, keyId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + resourceName: string, + keyId: string, + options?: APIKeysDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - keyId, - options - }, - deleteMethodOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, keyId, options }, + deleteOperationSpec + ); } /** @@ -138,145 +147,100 @@ export class APIKeys { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param keyId The API Key ID. This is unique within a Application Insights component. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, keyId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param keyId The API Key ID. This is unique within a Application Insights component. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, keyId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param keyId The API Key ID. This is unique within a Application Insights component. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, keyId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, keyId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + keyId: string, + options?: APIKeysGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - keyId, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, keyId, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys", + responses: { + 200: { + bodyMapper: Mappers.ApplicationInsightsComponentAPIKeyListResult + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ApplicationInsightsComponentAPIKeyListResult - }, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ApplicationInsightsComponentAPIKey } }, - serializer -}; - -const createOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys", + requestBody: Parameters.aPIKeyProperties, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "aPIKeyProperties", - mapper: { - ...Mappers.APIKeyRequest, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}", + httpMethod: "DELETE", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentAPIKey - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.keyId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentAPIKey - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.keyId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ApplicationInsightsComponentAPIKey - }, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/analyticsItems.ts b/sdk/applicationinsights/arm-appinsights/src/operations/analyticsItems.ts index 6ab9ebbc360f..e82a0517d7d6 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/analyticsItems.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/analyticsItems.ts @@ -1,28 +1,37 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/analyticsItemsMappers"; +import { AnalyticsItems } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + ItemScopePath, + AnalyticsItemsListOptionalParams, + AnalyticsItemsListResponse, + AnalyticsItemsGetOptionalParams, + AnalyticsItemsGetResponse, + ApplicationInsightsComponentAnalyticsItem, + AnalyticsItemsPutOptionalParams, + AnalyticsItemsPutResponse, + AnalyticsItemsDeleteOptionalParams +} from "../models"; -/** Class representing a AnalyticsItems. */ -export class AnalyticsItems { - private readonly client: ApplicationInsightsManagementClientContext; +/** Class containing AnalyticsItems operations. */ +export class AnalyticsItemsImpl implements AnalyticsItems { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a AnalyticsItems. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class AnalyticsItems class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,202 +39,95 @@ export class AnalyticsItems { * Gets a list of Analytics Items defined within an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' - * @param [options] The optional parameters - * @returns Promise + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared + * between all users with access to the Application Insights component. + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, options?: Models.AnalyticsItemsListOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, options: Models.AnalyticsItemsListOptionalParams, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, options?: Models.AnalyticsItemsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list( + resourceGroupName: string, + resourceName: string, + scopePath: ItemScopePath, + options?: AnalyticsItemsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - scopePath, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, scopePath, options }, + listOperationSpec + ); } /** * Gets a specific Analytics Items defined within an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, options?: Models.AnalyticsItemsGetOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' - * @param callback The callback + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared + * between all users with access to the Application Insights component. + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, options: Models.AnalyticsItemsGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, options?: Models.AnalyticsItemsGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + scopePath: ItemScopePath, + options?: AnalyticsItemsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - scopePath, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, scopePath, options }, + getOperationSpec + ); } /** * Adds or Updates a specific Analytics Item within an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' - * @param itemProperties Properties that need to be specified to create a new item and add it to an - * Application Insights component. - * @param [options] The optional parameters - * @returns Promise - */ - put(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, itemProperties: Models.ApplicationInsightsComponentAnalyticsItem, options?: Models.AnalyticsItemsPutOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' - * @param itemProperties Properties that need to be specified to create a new item and add it to an - * Application Insights component. - * @param callback The callback - */ - put(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, itemProperties: Models.ApplicationInsightsComponentAnalyticsItem, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared + * between all users with access to the Application Insights component. * @param itemProperties Properties that need to be specified to create a new item and add it to an - * Application Insights component. - * @param options The optional parameters - * @param callback The callback + * Application Insights component. + * @param options The options parameters. */ - put(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, itemProperties: Models.ApplicationInsightsComponentAnalyticsItem, options: Models.AnalyticsItemsPutOptionalParams, callback: msRest.ServiceCallback): void; - put(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, itemProperties: Models.ApplicationInsightsComponentAnalyticsItem, options?: Models.AnalyticsItemsPutOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + put( + resourceGroupName: string, + resourceName: string, + scopePath: ItemScopePath, + itemProperties: ApplicationInsightsComponentAnalyticsItem, + options?: AnalyticsItemsPutOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - scopePath, - itemProperties, - options - }, - putOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, scopePath, itemProperties, options }, + putOperationSpec + ); } /** * Deletes a specific Analytics Items defined within an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, options?: Models.AnalyticsItemsDeleteMethodOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param scopePath Enum indicating if this item definition is owned by a specific user or is - * shared between all users with access to the Application Insights component. Possible values - * include: 'analyticsItems', 'myanalyticsItems' - * @param options The optional parameters - * @param callback The callback + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared + * between all users with access to the Application Insights component. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, options: Models.AnalyticsItemsDeleteMethodOptionalParams, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceName: string, scopePath: Models.ItemScopePath, options?: Models.AnalyticsItemsDeleteMethodOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + resourceName: string, + scopePath: ItemScopePath, + options?: AnalyticsItemsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - scopePath, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, resourceName, scopePath, options }, + deleteOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.scopePath - ], - queryParameters: [ - Parameters.apiVersion0, - Parameters.scope, - Parameters.type, - Parameters.includeContent - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", element: { @@ -236,98 +138,78 @@ const listOperationSpec: msRest.OperationSpec = { } } } - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item", + queryParameters: [ + Parameters.apiVersion, + Parameters.scope, + Parameters.typeParam, + Parameters.includeContent + ], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.resourceName, Parameters.scopePath ], - queryParameters: [ - Parameters.apiVersion0, - Parameters.id, - Parameters.name - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentAnalyticsItem - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const putOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item", + queryParameters: [Parameters.apiVersion, Parameters.id, Parameters.name], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.resourceName, Parameters.scopePath ], - queryParameters: [ - Parameters.apiVersion0, - Parameters.overrideItem - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "itemProperties", - mapper: { - ...Mappers.ApplicationInsightsComponentAnalyticsItem, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const putOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentAnalyticsItem - }, - default: { - bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.itemProperties, + queryParameters: [Parameters.apiVersion, Parameters.overrideItem], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName, + Parameters.scopePath + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const deleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item", + responses: { 200: {} }, + queryParameters: [Parameters.apiVersion, Parameters.id, Parameters.name], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.resourceName, Parameters.scopePath ], - queryParameters: [ - Parameters.apiVersion0, - Parameters.id, - Parameters.name - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/annotations.ts b/sdk/applicationinsights/arm-appinsights/src/operations/annotations.ts index b9b3f4e1015d..56d88e05634b 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/annotations.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/annotations.ts @@ -1,28 +1,38 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/annotationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Annotations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + Annotation, + AnnotationsListOptionalParams, + AnnotationsListResponse, + AnnotationsCreateOptionalParams, + AnnotationsCreateResponse, + AnnotationsDeleteOptionalParams, + AnnotationsGetOptionalParams, + AnnotationsGetResponse +} from "../models"; -/** Class representing a Annotations. */ -export class Annotations { - private readonly client: ApplicationInsightsManagementClientContext; +/// +/** Class containing Annotations operations. */ +export class AnnotationsImpl implements Annotations { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a Annotations. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Annotations class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,43 +40,99 @@ export class Annotations { * Gets the list of annotations for a component for given time range * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param start The start time to query from for annotations, cannot be older than 90 days from - * current date. + * @param start The start time to query from for annotations, cannot be older than 90 days from current + * date. * @param end The end time to query for annotations. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, start: string, end: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param start The start time to query from for annotations, cannot be older than 90 days from - * current date. - * @param end The end time to query for annotations. - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, start: string, end: string, callback: msRest.ServiceCallback): void; + public list( + resourceGroupName: string, + resourceName: string, + start: string, + end: string, + options?: AnnotationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + resourceName, + start, + end, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + resourceName, + start, + end, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + resourceName: string, + start: string, + end: string, + options?: AnnotationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + resourceName, + start, + end, + options + ); + yield result.value || []; + } + + private async *listPagingAll( + resourceGroupName: string, + resourceName: string, + start: string, + end: string, + options?: AnnotationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + resourceName, + start, + end, + options + )) { + yield* page; + } + } + /** + * Gets the list of annotations for a component for given time range * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param start The start time to query from for annotations, cannot be older than 90 days from - * current date. + * @param start The start time to query from for annotations, cannot be older than 90 days from current + * date. * @param end The end time to query for annotations. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, start: string, end: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, resourceName: string, start: string, end: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + resourceGroupName: string, + resourceName: string, + start: string, + end: string, + options?: AnnotationsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - start, - end, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, start, end, options }, + listOperationSpec + ); } /** @@ -74,38 +140,19 @@ export class Annotations { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param annotationProperties Properties that need to be specified to create an annotation of a - * Application Insights component. - * @param [options] The optional parameters - * @returns Promise - */ - create(resourceGroupName: string, resourceName: string, annotationProperties: Models.Annotation, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param annotationProperties Properties that need to be specified to create an annotation of a - * Application Insights component. - * @param callback The callback + * Application Insights component. + * @param options The options parameters. */ - create(resourceGroupName: string, resourceName: string, annotationProperties: Models.Annotation, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param annotationProperties Properties that need to be specified to create an annotation of a - * Application Insights component. - * @param options The optional parameters - * @param callback The callback - */ - create(resourceGroupName: string, resourceName: string, annotationProperties: Models.Annotation, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - create(resourceGroupName: string, resourceName: string, annotationProperties: Models.Annotation, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + create( + resourceGroupName: string, + resourceName: string, + annotationProperties: Annotation, + options?: AnnotationsCreateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - annotationProperties, - options - }, - createOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, annotationProperties, options }, + createOperationSpec + ); } /** @@ -113,38 +160,19 @@ export class Annotations { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param annotationId The unique annotation ID. This is unique within a Application Insights - * component. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, resourceName: string, annotationId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param annotationId The unique annotation ID. This is unique within a Application Insights - * component. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, resourceName: string, annotationId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param annotationId The unique annotation ID. This is unique within a Application Insights - * component. - * @param options The optional parameters - * @param callback The callback + * component. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, annotationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceName: string, annotationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + resourceName: string, + annotationId: string, + options?: AnnotationsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - annotationId, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, resourceName, annotationId, options }, + deleteOperationSpec + ); } /** @@ -152,59 +180,28 @@ export class Annotations { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param annotationId The unique annotation ID. This is unique within a Application Insights - * component. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, resourceName: string, annotationId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param annotationId The unique annotation ID. This is unique within a Application Insights - * component. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, annotationId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param annotationId The unique annotation ID. This is unique within a Application Insights - * component. - * @param options The optional parameters - * @param callback The callback + * component. + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, annotationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, annotationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + annotationId: string, + options?: AnnotationsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - annotationId, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, annotationId, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion0, - Parameters.start, - Parameters.end - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AnnotationsListResult @@ -213,42 +210,26 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.AnnotationError } }, - serializer -}; - -const createOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations", + queryParameters: [Parameters.apiVersion, Parameters.start, Parameters.end], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "annotationProperties", - mapper: { - ...Mappers.Annotation, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations", + httpMethod: "PUT", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", - element: { - type: { - name: "Composite", - className: "Annotation" - } - } + element: { type: { name: "Composite", className: "Annotation" } } } } }, @@ -256,60 +237,43 @@ const createOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.AnnotationError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}", + requestBody: Parameters.annotationProperties, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.resourceName, - Parameters.annotationId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceName ], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}", +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}", + httpMethod: "DELETE", + responses: { 200: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.annotationId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}", + httpMethod: "GET", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", - element: { - type: { - name: "Composite", - className: "Annotation" - } - } + element: { type: { name: "Composite", className: "Annotation" } } } } }, @@ -317,5 +281,14 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.AnnotationError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName, + Parameters.annotationId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/componentAvailableFeatures.ts b/sdk/applicationinsights/arm-appinsights/src/operations/componentAvailableFeatures.ts index e5ce8d5f1604..cb112acafb6c 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/componentAvailableFeatures.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/componentAvailableFeatures.ts @@ -1,28 +1,31 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/componentAvailableFeaturesMappers"; +import { ComponentAvailableFeatures } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + ComponentAvailableFeaturesGetOptionalParams, + ComponentAvailableFeaturesGetResponse +} from "../models"; -/** Class representing a ComponentAvailableFeatures. */ -export class ComponentAvailableFeatures { - private readonly client: ApplicationInsightsManagementClientContext; +/** Class containing ComponentAvailableFeatures operations. */ +export class ComponentAvailableFeaturesImpl + implements ComponentAvailableFeatures { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a ComponentAvailableFeatures. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ComponentAvailableFeatures class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,58 +33,38 @@ export class ComponentAvailableFeatures { * Returns all available features of the application insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + options?: ComponentAvailableFeaturesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/getavailablebillingfeatures", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/getavailablebillingfeatures", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentAvailableFeatures - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/componentCurrentBillingFeatures.ts b/sdk/applicationinsights/arm-appinsights/src/operations/componentCurrentBillingFeatures.ts index 8c309bc2b2f2..a3acc0fa2123 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/componentCurrentBillingFeatures.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/componentCurrentBillingFeatures.ts @@ -1,28 +1,34 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/componentCurrentBillingFeaturesMappers"; +import { ComponentCurrentBillingFeatures } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + ComponentCurrentBillingFeaturesGetOptionalParams, + ComponentCurrentBillingFeaturesGetResponse, + ApplicationInsightsComponentBillingFeatures, + ComponentCurrentBillingFeaturesUpdateOptionalParams, + ComponentCurrentBillingFeaturesUpdateResponse +} from "../models"; -/** Class representing a ComponentCurrentBillingFeatures. */ -export class ComponentCurrentBillingFeatures { - private readonly client: ApplicationInsightsManagementClientContext; +/** Class containing ComponentCurrentBillingFeatures operations. */ +export class ComponentCurrentBillingFeaturesImpl + implements ComponentCurrentBillingFeatures { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a ComponentCurrentBillingFeatures. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ComponentCurrentBillingFeatures class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,129 +36,79 @@ export class ComponentCurrentBillingFeatures { * Returns current billing features for an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + options?: ComponentCurrentBillingFeaturesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + getOperationSpec + ); } /** * Update current billing features for an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param billingFeaturesProperties Properties that need to be specified to update billing features - * for an Application Insights component. - * @param [options] The optional parameters - * @returns Promise + * @param billingFeaturesProperties Properties that need to be specified to update billing features for + * an Application Insights component. + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, billingFeaturesProperties: Models.ApplicationInsightsComponentBillingFeatures, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param billingFeaturesProperties Properties that need to be specified to update billing features - * for an Application Insights component. - * @param callback The callback - */ - update(resourceGroupName: string, resourceName: string, billingFeaturesProperties: Models.ApplicationInsightsComponentBillingFeatures, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param billingFeaturesProperties Properties that need to be specified to update billing features - * for an Application Insights component. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, resourceName: string, billingFeaturesProperties: Models.ApplicationInsightsComponentBillingFeatures, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, resourceName: string, billingFeaturesProperties: Models.ApplicationInsightsComponentBillingFeatures, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + resourceName: string, + billingFeaturesProperties: ApplicationInsightsComponentBillingFeatures, + options?: ComponentCurrentBillingFeaturesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - billingFeaturesProperties, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, billingFeaturesProperties, options }, + updateOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentBillingFeatures - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "billingFeaturesProperties", - mapper: { - ...Mappers.ApplicationInsightsComponentBillingFeatures, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentBillingFeatures - }, - default: { - bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.billingFeaturesProperties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/componentFeatureCapabilities.ts b/sdk/applicationinsights/arm-appinsights/src/operations/componentFeatureCapabilities.ts index de36f7cae22c..4b383c42e0c0 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/componentFeatureCapabilities.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/componentFeatureCapabilities.ts @@ -1,28 +1,31 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/componentFeatureCapabilitiesMappers"; +import { ComponentFeatureCapabilities } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + ComponentFeatureCapabilitiesGetOptionalParams, + ComponentFeatureCapabilitiesGetResponse +} from "../models"; -/** Class representing a ComponentFeatureCapabilities. */ -export class ComponentFeatureCapabilities { - private readonly client: ApplicationInsightsManagementClientContext; +/** Class containing ComponentFeatureCapabilities operations. */ +export class ComponentFeatureCapabilitiesImpl + implements ComponentFeatureCapabilities { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a ComponentFeatureCapabilities. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ComponentFeatureCapabilities class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,58 +33,38 @@ export class ComponentFeatureCapabilities { * Returns feature capabilities of the application insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + options?: ComponentFeatureCapabilitiesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/featurecapabilities", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/featurecapabilities", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentFeatureCapabilities - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/componentLinkedStorageAccountsOperations.ts b/sdk/applicationinsights/arm-appinsights/src/operations/componentLinkedStorageAccountsOperations.ts index 46a0e3ed40bf..d9b50fde2a13 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/componentLinkedStorageAccountsOperations.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/componentLinkedStorageAccountsOperations.ts @@ -1,28 +1,39 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/componentLinkedStorageAccountsOperationsMappers"; +import { ComponentLinkedStorageAccountsOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + StorageType, + ComponentLinkedStorageAccountsGetOptionalParams, + ComponentLinkedStorageAccountsGetResponse, + ComponentLinkedStorageAccounts, + ComponentLinkedStorageAccountsCreateAndUpdateOptionalParams, + ComponentLinkedStorageAccountsCreateAndUpdateResponse, + ComponentLinkedStorageAccountsPatch, + ComponentLinkedStorageAccountsUpdateOptionalParams, + ComponentLinkedStorageAccountsUpdateResponse, + ComponentLinkedStorageAccountsDeleteOptionalParams +} from "../models"; -/** Class representing a ComponentLinkedStorageAccountsOperations. */ -export class ComponentLinkedStorageAccountsOperations { - private readonly client: ApplicationInsightsManagementClientContext; +/** Class containing ComponentLinkedStorageAccountsOperations operations. */ +export class ComponentLinkedStorageAccountsOperationsImpl + implements ComponentLinkedStorageAccountsOperations { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a ComponentLinkedStorageAccountsOperations. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ComponentLinkedStorageAccountsOperations class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,260 +41,195 @@ export class ComponentLinkedStorageAccountsOperations { * Returns the current linked storage settings for an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param storageType The type of the Application Insights component data source for the linked storage + * account. + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + storageType: StorageType, + options?: ComponentLinkedStorageAccountsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, storageType, options }, + getOperationSpec + ); } /** * Replace current linked storage account for an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param linkedStorageAccountsProperties Properties that need to be specified to update linked - * storage accounts for an Application Insights component. - * @param [options] The optional parameters - * @returns Promise - */ - createAndUpdate(resourceGroupName: string, resourceName: string, linkedStorageAccountsProperties: Models.ComponentLinkedStorageAccounts, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param linkedStorageAccountsProperties Properties that need to be specified to update linked - * storage accounts for an Application Insights component. - * @param callback The callback + * @param storageType The type of the Application Insights component data source for the linked storage + * account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage + * accounts for an Application Insights component. + * @param options The options parameters. */ - createAndUpdate(resourceGroupName: string, resourceName: string, linkedStorageAccountsProperties: Models.ComponentLinkedStorageAccounts, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param linkedStorageAccountsProperties Properties that need to be specified to update linked - * storage accounts for an Application Insights component. - * @param options The optional parameters - * @param callback The callback - */ - createAndUpdate(resourceGroupName: string, resourceName: string, linkedStorageAccountsProperties: Models.ComponentLinkedStorageAccounts, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createAndUpdate(resourceGroupName: string, resourceName: string, linkedStorageAccountsProperties: Models.ComponentLinkedStorageAccounts, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createAndUpdate( + resourceGroupName: string, + resourceName: string, + storageType: StorageType, + linkedStorageAccountsProperties: ComponentLinkedStorageAccounts, + options?: ComponentLinkedStorageAccountsCreateAndUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, + storageType, linkedStorageAccountsProperties, options }, - createAndUpdateOperationSpec, - callback) as Promise; + createAndUpdateOperationSpec + ); } /** * Update linked storage accounts for an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage + * account. * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked - * storage accounts for an Application Insights component. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, resourceName: string, linkedStorageAccountsProperties: Models.ComponentLinkedStorageAccountsPatch, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked - * storage accounts for an Application Insights component. - * @param callback The callback - */ - update(resourceGroupName: string, resourceName: string, linkedStorageAccountsProperties: Models.ComponentLinkedStorageAccountsPatch, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked - * storage accounts for an Application Insights component. - * @param options The optional parameters - * @param callback The callback + * storage accounts for an Application Insights component. + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, linkedStorageAccountsProperties: Models.ComponentLinkedStorageAccountsPatch, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, resourceName: string, linkedStorageAccountsProperties: Models.ComponentLinkedStorageAccountsPatch, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + resourceName: string, + storageType: StorageType, + linkedStorageAccountsProperties: ComponentLinkedStorageAccountsPatch, + options?: ComponentLinkedStorageAccountsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, + storageType, linkedStorageAccountsProperties, options }, - updateOperationSpec, - callback) as Promise; + updateOperationSpec + ); } /** * Delete linked storage accounts for an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback + * @param storageType The type of the Application Insights component data source for the linked storage + * account. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + resourceName: string, + storageType: StorageType, + options?: ComponentLinkedStorageAccountsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, resourceName, storageType, options }, + deleteOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName, - Parameters.storageType - ], - queryParameters: [ - Parameters.apiVersion3 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ComponentLinkedStorageAccounts }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseLinkedStorage } }, - serializer -}; - -const createAndUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", + queryParameters: [Parameters.apiVersion5], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.storageType ], - queryParameters: [ - Parameters.apiVersion3 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "linkedStorageAccountsProperties", - mapper: { - ...Mappers.ComponentLinkedStorageAccounts, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createAndUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ComponentLinkedStorageAccounts }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseLinkedStorage } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", + requestBody: Parameters.linkedStorageAccountsProperties, + queryParameters: [Parameters.apiVersion5], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.storageType ], - queryParameters: [ - Parameters.apiVersion3 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "linkedStorageAccountsProperties", - mapper: { - ...Mappers.ComponentLinkedStorageAccountsPatch, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.ComponentLinkedStorageAccounts }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseLinkedStorage } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", + requestBody: Parameters.linkedStorageAccountsProperties1, + queryParameters: [Parameters.apiVersion5], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.storageType ], - queryParameters: [ - Parameters.apiVersion3 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseLinkedStorage } }, + queryParameters: [Parameters.apiVersion5], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName, + Parameters.storageType + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/componentQuotaStatus.ts b/sdk/applicationinsights/arm-appinsights/src/operations/componentQuotaStatus.ts index c94652a32949..4acb374ee67f 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/componentQuotaStatus.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/componentQuotaStatus.ts @@ -1,28 +1,30 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/componentQuotaStatusMappers"; +import { ComponentQuotaStatus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + ComponentQuotaStatusGetOptionalParams, + ComponentQuotaStatusGetResponse +} from "../models"; -/** Class representing a ComponentQuotaStatus. */ -export class ComponentQuotaStatus { - private readonly client: ApplicationInsightsManagementClientContext; +/** Class containing ComponentQuotaStatus operations. */ +export class ComponentQuotaStatusImpl implements ComponentQuotaStatus { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a ComponentQuotaStatus. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ComponentQuotaStatus class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,58 +32,38 @@ export class ComponentQuotaStatus { * Returns daily data volume cap (quota) status for an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + options?: ComponentQuotaStatusGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/quotastatus", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/quotastatus", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentQuotaStatus - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/components.ts b/sdk/applicationinsights/arm-appinsights/src/operations/components.ts index 48c6618cbfe9..c64a1cb7411c 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/components.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/components.ts @@ -1,185 +1,228 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/componentsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Components } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + ApplicationInsightsComponent, + ComponentsListNextOptionalParams, + ComponentsListOptionalParams, + ComponentsListByResourceGroupNextOptionalParams, + ComponentsListByResourceGroupOptionalParams, + ComponentsListResponse, + ComponentsListByResourceGroupResponse, + ComponentsDeleteOptionalParams, + ComponentsGetOptionalParams, + ComponentsGetResponse, + ComponentsCreateOrUpdateOptionalParams, + ComponentsCreateOrUpdateResponse, + TagsResource, + ComponentsUpdateTagsOptionalParams, + ComponentsUpdateTagsResponse, + ComponentPurgeBody, + ComponentsPurgeOptionalParams, + ComponentsPurgeResponse, + ComponentsGetPurgeStatusOptionalParams, + ComponentsGetPurgeStatusResponse, + ComponentsListNextResponse, + ComponentsListByResourceGroupNextResponse +} from "../models"; -/** Class representing a Components. */ -export class Components { - private readonly client: ApplicationInsightsManagementClientContext; +/// +/** Class containing Components operations. */ +export class ComponentsImpl implements Components { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a Components. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Components class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } /** * Gets a list of all Application Insights components within a subscription. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: ComponentsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); }, - listOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ComponentsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: ComponentsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Gets a list of Application Insights components within a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByResourceGroup( + resourceGroupName: string, + options?: ComponentsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ComponentsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, + continuationToken, options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ComponentsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Deletes an Application Insights component. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * Gets a list of all Application Insights components within a subscription. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + private _list( + options?: ComponentsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** + * Gets a list of Application Insights components within a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + private _listByResourceGroup( + resourceGroupName: string, + options?: ComponentsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + /** + * Deletes an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + resourceName: string, + options?: ComponentsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, resourceName, options }, + deleteOperationSpec + ); } /** * Returns an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + options?: ComponentsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + getOperationSpec + ); } /** - * Creates (or updates) an Application Insights component. Note: You cannot specify a different - * value for InstrumentationKey nor AppId in the Put operation. + * Creates (or updates) an Application Insights component. Note: You cannot specify a different value + * for InstrumentationKey nor AppId in the Put operation. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param insightProperties Properties that need to be specified to create an Application Insights - * component. - * @param [options] The optional parameters - * @returns Promise + * component. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, resourceName: string, insightProperties: Models.ApplicationInsightsComponent, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param insightProperties Properties that need to be specified to create an Application Insights - * component. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, resourceName: string, insightProperties: Models.ApplicationInsightsComponent, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param insightProperties Properties that need to be specified to create an Application Insights - * component. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, resourceName: string, insightProperties: Models.ApplicationInsightsComponent, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, resourceName: string, insightProperties: Models.ApplicationInsightsComponent, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + resourceName: string, + insightProperties: ApplicationInsightsComponent, + options?: ComponentsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - insightProperties, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, insightProperties, options }, + createOrUpdateOperationSpec + ); } /** @@ -187,80 +230,43 @@ export class Components { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param componentTags Updated tag information to set into the component instance. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - updateTags(resourceGroupName: string, resourceName: string, componentTags: Models.TagsResource, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param componentTags Updated tag information to set into the component instance. - * @param callback The callback - */ - updateTags(resourceGroupName: string, resourceName: string, componentTags: Models.TagsResource, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param componentTags Updated tag information to set into the component instance. - * @param options The optional parameters - * @param callback The callback - */ - updateTags(resourceGroupName: string, resourceName: string, componentTags: Models.TagsResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - updateTags(resourceGroupName: string, resourceName: string, componentTags: Models.TagsResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + updateTags( + resourceGroupName: string, + resourceName: string, + componentTags: TagsResource, + options?: ComponentsUpdateTagsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - componentTags, - options - }, - updateTagsOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, componentTags, options }, + updateTagsOperationSpec + ); } /** * Purges data in an Application Insights component by a set of user-defined filters. * * In order to manage system resources, purge requests are throttled at 50 requests per hour. You - * should batch the execution of purge requests by sending a single command whose predicate - * includes all user identities that require purging. Use the in operator to specify multiple - * identities. You should run the query prior to using for a purge request to verify that the - * results are expected. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param body Describes the body of a request to purge data in a single table of an Application - * Insights component - * @param [options] The optional parameters - * @returns Promise - */ - purge(resourceGroupName: string, resourceName: string, body: Models.ComponentPurgeBody, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param body Describes the body of a request to purge data in a single table of an Application - * Insights component - * @param callback The callback - */ - purge(resourceGroupName: string, resourceName: string, body: Models.ComponentPurgeBody, callback: msRest.ServiceCallback): void; - /** + * should batch the execution of purge requests by sending a single command whose predicate includes + * all user identities that require purging. Use the in operator to specify multiple identities. You + * should run the query prior to using for a purge request to verify that the results are expected. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param body Describes the body of a request to purge data in a single table of an Application - * Insights component - * @param options The optional parameters - * @param callback The callback + * Insights component + * @param options The options parameters. */ - purge(resourceGroupName: string, resourceName: string, body: Models.ComponentPurgeBody, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - purge(resourceGroupName: string, resourceName: string, body: Models.ComponentPurgeBody, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + purge( + resourceGroupName: string, + resourceName: string, + body: ComponentPurgeBody, + options?: ComponentsPurgeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - body, - options - }, - purgeOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, body, options }, + purgeOperationSpec + ); } /** @@ -268,361 +274,242 @@ export class Components { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param purgeId In a purge status request, this is the Id of the operation the status of which is - * returned. - * @param [options] The optional parameters - * @returns Promise + * returned. + * @param options The options parameters. */ - getPurgeStatus(resourceGroupName: string, resourceName: string, purgeId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param purgeId In a purge status request, this is the Id of the operation the status of which is - * returned. - * @param callback The callback - */ - getPurgeStatus(resourceGroupName: string, resourceName: string, purgeId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param purgeId In a purge status request, this is the Id of the operation the status of which is - * returned. - * @param options The optional parameters - * @param callback The callback - */ - getPurgeStatus(resourceGroupName: string, resourceName: string, purgeId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getPurgeStatus(resourceGroupName: string, resourceName: string, purgeId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getPurgeStatus( + resourceGroupName: string, + resourceName: string, + purgeId: string, + options?: ComponentsGetPurgeStatusOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - purgeId, - options - }, - getPurgeStatusOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, purgeId, options }, + getPurgeStatusOperationSpec + ); } /** - * Gets a list of all Application Insights components within a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: ComponentsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } /** - * Gets a list of Application Insights components within a resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ComponentsListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Insights/components", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const deleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", + responses: { 200: {}, 204: {} }, + queryParameters: [Parameters.apiVersion4], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponent - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", + queryParameters: [Parameters.apiVersion4], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "insightProperties", - mapper: { - ...Mappers.ApplicationInsightsComponent, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponent }, 201: { bodyMapper: Mappers.ApplicationInsightsComponent - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateTagsOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", + requestBody: Parameters.insightProperties, + queryParameters: [Parameters.apiVersion4], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "componentTags", - mapper: { - ...Mappers.TagsResource, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateTagsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponent }, 201: { bodyMapper: Mappers.ApplicationInsightsComponent - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const purgeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge", + requestBody: Parameters.componentTags, + queryParameters: [Parameters.apiVersion4], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "body", - mapper: { - ...Mappers.ComponentPurgeBody, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const purgeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge", + httpMethod: "POST", responses: { 202: { bodyMapper: Mappers.ComponentPurgeResponse - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getPurgeStatusOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}", + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion4], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.resourceName, - Parameters.purgeId - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getPurgeStatusOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ComponentPurgeStatusResponse - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName, + Parameters.purgeId + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/exportConfigurations.ts b/sdk/applicationinsights/arm-appinsights/src/operations/exportConfigurations.ts index 940a447fdb0b..95c6930c80e8 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/exportConfigurations.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/exportConfigurations.ts @@ -1,28 +1,39 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/exportConfigurationsMappers"; +import { ExportConfigurations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + ExportConfigurationsListOptionalParams, + ExportConfigurationsListResponse, + ApplicationInsightsComponentExportRequest, + ExportConfigurationsCreateOptionalParams, + ExportConfigurationsCreateResponse, + ExportConfigurationsDeleteOptionalParams, + ExportConfigurationsDeleteResponse, + ExportConfigurationsGetOptionalParams, + ExportConfigurationsGetResponse, + ExportConfigurationsUpdateOptionalParams, + ExportConfigurationsUpdateResponse +} from "../models"; -/** Class representing a ExportConfigurations. */ -export class ExportConfigurations { - private readonly client: ApplicationInsightsManagementClientContext; +/** Class containing ExportConfigurations operations. */ +export class ExportConfigurationsImpl implements ExportConfigurations { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a ExportConfigurations. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ExportConfigurations class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,32 +41,17 @@ export class ExportConfigurations { * Gets a list of Continuous Export configuration of an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list( + resourceGroupName: string, + resourceName: string, + options?: ExportConfigurationsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + listOperationSpec + ); } /** @@ -63,185 +59,94 @@ export class ExportConfigurations { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param exportProperties Properties that need to be specified to create a Continuous Export - * configuration of a Application Insights component. - * @param [options] The optional parameters - * @returns Promise - */ - create(resourceGroupName: string, resourceName: string, exportProperties: Models.ApplicationInsightsComponentExportRequest, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param exportProperties Properties that need to be specified to create a Continuous Export - * configuration of a Application Insights component. - * @param callback The callback + * configuration of a Application Insights component. + * @param options The options parameters. */ - create(resourceGroupName: string, resourceName: string, exportProperties: Models.ApplicationInsightsComponentExportRequest, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param exportProperties Properties that need to be specified to create a Continuous Export - * configuration of a Application Insights component. - * @param options The optional parameters - * @param callback The callback - */ - create(resourceGroupName: string, resourceName: string, exportProperties: Models.ApplicationInsightsComponentExportRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - create(resourceGroupName: string, resourceName: string, exportProperties: Models.ApplicationInsightsComponentExportRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + create( + resourceGroupName: string, + resourceName: string, + exportProperties: ApplicationInsightsComponentExportRequest, + options?: ExportConfigurationsCreateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - exportProperties, - options - }, - createOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, exportProperties, options }, + createOperationSpec + ); } /** * Delete a Continuous Export configuration of an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param exportId The Continuous Export configuration ID. This is unique within a Application - * Insights component. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, resourceName: string, exportId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param exportId The Continuous Export configuration ID. This is unique within a Application - * Insights component. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, resourceName: string, exportId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param exportId The Continuous Export configuration ID. This is unique within a Application - * Insights component. - * @param options The optional parameters - * @param callback The callback + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights + * component. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, exportId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceName: string, exportId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + resourceName: string, + exportId: string, + options?: ExportConfigurationsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - exportId, - options - }, - deleteMethodOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, exportId, options }, + deleteOperationSpec + ); } /** * Get the Continuous Export configuration for this export id. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param exportId The Continuous Export configuration ID. This is unique within a Application - * Insights component. - * @param [options] The optional parameters - * @returns Promise + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights + * component. + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, exportId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param exportId The Continuous Export configuration ID. This is unique within a Application - * Insights component. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, exportId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param exportId The Continuous Export configuration ID. This is unique within a Application - * Insights component. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, exportId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, exportId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + exportId: string, + options?: ExportConfigurationsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - exportId, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, exportId, options }, + getOperationSpec + ); } /** * Update the Continuous Export configuration for this export id. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param exportId The Continuous Export configuration ID. This is unique within a Application - * Insights component. - * @param exportProperties Properties that need to be specified to update the Continuous Export - * configuration. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, resourceName: string, exportId: string, exportProperties: Models.ApplicationInsightsComponentExportRequest, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param exportId The Continuous Export configuration ID. This is unique within a Application - * Insights component. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights + * component. * @param exportProperties Properties that need to be specified to update the Continuous Export - * configuration. - * @param callback The callback + * configuration. + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, exportId: string, exportProperties: Models.ApplicationInsightsComponentExportRequest, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param exportId The Continuous Export configuration ID. This is unique within a Application - * Insights component. - * @param exportProperties Properties that need to be specified to update the Continuous Export - * configuration. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, resourceName: string, exportId: string, exportProperties: Models.ApplicationInsightsComponentExportRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, resourceName: string, exportId: string, exportProperties: Models.ApplicationInsightsComponentExportRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + resourceName: string, + exportId: string, + exportProperties: ApplicationInsightsComponentExportRequest, + options?: ExportConfigurationsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - exportId, - exportProperties, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, exportId, exportProperties, options }, + updateOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", element: { @@ -252,39 +157,25 @@ const listOperationSpec: msRest.OperationSpec = { } } } - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "exportProperties", - mapper: { - ...Mappers.ApplicationInsightsComponentExportRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration", + httpMethod: "POST", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", element: { @@ -295,95 +186,79 @@ const createOperationSpec: msRest.OperationSpec = { } } } - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}", + requestBody: Parameters.exportProperties, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.resourceName, - Parameters.exportId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}", + httpMethod: "DELETE", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentExportConfiguration - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.exportId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentExportConfiguration - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.exportId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "exportProperties", - mapper: { - ...Mappers.ApplicationInsightsComponentExportRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentExportConfiguration - }, - default: { - bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.exportProperties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName, + Parameters.exportId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/favorites.ts b/sdk/applicationinsights/arm-appinsights/src/operations/favorites.ts index f825ea158c5a..841d9e65a5c1 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/favorites.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/favorites.ts @@ -1,28 +1,38 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/favoritesMappers"; +import { Favorites } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + FavoritesListOptionalParams, + FavoritesListResponse, + FavoritesGetOptionalParams, + FavoritesGetResponse, + ApplicationInsightsComponentFavorite, + FavoritesAddOptionalParams, + FavoritesAddResponse, + FavoritesUpdateOptionalParams, + FavoritesUpdateResponse, + FavoritesDeleteOptionalParams +} from "../models"; -/** Class representing a Favorites. */ -export class Favorites { - private readonly client: ApplicationInsightsManagementClientContext; +/** Class containing Favorites operations. */ +export class FavoritesImpl implements Favorites { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a Favorites. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Favorites class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,32 +40,17 @@ export class Favorites { * Gets a list of favorites defined within an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, options?: Models.FavoritesListOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, options: Models.FavoritesListOptionalParams, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, resourceName: string, options?: Models.FavoritesListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list( + resourceGroupName: string, + resourceName: string, + options?: FavoritesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + listOperationSpec + ); } /** @@ -63,35 +58,18 @@ export class Favorites { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param favoriteId The Id of a specific favorite defined in the Application Insights component - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, resourceName: string, favoriteId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param favoriteId The Id of a specific favorite defined in the Application Insights component - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, favoriteId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param favoriteId The Id of a specific favorite defined in the Application Insights component - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, favoriteId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, favoriteId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + favoriteId: string, + options?: FavoritesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - favoriteId, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, favoriteId, options }, + getOperationSpec + ); } /** @@ -99,32 +77,17 @@ export class Favorites { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param favoriteId The Id of a specific favorite defined in the Application Insights component - * @param favoriteProperties Properties that need to be specified to create a new favorite and add - * it to an Application Insights component. - * @param [options] The optional parameters - * @returns Promise - */ - add(resourceGroupName: string, resourceName: string, favoriteId: string, favoriteProperties: Models.ApplicationInsightsComponentFavorite, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param favoriteId The Id of a specific favorite defined in the Application Insights component - * @param favoriteProperties Properties that need to be specified to create a new favorite and add - * it to an Application Insights component. - * @param callback The callback + * @param favoriteProperties Properties that need to be specified to create a new favorite and add it + * to an Application Insights component. + * @param options The options parameters. */ - add(resourceGroupName: string, resourceName: string, favoriteId: string, favoriteProperties: Models.ApplicationInsightsComponentFavorite, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param favoriteId The Id of a specific favorite defined in the Application Insights component - * @param favoriteProperties Properties that need to be specified to create a new favorite and add - * it to an Application Insights component. - * @param options The optional parameters - * @param callback The callback - */ - add(resourceGroupName: string, resourceName: string, favoriteId: string, favoriteProperties: Models.ApplicationInsightsComponentFavorite, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - add(resourceGroupName: string, resourceName: string, favoriteId: string, favoriteProperties: Models.ApplicationInsightsComponentFavorite, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + add( + resourceGroupName: string, + resourceName: string, + favoriteId: string, + favoriteProperties: ApplicationInsightsComponentFavorite, + options?: FavoritesAddOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -133,8 +96,8 @@ export class Favorites { favoriteProperties, options }, - addOperationSpec, - callback) as Promise; + addOperationSpec + ); } /** @@ -143,28 +106,15 @@ export class Favorites { * @param resourceName The name of the Application Insights component resource. * @param favoriteId The Id of a specific favorite defined in the Application Insights component * @param favoriteProperties Properties that need to be specified to update the existing favorite. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, favoriteId: string, favoriteProperties: Models.ApplicationInsightsComponentFavorite, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param favoriteId The Id of a specific favorite defined in the Application Insights component - * @param favoriteProperties Properties that need to be specified to update the existing favorite. - * @param callback The callback - */ - update(resourceGroupName: string, resourceName: string, favoriteId: string, favoriteProperties: Models.ApplicationInsightsComponentFavorite, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param favoriteId The Id of a specific favorite defined in the Application Insights component - * @param favoriteProperties Properties that need to be specified to update the existing favorite. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, resourceName: string, favoriteId: string, favoriteProperties: Models.ApplicationInsightsComponentFavorite, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, resourceName: string, favoriteId: string, favoriteProperties: Models.ApplicationInsightsComponentFavorite, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + resourceName: string, + favoriteId: string, + favoriteProperties: ApplicationInsightsComponentFavorite, + options?: FavoritesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -173,8 +123,8 @@ export class Favorites { favoriteProperties, options }, - updateOperationSpec, - callback) as Promise; + updateOperationSpec + ); } /** @@ -182,62 +132,30 @@ export class Favorites { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param favoriteId The Id of a specific favorite defined in the Application Insights component - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, resourceName: string, favoriteId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param favoriteId The Id of a specific favorite defined in the Application Insights component - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, resourceName: string, favoriteId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param favoriteId The Id of a specific favorite defined in the Application Insights component - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, favoriteId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceName: string, favoriteId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + resourceName: string, + favoriteId: string, + options?: FavoritesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - favoriteId, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, resourceName, favoriteId, options }, + deleteOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion0, - Parameters.favoriteType, - Parameters.sourceType, - Parameters.canFetchContent, - Parameters.tags - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", element: { @@ -248,126 +166,100 @@ const listOperationSpec: msRest.OperationSpec = { } } } - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", + queryParameters: [ + Parameters.apiVersion, + Parameters.favoriteType, + Parameters.sourceType, + Parameters.canFetchContent, + Parameters.tags + ], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.resourceName, - Parameters.favoriteId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentFavorite - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const addOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.favoriteId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "favoriteProperties", - mapper: { - ...Mappers.ApplicationInsightsComponentFavorite, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const addOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentFavorite - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", + requestBody: Parameters.favoriteProperties, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.favoriteId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "favoriteProperties", - mapper: { - ...Mappers.ApplicationInsightsComponentFavorite, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentFavorite - }, - default: { - bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.favoriteProperties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName, + Parameters.favoriteId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const deleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", + responses: { 200: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.favoriteId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/index.ts b/sdk/applicationinsights/arm-appinsights/src/operations/index.ts index c3c6ae147129..22f0c430dc3b 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/index.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/index.ts @@ -1,14 +1,11 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./operations"; export * from "./annotations"; export * from "./aPIKeys"; export * from "./exportConfigurations"; @@ -22,8 +19,10 @@ export * from "./favorites"; export * from "./webTestLocations"; export * from "./webTests"; export * from "./analyticsItems"; -export * from "./workbooks"; +export * from "./workbookTemplates"; export * from "./myWorkbooks"; +export * from "./workbooks"; export * from "./components"; export * from "./componentLinkedStorageAccountsOperations"; +export * from "./operations"; export * from "./liveToken"; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/liveToken.ts b/sdk/applicationinsights/arm-appinsights/src/operations/liveToken.ts index ed95ae3dd28b..7b2d791f2b37 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/liveToken.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/liveToken.ts @@ -1,81 +1,61 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/liveTokenMappers"; +import { LiveToken } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { LiveTokenGetOptionalParams, LiveTokenGetResponse } from "../models"; -/** Class representing a LiveToken. */ -export class LiveToken { - private readonly client: ApplicationInsightsManagementClientContext; +/** Class containing LiveToken operations. */ +export class LiveTokenImpl implements LiveToken { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a LiveToken. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class LiveToken class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } /** * **Gets an access token for live metrics stream data.** * @param resourceUri The identifier of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceUri: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceUri The identifier of the resource. - * @param callback The callback - */ - get(resourceUri: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceUri The identifier of the resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceUri: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceUri: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceUri: string, + options?: LiveTokenGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceUri, - options - }, - getOperationSpec, - callback) as Promise; + { resourceUri, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/microsoft.insights/generatelivetoken", httpMethod: "POST", - path: "{resourceUri}/providers/microsoft.insights/generatelivetoken", - urlParameters: [ - Parameters.resourceUri - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.LiveTokenResponse }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseLinkedStorage } }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [Parameters.$host, Parameters.resourceUri], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/myWorkbooks.ts b/sdk/applicationinsights/arm-appinsights/src/operations/myWorkbooks.ts index bbd47c344ea6..8be0ed84b893 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/myWorkbooks.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/myWorkbooks.ts @@ -1,159 +1,238 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/myWorkbooksMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { MyWorkbooks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + MyWorkbook, + CategoryType, + MyWorkbooksListByResourceGroupNextOptionalParams, + MyWorkbooksListByResourceGroupOptionalParams, + MyWorkbooksListBySubscriptionNextOptionalParams, + MyWorkbooksListBySubscriptionOptionalParams, + MyWorkbooksListByResourceGroupResponse, + MyWorkbooksListBySubscriptionResponse, + MyWorkbooksGetOptionalParams, + MyWorkbooksGetResponse, + MyWorkbooksDeleteOptionalParams, + MyWorkbooksCreateOrUpdateOptionalParams, + MyWorkbooksCreateOrUpdateResponse, + MyWorkbooksUpdateOptionalParams, + MyWorkbooksUpdateResponse, + MyWorkbooksListByResourceGroupNextResponse, + MyWorkbooksListBySubscriptionNextResponse +} from "../models"; -/** Class representing a MyWorkbooks. */ -export class MyWorkbooks { - private readonly client: ApplicationInsightsManagementClientContext; +/// +/** Class containing MyWorkbooks operations. */ +export class MyWorkbooksImpl implements MyWorkbooks { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a MyWorkbooks. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class MyWorkbooks class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } /** * Get all private workbooks defined within a specified resource group and category. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', - * 'performance', 'retention' - * @param [options] The optional parameters - * @returns Promise + * @param category Category of workbook to return. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, category: Models.CategoryType, options?: Models.MyWorkbooksListByResourceGroupOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', - * 'performance', 'retention' - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, category: Models.CategoryType, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', - * 'performance', 'retention' - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, category: Models.CategoryType, options: Models.MyWorkbooksListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, category: Models.CategoryType, options?: Models.MyWorkbooksListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByResourceGroup( + resourceGroupName: string, + category: CategoryType, + options?: MyWorkbooksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll( + resourceGroupName, + category, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage( + resourceGroupName, + category, + options + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + category: CategoryType, + options?: MyWorkbooksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup( + resourceGroupName, + category, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, category, + continuationToken, options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + category: CategoryType, + options?: MyWorkbooksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + category, + options + )) { + yield* page; + } } /** * Get all private workbooks defined within a specified subscription and category. - * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', - * 'performance', 'retention' - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscription(category: Models.CategoryType, options?: Models.MyWorkbooksListBySubscriptionOptionalParams): Promise; - /** - * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', - * 'performance', 'retention' - * @param callback The callback - */ - listBySubscription(category: Models.CategoryType, callback: msRest.ServiceCallback): void; - /** - * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', - * 'performance', 'retention' - * @param options The optional parameters - * @param callback The callback + * @param category Category of workbook to return. + * @param options The options parameters. */ - listBySubscription(category: Models.CategoryType, options: Models.MyWorkbooksListBySubscriptionOptionalParams, callback: msRest.ServiceCallback): void; - listBySubscription(category: Models.CategoryType, options?: Models.MyWorkbooksListBySubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listBySubscription( + category: CategoryType, + options?: MyWorkbooksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(category, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(category, options); + } + }; + } + + private async *listBySubscriptionPagingPage( + category: CategoryType, + options?: MyWorkbooksListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(category, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext( category, + continuationToken, options - }, - listBySubscriptionOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + category: CategoryType, + options?: MyWorkbooksListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage( + category, + options + )) { + yield* page; + } } /** - * Get a single private workbook by its resourceName. + * Get all private workbooks defined within a specified resource group and category. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param category Category of workbook to return. + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + private _listByResourceGroup( + resourceGroupName: string, + category: CategoryType, + options?: MyWorkbooksListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, category, options }, + listByResourceGroupOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback + * Get all private workbooks defined within a specified subscription and category. + * @param category Category of workbook to return. + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + private _listBySubscription( + category: CategoryType, + options?: MyWorkbooksListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { category, options }, + listBySubscriptionOperationSpec + ); + } + /** + * Get a single private workbook by its resourceName. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + options?: MyWorkbooksGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + getOperationSpec + ); } /** * Delete a private workbook. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + resourceName: string, + options?: MyWorkbooksDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, resourceName, options }, + deleteOperationSpec + ); } /** @@ -161,35 +240,18 @@ export class MyWorkbooks { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, resourceName: string, workbookProperties: Models.MyWorkbook, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, resourceName: string, workbookProperties: Models.MyWorkbook, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, resourceName: string, workbookProperties: Models.MyWorkbook, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, resourceName: string, workbookProperties: Models.MyWorkbook, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + resourceName: string, + workbookProperties: MyWorkbook, + options?: MyWorkbooksCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - workbookProperties, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, workbookProperties, options }, + createOrUpdateOperationSpec + ); } /** @@ -197,56 +259,63 @@ export class MyWorkbooks { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, workbookProperties: Models.MyWorkbook, options?: msRest.RequestOptionsBase): Promise; + update( + resourceGroupName: string, + resourceName: string, + workbookProperties: MyWorkbook, + options?: MyWorkbooksUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, workbookProperties, options }, + updateOperationSpec + ); + } + /** + * ListByResourceGroupNext * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param callback The callback + * @param category Category of workbook to return. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, workbookProperties: Models.MyWorkbook, callback: msRest.ServiceCallback): void; + private _listByResourceGroupNext( + resourceGroupName: string, + category: CategoryType, + nextLink: string, + options?: MyWorkbooksListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, category, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param options The optional parameters - * @param callback The callback + * ListBySubscriptionNext + * @param category Category of workbook to return. + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, workbookProperties: Models.MyWorkbook, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, resourceName: string, workbookProperties: Models.MyWorkbook, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscriptionNext( + category: CategoryType, + nextLink: string, + options?: MyWorkbooksListBySubscriptionNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - workbookProperties, - options - }, - updateOperationSpec, - callback) as Promise; + { category, nextLink, options }, + listBySubscriptionNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.category, - Parameters.tags, - Parameters.canFetchContent, - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.MyWorkbooksListResult @@ -255,24 +324,25 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.MyWorkbookError } }, - serializer -}; - -const listBySubscriptionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Insights/myWorkbooks", - urlParameters: [ - Parameters.subscriptionId - ], queryParameters: [ - Parameters.category, - Parameters.tags, Parameters.canFetchContent, - Parameters.apiVersion0 + Parameters.tags, + Parameters.category, + Parameters.sourceId, + Parameters.apiVersion2 ], - headerParameters: [ - Parameters.acceptLanguage + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/myWorkbooks", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.MyWorkbooksListResult @@ -281,23 +351,20 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.MyWorkbookError } }, + queryParameters: [ + Parameters.canFetchContent, + Parameters.tags, + Parameters.category, + Parameters.apiVersion2 + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.MyWorkbook @@ -306,54 +373,41 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.MyWorkbookError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}", + queryParameters: [Parameters.apiVersion2], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}", + httpMethod: "DELETE", responses: { - 201: {}, + 200: {}, 204: {}, default: { bodyMapper: Mappers.MyWorkbookError } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}", + queryParameters: [Parameters.apiVersion2], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "workbookProperties", - mapper: { - ...Mappers.MyWorkbook, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.MyWorkbook @@ -365,37 +419,91 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.MyWorkbookError } }, + requestBody: Parameters.workbookProperties, + queryParameters: [Parameters.sourceId, Parameters.apiVersion2], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const updateOperationSpec: msRest.OperationSpec = { +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}", httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}", + responses: { + 201: { + bodyMapper: Mappers.MyWorkbook + }, + default: { + bodyMapper: Mappers.MyWorkbookError + } + }, + requestBody: Parameters.workbookProperties, + queryParameters: [Parameters.sourceId, Parameters.apiVersion2], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.resourceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MyWorkbooksListResult + }, + default: { + bodyMapper: Mappers.MyWorkbookError + } + }, queryParameters: [ - Parameters.apiVersion0 + Parameters.canFetchContent, + Parameters.tags, + Parameters.category, + Parameters.sourceId, + Parameters.apiVersion2 ], - headerParameters: [ - Parameters.acceptLanguage + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink ], - requestBody: { - parameterPath: "workbookProperties", - mapper: { - ...Mappers.MyWorkbook, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.MyWorkbook + bodyMapper: Mappers.MyWorkbooksListResult }, default: { bodyMapper: Mappers.MyWorkbookError } }, + queryParameters: [ + Parameters.canFetchContent, + Parameters.tags, + Parameters.category, + Parameters.apiVersion2 + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/operations.ts b/sdk/applicationinsights/arm-appinsights/src/operations/operations.ts index a21e656b1639..085c42a0403f 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/operations.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/operations.ts @@ -1,218 +1,133 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + OperationLive, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: ApplicationInsightsManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a Operations. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } /** - * Lists all of the available insights REST API operations. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * List the available operations supported by the resource provider. + * @param options The options parameters. */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; } - /** - * List the available operations supported by the resource provider. - * @summary List available operations. - * @param [options] The optional parameters - * @returns Promise - */ - list1(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list1(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list1(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list1(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - list1OperationSpec, - callback) as Promise; + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Lists all of the available insights REST API operations. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * List the available operations supported by the resource provider. - * @summary List available operations. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list1Next(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - list1Next(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - list1Next(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list1Next(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - list1NextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "providers/Microsoft.Insights/operations", - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.OperationListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const list1OperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/microsoft.insights/operations", httpMethod: "GET", - path: "providers/microsoft.insights/operations", - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationsListResult }, - default: { - bodyMapper: Mappers.CloudError - } + default: {} }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.OperationListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const list1NextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationsListResult }, - default: { - bodyMapper: Mappers.CloudError - } + default: {} }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/proactiveDetectionConfigurations.ts b/sdk/applicationinsights/arm-appinsights/src/operations/proactiveDetectionConfigurations.ts index 79b5a581c019..513948aeb59d 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/proactiveDetectionConfigurations.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/proactiveDetectionConfigurations.ts @@ -1,28 +1,36 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/proactiveDetectionConfigurationsMappers"; +import { ProactiveDetectionConfigurations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + ProactiveDetectionConfigurationsListOptionalParams, + ProactiveDetectionConfigurationsListResponse, + ProactiveDetectionConfigurationsGetOptionalParams, + ProactiveDetectionConfigurationsGetResponse, + ApplicationInsightsComponentProactiveDetectionConfiguration, + ProactiveDetectionConfigurationsUpdateOptionalParams, + ProactiveDetectionConfigurationsUpdateResponse +} from "../models"; -/** Class representing a ProactiveDetectionConfigurations. */ -export class ProactiveDetectionConfigurations { - private readonly client: ApplicationInsightsManagementClientContext; +/** Class containing ProactiveDetectionConfigurations operations. */ +export class ProactiveDetectionConfigurationsImpl + implements ProactiveDetectionConfigurations { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a ProactiveDetectionConfigurations. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ProactiveDetectionConfigurations class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,107 +38,56 @@ export class ProactiveDetectionConfigurations { * Gets a list of ProactiveDetection configurations of an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list( + resourceGroupName: string, + resourceName: string, + options?: ProactiveDetectionConfigurationsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + listOperationSpec + ); } /** * Get the ProactiveDetection configuration for this configuration id. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param configurationId The ProactiveDetection configuration ID. This is unique within a - * Application Insights component. - * @param [options] The optional parameters - * @returns Promise + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application + * Insights component. + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, configurationId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param configurationId The ProactiveDetection configuration ID. This is unique within a - * Application Insights component. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, configurationId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param configurationId The ProactiveDetection configuration ID. This is unique within a - * Application Insights component. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, configurationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, configurationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + configurationId: string, + options?: ProactiveDetectionConfigurationsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - configurationId, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, configurationId, options }, + getOperationSpec + ); } /** * Update the ProactiveDetection configuration for this configuration id. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param configurationId The ProactiveDetection configuration ID. This is unique within a - * Application Insights component. - * @param proactiveDetectionProperties Properties that need to be specified to update the - * ProactiveDetection configuration. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, resourceName: string, configurationId: string, proactiveDetectionProperties: Models.ApplicationInsightsComponentProactiveDetectionConfiguration, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param configurationId The ProactiveDetection configuration ID. This is unique within a - * Application Insights component. - * @param proactiveDetectionProperties Properties that need to be specified to update the - * ProactiveDetection configuration. - * @param callback The callback - */ - update(resourceGroupName: string, resourceName: string, configurationId: string, proactiveDetectionProperties: Models.ApplicationInsightsComponentProactiveDetectionConfiguration, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param configurationId The ProactiveDetection configuration ID. This is unique within a - * Application Insights component. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application + * Insights component. * @param proactiveDetectionProperties Properties that need to be specified to update the - * ProactiveDetection configuration. - * @param options The optional parameters - * @param callback The callback + * ProactiveDetection configuration. + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, configurationId: string, proactiveDetectionProperties: Models.ApplicationInsightsComponentProactiveDetectionConfiguration, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, resourceName: string, configurationId: string, proactiveDetectionProperties: Models.ApplicationInsightsComponentProactiveDetectionConfiguration, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + resourceName: string, + configurationId: string, + proactiveDetectionProperties: ApplicationInsightsComponentProactiveDetectionConfiguration, + options?: ProactiveDetectionConfigurationsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -139,104 +96,84 @@ export class ProactiveDetectionConfigurations { proactiveDetectionProperties, options }, - updateOperationSpec, - callback) as Promise; + updateOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ApplicationInsightsComponentProactiveDetectionConfiguration" + className: + "ApplicationInsightsComponentProactiveDetectionConfiguration" } } } } - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}", + responses: { + 200: { + bodyMapper: + Mappers.ApplicationInsightsComponentProactiveDetectionConfiguration + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.configurationId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ApplicationInsightsComponentProactiveDetectionConfiguration - }, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: + Mappers.ApplicationInsightsComponentProactiveDetectionConfiguration } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}", + requestBody: Parameters.proactiveDetectionProperties, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.configurationId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "proactiveDetectionProperties", - mapper: { - ...Mappers.ApplicationInsightsComponentProactiveDetectionConfiguration, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.ApplicationInsightsComponentProactiveDetectionConfiguration - }, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/webTestLocations.ts b/sdk/applicationinsights/arm-appinsights/src/operations/webTestLocations.ts index ef40c1e72fab..8912fc13bd4e 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/webTestLocations.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/webTestLocations.ts @@ -1,28 +1,33 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/webTestLocationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { WebTestLocations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + ApplicationInsightsComponentWebTestLocation, + WebTestLocationsListOptionalParams, + WebTestLocationsListResponse +} from "../models"; -/** Class representing a WebTestLocations. */ -export class WebTestLocations { - private readonly client: ApplicationInsightsManagementClientContext; +/// +/** Class containing WebTestLocations operations. */ +export class WebTestLocationsImpl implements WebTestLocations { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a WebTestLocations. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class WebTestLocations class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,58 +35,86 @@ export class WebTestLocations { * Gets a list of web test locations available to this Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + public list( + resourceGroupName: string, + resourceName: string, + options?: WebTestLocationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, resourceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, resourceName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + resourceName: string, + options?: WebTestLocationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, resourceName, options); + yield result.value || []; + } + + private async *listPagingAll( + resourceGroupName: string, + resourceName: string, + options?: WebTestLocationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + /** + * Gets a list of web test locations available to this Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + resourceGroupName: string, + resourceName: string, + options?: WebTestLocationsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/syntheticmonitorlocations", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/syntheticmonitorlocations", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ApplicationInsightsWebTestLocationsListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/webTests.ts b/sdk/applicationinsights/arm-appinsights/src/operations/webTests.ts index cc6634172d90..55e465b089f4 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/webTests.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/webTests.ts @@ -1,128 +1,270 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/webTestsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { WebTests } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + WebTest, + WebTestsListByResourceGroupNextOptionalParams, + WebTestsListByResourceGroupOptionalParams, + WebTestsListNextOptionalParams, + WebTestsListOptionalParams, + WebTestsListByComponentNextOptionalParams, + WebTestsListByComponentOptionalParams, + WebTestsListByResourceGroupResponse, + WebTestsGetOptionalParams, + WebTestsGetResponse, + WebTestsCreateOrUpdateOptionalParams, + WebTestsCreateOrUpdateResponse, + TagsResource, + WebTestsUpdateTagsOptionalParams, + WebTestsUpdateTagsResponse, + WebTestsDeleteOptionalParams, + WebTestsListResponse, + WebTestsListByComponentResponse, + WebTestsListByResourceGroupNextResponse, + WebTestsListNextResponse, + WebTestsListByComponentNextResponse +} from "../models"; -/** Class representing a WebTests. */ -export class WebTests { - private readonly client: ApplicationInsightsManagementClientContext; +/// +/** Class containing WebTests operations. */ +export class WebTestsImpl implements WebTests { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a WebTests. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class WebTests class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } /** * Get all Application Insights web tests defined within a specified resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByResourceGroup( + resourceGroupName: string, + options?: WebTestsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: WebTestsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, + continuationToken, options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: WebTestsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Get a specific Application Insights web test definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param webTestName The name of the Application Insights webtest resource. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, webTestName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param webTestName The name of the Application Insights webtest resource. - * @param callback The callback + * Get all Application Insights web test alerts definitions within a subscription. + * @param options The options parameters. */ - get(resourceGroupName: string, webTestName: string, callback: msRest.ServiceCallback): void; + public list( + options?: WebTestsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: WebTestsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: WebTestsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** + * Get all Application Insights web tests defined for the specified component. + * @param componentName The name of the Application Insights component resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param webTestName The name of the Application Insights webtest resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, webTestName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, webTestName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByComponent( + componentName: string, + resourceGroupName: string, + options?: WebTestsListByComponentOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByComponentPagingAll( + componentName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByComponentPagingPage( + componentName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByComponentPagingPage( + componentName: string, + resourceGroupName: string, + options?: WebTestsListByComponentOptionalParams + ): AsyncIterableIterator { + let result = await this._listByComponent( + componentName, + resourceGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByComponentNext( + componentName, resourceGroupName, - webTestName, + continuationToken, options - }, - getOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByComponentPagingAll( + componentName: string, + resourceGroupName: string, + options?: WebTestsListByComponentOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByComponentPagingPage( + componentName, + resourceGroupName, + options + )) { + yield* page; + } } /** - * Creates or updates an Application Insights web test definition. + * Get all Application Insights web tests defined within a specified resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param webTestName The name of the Application Insights webtest resource. - * @param webTestDefinition Properties that need to be specified to create or update an Application - * Insights web test definition. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, webTestName: string, webTestDefinition: Models.WebTest, options?: msRest.RequestOptionsBase): Promise; + private _listByResourceGroup( + resourceGroupName: string, + options?: WebTestsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + /** + * Get a specific Application Insights web test definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param webTestName The name of the Application Insights webtest resource. - * @param webTestDefinition Properties that need to be specified to create or update an Application - * Insights web test definition. - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, webTestName: string, webTestDefinition: Models.WebTest, callback: msRest.ServiceCallback): void; + get( + resourceGroupName: string, + webTestName: string, + options?: WebTestsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, webTestName, options }, + getOperationSpec + ); + } + /** + * Creates or updates an Application Insights web test definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param webTestName The name of the Application Insights webtest resource. * @param webTestDefinition Properties that need to be specified to create or update an Application - * Insights web test definition. - * @param options The optional parameters - * @param callback The callback + * Insights web test definition. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, webTestName: string, webTestDefinition: Models.WebTest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, webTestName: string, webTestDefinition: Models.WebTest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + webTestName: string, + webTestDefinition: WebTest, + options?: WebTestsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - webTestName, - webTestDefinition, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, webTestName, webTestDefinition, options }, + createOrUpdateOperationSpec + ); } /** @@ -130,456 +272,294 @@ export class WebTests { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param webTestName The name of the Application Insights webtest resource. * @param webTestTags Updated tag information to set into the web test instance. - * @param [options] The optional parameters - * @returns Promise - */ - updateTags(resourceGroupName: string, webTestName: string, webTestTags: Models.TagsResource, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param webTestName The name of the Application Insights webtest resource. - * @param webTestTags Updated tag information to set into the web test instance. - * @param callback The callback - */ - updateTags(resourceGroupName: string, webTestName: string, webTestTags: Models.TagsResource, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param webTestName The name of the Application Insights webtest resource. - * @param webTestTags Updated tag information to set into the web test instance. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - updateTags(resourceGroupName: string, webTestName: string, webTestTags: Models.TagsResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - updateTags(resourceGroupName: string, webTestName: string, webTestTags: Models.TagsResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + updateTags( + resourceGroupName: string, + webTestName: string, + webTestTags: TagsResource, + options?: WebTestsUpdateTagsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - webTestName, - webTestTags, - options - }, - updateTagsOperationSpec, - callback) as Promise; + { resourceGroupName, webTestName, webTestTags, options }, + updateTagsOperationSpec + ); } /** * Deletes an Application Insights web test. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param webTestName The name of the Application Insights webtest resource. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, webTestName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param webTestName The name of the Application Insights webtest resource. - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, webTestName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param webTestName The name of the Application Insights webtest resource. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, webTestName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, webTestName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + webTestName: string, + options?: WebTestsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - webTestName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, webTestName, options }, + deleteOperationSpec + ); } /** * Get all Application Insights web test alerts definitions within a subscription. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + private _list( + options?: WebTestsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } /** * Get all Application Insights web tests defined for the specified component. * @param componentName The name of the Application Insights component resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise - */ - listByComponent(componentName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param componentName The name of the Application Insights component resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param callback The callback - */ - listByComponent(componentName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param componentName The name of the Application Insights component resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByComponent(componentName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByComponent(componentName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByComponent( + componentName: string, + resourceGroupName: string, + options?: WebTestsListByComponentOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - componentName, - resourceGroupName, - options - }, - listByComponentOperationSpec, - callback) as Promise; + { componentName, resourceGroupName, options }, + listByComponentOperationSpec + ); } /** - * Get all Application Insights web tests defined within a specified resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: WebTestsListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } /** - * Get all Application Insights web test alerts definitions within a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: WebTestsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } /** - * Get all Application Insights web tests defined for the specified component. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByComponentNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByComponentNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByComponentNext + * @param componentName The name of the Application Insights component resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByComponent method. + * @param options The options parameters. */ - listByComponentNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByComponentNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByComponentNext( + componentName: string, + resourceGroupName: string, + nextLink: string, + options?: WebTestsListByComponentNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByComponentNextOperationSpec, - callback) as Promise; + { componentName, resourceGroupName, nextLink, options }, + listByComponentNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.WebTestListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.webTestName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.WebTest - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.webTestName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "webTestDefinition", - mapper: { - ...Mappers.WebTest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.WebTest - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateTagsOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", + requestBody: Parameters.webTestDefinition, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.webTestName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "webTestTags", - mapper: { - ...Mappers.TagsResource, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateTagsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.WebTest - }, - default: { - bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.webTestTags, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.webTestName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const deleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", + responses: { 200: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.webTestName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; - -const listOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/webtests", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Insights/webtests", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.WebTestListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByComponentOperationSpec: msRest.OperationSpec = { +const listByComponentOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{componentName}/webtests", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{componentName}/webtests", - urlParameters: [ - Parameters.componentName, - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.WebTestListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.componentName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.WebTestListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.WebTestListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listByComponentNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByComponentNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.WebTestListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.componentName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/workItemConfigurations.ts b/sdk/applicationinsights/arm-appinsights/src/operations/workItemConfigurations.ts index f3d0751cbcde..2d9cf5ac145f 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/workItemConfigurations.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/workItemConfigurations.ts @@ -1,28 +1,43 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/workItemConfigurationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { WorkItemConfigurations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + WorkItemConfiguration, + WorkItemConfigurationsListOptionalParams, + WorkItemConfigurationsListResponse, + WorkItemCreateConfiguration, + WorkItemConfigurationsCreateOptionalParams, + WorkItemConfigurationsCreateResponse, + WorkItemConfigurationsGetDefaultOptionalParams, + WorkItemConfigurationsGetDefaultResponse, + WorkItemConfigurationsDeleteOptionalParams, + WorkItemConfigurationsGetItemOptionalParams, + WorkItemConfigurationsGetItemResponse, + WorkItemConfigurationsUpdateItemOptionalParams, + WorkItemConfigurationsUpdateItemResponse +} from "../models"; -/** Class representing a WorkItemConfigurations. */ -export class WorkItemConfigurations { - private readonly client: ApplicationInsightsManagementClientContext; +/// +/** Class containing WorkItemConfigurations operations. */ +export class WorkItemConfigurationsImpl implements WorkItemConfigurations { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a WorkItemConfigurations. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class WorkItemConfigurations class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } @@ -30,62 +45,81 @@ export class WorkItemConfigurations { * Gets the list work item configurations that exist for the application * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - list(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + public list( + resourceGroupName: string, + resourceName: string, + options?: WorkItemConfigurationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, resourceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, resourceName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + resourceName: string, + options?: WorkItemConfigurationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, resourceName, options); + yield result.value || []; + } + + private async *listPagingAll( + resourceGroupName: string, + resourceName: string, + options?: WorkItemConfigurationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + /** + * Gets the list work item configurations that exist for the application * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + resourceGroupName: string, + resourceName: string, + options?: WorkItemConfigurationsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + listOperationSpec + ); } /** * Create a work item configuration for an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigurationProperties Properties that need to be specified to create a work - * item configuration of a Application Insights component. - * @param [options] The optional parameters - * @returns Promise + * @param workItemConfigurationProperties Properties that need to be specified to create a work item + * configuration of a Application Insights component. + * @param options The options parameters. */ - create(resourceGroupName: string, resourceName: string, workItemConfigurationProperties: Models.WorkItemCreateConfiguration, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigurationProperties Properties that need to be specified to create a work - * item configuration of a Application Insights component. - * @param callback The callback - */ - create(resourceGroupName: string, resourceName: string, workItemConfigurationProperties: Models.WorkItemCreateConfiguration, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigurationProperties Properties that need to be specified to create a work - * item configuration of a Application Insights component. - * @param options The optional parameters - * @param callback The callback - */ - create(resourceGroupName: string, resourceName: string, workItemConfigurationProperties: Models.WorkItemCreateConfiguration, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - create(resourceGroupName: string, resourceName: string, workItemConfigurationProperties: Models.WorkItemCreateConfiguration, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + create( + resourceGroupName: string, + resourceName: string, + workItemConfigurationProperties: WorkItemCreateConfiguration, + options?: WorkItemConfigurationsCreateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -93,154 +127,84 @@ export class WorkItemConfigurations { workItemConfigurationProperties, options }, - createOperationSpec, - callback) as Promise; + createOperationSpec + ); } /** * Gets default work item configurations that exist for the application * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getDefault(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - getDefault(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback - */ - getDefault(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getDefault(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getDefault( + resourceGroupName: string, + resourceName: string, + options?: WorkItemConfigurationsGetDefaultOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getDefaultOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + getDefaultOperationSpec + ); } /** * Delete a work item configuration of an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigId The unique work item configuration Id. This can be either friendly name - * of connector as defined in connector configuration - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, resourceName: string, workItemConfigId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigId The unique work item configuration Id. This can be either friendly name - * of connector as defined in connector configuration - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, resourceName: string, workItemConfigId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigId The unique work item configuration Id. This can be either friendly name - * of connector as defined in connector configuration - * @param options The optional parameters - * @param callback The callback + * @param workItemConfigId The unique work item configuration Id. This can be either friendly name of + * connector as defined in connector configuration + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, workItemConfigId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceName: string, workItemConfigId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + resourceName: string, + workItemConfigId: string, + options?: WorkItemConfigurationsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - workItemConfigId, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, resourceName, workItemConfigId, options }, + deleteOperationSpec + ); } /** * Gets specified work item configuration for an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigId The unique work item configuration Id. This can be either friendly name - * of connector as defined in connector configuration - * @param [options] The optional parameters - * @returns Promise + * @param workItemConfigId The unique work item configuration Id. This can be either friendly name of + * connector as defined in connector configuration + * @param options The options parameters. */ - getItem(resourceGroupName: string, resourceName: string, workItemConfigId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigId The unique work item configuration Id. This can be either friendly name - * of connector as defined in connector configuration - * @param callback The callback - */ - getItem(resourceGroupName: string, resourceName: string, workItemConfigId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigId The unique work item configuration Id. This can be either friendly name - * of connector as defined in connector configuration - * @param options The optional parameters - * @param callback The callback - */ - getItem(resourceGroupName: string, resourceName: string, workItemConfigId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getItem(resourceGroupName: string, resourceName: string, workItemConfigId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getItem( + resourceGroupName: string, + resourceName: string, + workItemConfigId: string, + options?: WorkItemConfigurationsGetItemOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - workItemConfigId, - options - }, - getItemOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, workItemConfigId, options }, + getItemOperationSpec + ); } /** * Update a work item configuration for an Application Insights component. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigId The unique work item configuration Id. This can be either friendly name - * of connector as defined in connector configuration - * @param workItemConfigurationProperties Properties that need to be specified to update a work - * item configuration for this Application Insights component. - * @param [options] The optional parameters - * @returns Promise + * @param workItemConfigId The unique work item configuration Id. This can be either friendly name of + * connector as defined in connector configuration + * @param workItemConfigurationProperties Properties that need to be specified to update a work item + * configuration for this Application Insights component. + * @param options The options parameters. */ - updateItem(resourceGroupName: string, resourceName: string, workItemConfigId: string, workItemConfigurationProperties: Models.WorkItemCreateConfiguration, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigId The unique work item configuration Id. This can be either friendly name - * of connector as defined in connector configuration - * @param workItemConfigurationProperties Properties that need to be specified to update a work - * item configuration for this Application Insights component. - * @param callback The callback - */ - updateItem(resourceGroupName: string, resourceName: string, workItemConfigId: string, workItemConfigurationProperties: Models.WorkItemCreateConfiguration, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workItemConfigId The unique work item configuration Id. This can be either friendly name - * of connector as defined in connector configuration - * @param workItemConfigurationProperties Properties that need to be specified to update a work - * item configuration for this Application Insights component. - * @param options The optional parameters - * @param callback The callback - */ - updateItem(resourceGroupName: string, resourceName: string, workItemConfigId: string, workItemConfigurationProperties: Models.WorkItemCreateConfiguration, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - updateItem(resourceGroupName: string, resourceName: string, workItemConfigId: string, workItemConfigurationProperties: Models.WorkItemCreateConfiguration, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + updateItem( + resourceGroupName: string, + resourceName: string, + workItemConfigId: string, + workItemConfigurationProperties: WorkItemCreateConfiguration, + options?: WorkItemConfigurationsUpdateItemOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -249,27 +213,17 @@ export class WorkItemConfigurations { workItemConfigurationProperties, options }, - updateItemOperationSpec, - callback) as Promise; + updateItemOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.WorkItemConfigurationsListResult @@ -278,145 +232,110 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.WorkItemConfigurationError } }, - serializer -}; - -const createOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "workItemConfigurationProperties", - mapper: { - ...Mappers.WorkItemCreateConfiguration, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.WorkItemConfiguration - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getDefaultOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/DefaultWorkItemConfig", + requestBody: Parameters.workItemConfigurationProperties, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getDefaultOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/DefaultWorkItemConfig", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.WorkItemConfiguration - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const deleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}", + responses: { 200: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.workItemConfigId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; - -const getItemOperationSpec: msRest.OperationSpec = { +const getItemOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}", + responses: { + 200: { + bodyMapper: Mappers.WorkItemConfiguration + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.workItemConfigId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const updateItemOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.WorkItemConfiguration - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateItemOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}", + requestBody: Parameters.workItemConfigurationProperties, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.resourceName, Parameters.workItemConfigId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "workItemConfigurationProperties", - mapper: { - ...Mappers.WorkItemCreateConfiguration, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.WorkItemConfiguration - }, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/workbookTemplates.ts b/sdk/applicationinsights/arm-appinsights/src/operations/workbookTemplates.ts new file mode 100644 index 000000000000..3fdc8f677ed2 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operations/workbookTemplates.ts @@ -0,0 +1,286 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { WorkbookTemplates } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + WorkbookTemplate, + WorkbookTemplatesListByResourceGroupOptionalParams, + WorkbookTemplatesListByResourceGroupResponse, + WorkbookTemplatesGetOptionalParams, + WorkbookTemplatesGetResponse, + WorkbookTemplatesDeleteOptionalParams, + WorkbookTemplatesCreateOrUpdateOptionalParams, + WorkbookTemplatesCreateOrUpdateResponse, + WorkbookTemplatesUpdateOptionalParams, + WorkbookTemplatesUpdateResponse +} from "../models"; + +/// +/** Class containing WorkbookTemplates operations. */ +export class WorkbookTemplatesImpl implements WorkbookTemplates { + private readonly client: ApplicationInsightsManagementClient; + + /** + * Initialize a new instance of the class WorkbookTemplates class. + * @param client Reference to the service client + */ + constructor(client: ApplicationInsightsManagementClient) { + this.client = client; + } + + /** + * Get all Workbook templates defined within a specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: WorkbookTemplatesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: WorkbookTemplatesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: WorkbookTemplatesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get all Workbook templates defined within a specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: WorkbookTemplatesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Get a single workbook template by its resourceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: WorkbookTemplatesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + getOperationSpec + ); + } + + /** + * Delete a workbook template. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + options?: WorkbookTemplatesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + deleteOperationSpec + ); + } + + /** + * Create a new workbook template. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookTemplateProperties Properties that need to be specified to create a new workbook. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + resourceName: string, + workbookTemplateProperties: WorkbookTemplate, + options?: WorkbookTemplatesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, workbookTemplateProperties, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Updates a workbook template that has already been added. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + options?: WorkbookTemplatesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + updateOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkbookTemplatesListResult + }, + default: { + bodyMapper: Mappers.WorkbookTemplateError + } + }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkbookTemplate + }, + default: { + bodyMapper: Mappers.WorkbookTemplateError + } + }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.WorkbookTemplateError + } + }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.WorkbookTemplate + }, + 201: { + bodyMapper: Mappers.WorkbookTemplate + }, + default: { + bodyMapper: Mappers.WorkbookTemplateError + } + }, + requestBody: Parameters.workbookTemplateProperties, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.WorkbookTemplate + }, + default: { + bodyMapper: Mappers.WorkbookTemplateError + } + }, + requestBody: Parameters.workbookTemplateUpdateParameters, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/workbooks.ts b/sdk/applicationinsights/arm-appinsights/src/operations/workbooks.ts index 7d11428584ba..7848b59c2d8d 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/workbooks.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/workbooks.ts @@ -1,128 +1,315 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/workbooksMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Workbooks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClientContext } from "../applicationInsightsManagementClientContext"; +import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; +import { + Workbook, + CategoryType, + WorkbooksListBySubscriptionNextOptionalParams, + WorkbooksListBySubscriptionOptionalParams, + WorkbooksListByResourceGroupNextOptionalParams, + WorkbooksListByResourceGroupOptionalParams, + WorkbooksRevisionsListNextOptionalParams, + WorkbooksRevisionsListOptionalParams, + WorkbooksListBySubscriptionResponse, + WorkbooksListByResourceGroupResponse, + WorkbooksGetOptionalParams, + WorkbooksGetResponse, + WorkbooksDeleteOptionalParams, + WorkbooksCreateOrUpdateOptionalParams, + WorkbooksCreateOrUpdateResponse, + WorkbooksUpdateOptionalParams, + WorkbooksUpdateResponse, + WorkbooksRevisionsListResponse, + WorkbooksRevisionGetOptionalParams, + WorkbooksRevisionGetResponse, + WorkbooksListBySubscriptionNextResponse, + WorkbooksListByResourceGroupNextResponse, + WorkbooksRevisionsListNextResponse +} from "../models"; -/** Class representing a Workbooks. */ -export class Workbooks { - private readonly client: ApplicationInsightsManagementClientContext; +/// +/** Class containing Workbooks operations. */ +export class WorkbooksImpl implements Workbooks { + private readonly client: ApplicationInsightsManagementClient; /** - * Create a Workbooks. - * @param {ApplicationInsightsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Workbooks class. + * @param client Reference to the service client */ - constructor(client: ApplicationInsightsManagementClientContext) { + constructor(client: ApplicationInsightsManagementClient) { this.client = client; } /** - * Get all Workbooks defined within a specified resource group and category. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', - * 'performance', 'retention' - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, category: Models.CategoryType, options?: Models.WorkbooksListByResourceGroupOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', - * 'performance', 'retention' - * @param callback The callback + * Get all private workbooks defined within a specified subscription and category. + * @param category Category of workbook to return. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, category: Models.CategoryType, callback: msRest.ServiceCallback): void; + public listBySubscription( + category: CategoryType, + options?: WorkbooksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(category, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(category, options); + } + }; + } + + private async *listBySubscriptionPagingPage( + category: CategoryType, + options?: WorkbooksListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(category, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext( + category, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + category: CategoryType, + options?: WorkbooksListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage( + category, + options + )) { + yield* page; + } + } + /** + * Get all Workbooks defined within a specified resource group and category. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', - * 'performance', 'retention' - * @param options The optional parameters - * @param callback The callback + * @param category Category of workbook to return. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, category: Models.CategoryType, options: Models.WorkbooksListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, category: Models.CategoryType, options?: Models.WorkbooksListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByResourceGroup( + resourceGroupName: string, + category: CategoryType, + options?: WorkbooksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll( + resourceGroupName, + category, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage( + resourceGroupName, + category, + options + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + category: CategoryType, + options?: WorkbooksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup( + resourceGroupName, + category, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, category, + continuationToken, options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + category: CategoryType, + options?: WorkbooksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + category, + options + )) { + yield* page; + } } /** - * Get a single workbook by its resourceName. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** + * Get the revisions for the workbook defined by its resourceName. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listRevisionsList( + resourceGroupName: string, + resourceName: string, + options?: WorkbooksRevisionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.revisionsListPagingAll( + resourceGroupName, + resourceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.revisionsListPagingPage( + resourceGroupName, + resourceName, + options + ); + } + }; + } + + private async *revisionsListPagingPage( + resourceGroupName: string, + resourceName: string, + options?: WorkbooksRevisionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._revisionsList( + resourceGroupName, + resourceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._revisionsListNext( resourceGroupName, resourceName, + continuationToken, options - }, - getOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *revisionsListPagingAll( + resourceGroupName: string, + resourceName: string, + options?: WorkbooksRevisionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.revisionsListPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } } /** - * Delete a workbook. + * Get all private workbooks defined within a specified subscription and category. + * @param category Category of workbook to return. + * @param options The options parameters. + */ + private _listBySubscription( + category: CategoryType, + options?: WorkbooksListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { category, options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Get all Workbooks defined within a specified resource group and category. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param [options] The optional parameters - * @returns Promise + * @param category Category of workbook to return. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + private _listByResourceGroup( + resourceGroupName: string, + category: CategoryType, + options?: WorkbooksListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, category, options }, + listByResourceGroupOperationSpec + ); + } + /** + * Get a single workbook by its resourceName. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + get( + resourceGroupName: string, + resourceName: string, + options?: WorkbooksGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + getOperationSpec + ); + } + /** + * Delete a workbook. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + resourceName: string, + options?: WorkbooksDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, resourceName, options }, + deleteOperationSpec + ); } /** @@ -130,92 +317,135 @@ export class Workbooks { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new workbook. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, resourceName: string, workbookProperties: Models.Workbook, options?: msRest.RequestOptionsBase): Promise; + createOrUpdate( + resourceGroupName: string, + resourceName: string, + workbookProperties: Workbook, + options?: WorkbooksCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, workbookProperties, options }, + createOrUpdateOperationSpec + ); + } + /** + * Updates a workbook that has already been added. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param workbookProperties Properties that need to be specified to create a new workbook. - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, resourceName: string, workbookProperties: Models.Workbook, callback: msRest.ServiceCallback): void; + update( + resourceGroupName: string, + resourceName: string, + options?: WorkbooksUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + updateOperationSpec + ); + } + /** + * Get the revisions for the workbook defined by its resourceName. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param workbookProperties Properties that need to be specified to create a new workbook. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, resourceName: string, workbookProperties: Models.Workbook, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, resourceName: string, workbookProperties: Models.Workbook, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _revisionsList( + resourceGroupName: string, + resourceName: string, + options?: WorkbooksRevisionsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - workbookProperties, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + revisionsListOperationSpec + ); } /** - * Updates a workbook that has already been added. + * Get a single workbook revision defined by its revisionId. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param workbookProperties Properties that need to be specified to create a new workbook. - * @param [options] The optional parameters - * @returns Promise + * @param revisionId The id of the workbook's revision. + * @param options The options parameters. + */ + revisionGet( + resourceGroupName: string, + resourceName: string, + revisionId: string, + options?: WorkbooksRevisionGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, revisionId, options }, + revisionGetOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param category Category of workbook to return. + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, workbookProperties: Models.Workbook, options?: msRest.RequestOptionsBase): Promise; + private _listBySubscriptionNext( + category: CategoryType, + nextLink: string, + options?: WorkbooksListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { category, nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + /** + * ListByResourceGroupNext * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workbookProperties Properties that need to be specified to create a new workbook. - * @param callback The callback + * @param category Category of workbook to return. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, workbookProperties: Models.Workbook, callback: msRest.ServiceCallback): void; + private _listByResourceGroupNext( + resourceGroupName: string, + category: CategoryType, + nextLink: string, + options?: WorkbooksListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, category, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + /** + * RevisionsListNext * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param workbookProperties Properties that need to be specified to create a new workbook. - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the RevisionsList method. + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, workbookProperties: Models.Workbook, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, resourceName: string, workbookProperties: Models.Workbook, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _revisionsListNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: WorkbooksRevisionsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - workbookProperties, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, nextLink, options }, + revisionsListNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/workbooks", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.category, - Parameters.tags, - Parameters.canFetchContent, - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.WorkbooksListResult @@ -224,23 +454,47 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.WorkbookError } }, + queryParameters: [ + Parameters.canFetchContent, + Parameters.tags, + Parameters.category, + Parameters.apiVersion3 + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], + responses: { + 200: { + bodyMapper: Mappers.WorkbooksListResult + }, + default: { + bodyMapper: Mappers.WorkbookError + } + }, queryParameters: [ - Parameters.apiVersion0 + Parameters.canFetchContent, + Parameters.tags, + Parameters.category, + Parameters.sourceId, + Parameters.apiVersion3 ], - headerParameters: [ - Parameters.acceptLanguage + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Workbook @@ -249,54 +503,41 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.WorkbookError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", + queryParameters: [Parameters.apiVersion3], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}", + httpMethod: "DELETE", responses: { - 201: {}, + 200: {}, 204: {}, default: { bodyMapper: Mappers.WorkbookError } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", + queryParameters: [Parameters.apiVersion3], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "workbookProperties", - mapper: { - ...Mappers.Workbook, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Workbook @@ -308,37 +549,158 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.WorkbookError } }, + requestBody: Parameters.workbookProperties1, + queryParameters: [Parameters.sourceId, Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const updateOperationSpec: msRest.OperationSpec = { +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}", httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", + responses: { + 201: { + bodyMapper: Mappers.Workbook + }, + default: { + bodyMapper: Mappers.WorkbookError + } + }, + requestBody: Parameters.workbookUpdateParameters, + queryParameters: [Parameters.sourceId, Parameters.apiVersion3], urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const revisionsListOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}/revisions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkbooksListResult + }, + default: { + bodyMapper: Mappers.WorkbookError + } + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.resourceName ], + headerParameters: [Parameters.accept], + serializer +}; +const revisionGetOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}/revisions/{revisionId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Workbook + }, + default: { + bodyMapper: Mappers.WorkbookError + } + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName, + Parameters.revisionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkbooksListResult + }, + default: { + bodyMapper: Mappers.WorkbookError + } + }, queryParameters: [ - Parameters.apiVersion0 + Parameters.canFetchContent, + Parameters.tags, + Parameters.category, + Parameters.apiVersion3 ], - headerParameters: [ - Parameters.acceptLanguage + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink ], - requestBody: { - parameterPath: "workbookProperties", - mapper: { - ...Mappers.Workbook, - required: true + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkbooksListResult + }, + default: { + bodyMapper: Mappers.WorkbookError } }, + queryParameters: [ + Parameters.canFetchContent, + Parameters.tags, + Parameters.category, + Parameters.sourceId, + Parameters.apiVersion3 + ], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const revisionsListNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Workbook + bodyMapper: Mappers.WorkbooksListResult }, default: { bodyMapper: Mappers.WorkbookError } }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/aPIKeys.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/aPIKeys.ts new file mode 100644 index 000000000000..a8b25dfdecee --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/aPIKeys.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ApplicationInsightsComponentAPIKey, + APIKeysListOptionalParams, + APIKeyRequest, + APIKeysCreateOptionalParams, + APIKeysCreateResponse, + APIKeysDeleteOptionalParams, + APIKeysDeleteResponse, + APIKeysGetOptionalParams, + APIKeysGetResponse +} from "../models"; + +/// +/** Interface representing a APIKeys. */ +export interface APIKeys { + /** + * Gets a list of API keys of an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: APIKeysListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create an API Key of an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param aPIKeyProperties Properties that need to be specified to create an API key of a Application + * Insights component. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + resourceName: string, + aPIKeyProperties: APIKeyRequest, + options?: APIKeysCreateOptionalParams + ): Promise; + /** + * Delete an API Key of an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + keyId: string, + options?: APIKeysDeleteOptionalParams + ): Promise; + /** + * Get the API Key for this key id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + keyId: string, + options?: APIKeysGetOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/analyticsItems.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/analyticsItems.ts new file mode 100644 index 000000000000..54710d4939e3 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/analyticsItems.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + ItemScopePath, + AnalyticsItemsListOptionalParams, + AnalyticsItemsListResponse, + AnalyticsItemsGetOptionalParams, + AnalyticsItemsGetResponse, + ApplicationInsightsComponentAnalyticsItem, + AnalyticsItemsPutOptionalParams, + AnalyticsItemsPutResponse, + AnalyticsItemsDeleteOptionalParams +} from "../models"; + +/** Interface representing a AnalyticsItems. */ +export interface AnalyticsItems { + /** + * Gets a list of Analytics Items defined within an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared + * between all users with access to the Application Insights component. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + scopePath: ItemScopePath, + options?: AnalyticsItemsListOptionalParams + ): Promise; + /** + * Gets a specific Analytics Items defined within an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared + * between all users with access to the Application Insights component. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + scopePath: ItemScopePath, + options?: AnalyticsItemsGetOptionalParams + ): Promise; + /** + * Adds or Updates a specific Analytics Item within an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared + * between all users with access to the Application Insights component. + * @param itemProperties Properties that need to be specified to create a new item and add it to an + * Application Insights component. + * @param options The options parameters. + */ + put( + resourceGroupName: string, + resourceName: string, + scopePath: ItemScopePath, + itemProperties: ApplicationInsightsComponentAnalyticsItem, + options?: AnalyticsItemsPutOptionalParams + ): Promise; + /** + * Deletes a specific Analytics Items defined within an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared + * between all users with access to the Application Insights component. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + scopePath: ItemScopePath, + options?: AnalyticsItemsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/annotations.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/annotations.ts new file mode 100644 index 000000000000..96629458740f --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/annotations.ts @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Annotation, + AnnotationsListOptionalParams, + AnnotationsCreateOptionalParams, + AnnotationsCreateResponse, + AnnotationsDeleteOptionalParams, + AnnotationsGetOptionalParams, + AnnotationsGetResponse +} from "../models"; + +/// +/** Interface representing a Annotations. */ +export interface Annotations { + /** + * Gets the list of annotations for a component for given time range + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param start The start time to query from for annotations, cannot be older than 90 days from current + * date. + * @param end The end time to query for annotations. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + start: string, + end: string, + options?: AnnotationsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create an Annotation of an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param annotationProperties Properties that need to be specified to create an annotation of a + * Application Insights component. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + resourceName: string, + annotationProperties: Annotation, + options?: AnnotationsCreateOptionalParams + ): Promise; + /** + * Delete an Annotation of an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights + * component. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + annotationId: string, + options?: AnnotationsDeleteOptionalParams + ): Promise; + /** + * Get the annotation for given id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights + * component. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + annotationId: string, + options?: AnnotationsGetOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentAvailableFeatures.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentAvailableFeatures.ts new file mode 100644 index 000000000000..d3880d894bff --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentAvailableFeatures.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + ComponentAvailableFeaturesGetOptionalParams, + ComponentAvailableFeaturesGetResponse +} from "../models"; + +/** Interface representing a ComponentAvailableFeatures. */ +export interface ComponentAvailableFeatures { + /** + * Returns all available features of the application insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: ComponentAvailableFeaturesGetOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentCurrentBillingFeatures.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentCurrentBillingFeatures.ts new file mode 100644 index 000000000000..e2a617e46a21 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentCurrentBillingFeatures.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + ComponentCurrentBillingFeaturesGetOptionalParams, + ComponentCurrentBillingFeaturesGetResponse, + ApplicationInsightsComponentBillingFeatures, + ComponentCurrentBillingFeaturesUpdateOptionalParams, + ComponentCurrentBillingFeaturesUpdateResponse +} from "../models"; + +/** Interface representing a ComponentCurrentBillingFeatures. */ +export interface ComponentCurrentBillingFeatures { + /** + * Returns current billing features for an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: ComponentCurrentBillingFeaturesGetOptionalParams + ): Promise; + /** + * Update current billing features for an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param billingFeaturesProperties Properties that need to be specified to update billing features for + * an Application Insights component. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + billingFeaturesProperties: ApplicationInsightsComponentBillingFeatures, + options?: ComponentCurrentBillingFeaturesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentFeatureCapabilities.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentFeatureCapabilities.ts new file mode 100644 index 000000000000..0ca1c39b7be6 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentFeatureCapabilities.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + ComponentFeatureCapabilitiesGetOptionalParams, + ComponentFeatureCapabilitiesGetResponse +} from "../models"; + +/** Interface representing a ComponentFeatureCapabilities. */ +export interface ComponentFeatureCapabilities { + /** + * Returns feature capabilities of the application insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: ComponentFeatureCapabilitiesGetOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentLinkedStorageAccountsOperations.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentLinkedStorageAccountsOperations.ts new file mode 100644 index 000000000000..4635a3f43fa7 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentLinkedStorageAccountsOperations.ts @@ -0,0 +1,86 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + StorageType, + ComponentLinkedStorageAccountsGetOptionalParams, + ComponentLinkedStorageAccountsGetResponse, + ComponentLinkedStorageAccounts, + ComponentLinkedStorageAccountsCreateAndUpdateOptionalParams, + ComponentLinkedStorageAccountsCreateAndUpdateResponse, + ComponentLinkedStorageAccountsPatch, + ComponentLinkedStorageAccountsUpdateOptionalParams, + ComponentLinkedStorageAccountsUpdateResponse, + ComponentLinkedStorageAccountsDeleteOptionalParams +} from "../models"; + +/** Interface representing a ComponentLinkedStorageAccountsOperations. */ +export interface ComponentLinkedStorageAccountsOperations { + /** + * Returns the current linked storage settings for an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage + * account. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + storageType: StorageType, + options?: ComponentLinkedStorageAccountsGetOptionalParams + ): Promise; + /** + * Replace current linked storage account for an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage + * account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage + * accounts for an Application Insights component. + * @param options The options parameters. + */ + createAndUpdate( + resourceGroupName: string, + resourceName: string, + storageType: StorageType, + linkedStorageAccountsProperties: ComponentLinkedStorageAccounts, + options?: ComponentLinkedStorageAccountsCreateAndUpdateOptionalParams + ): Promise; + /** + * Update linked storage accounts for an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage + * account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked + * storage accounts for an Application Insights component. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + storageType: StorageType, + linkedStorageAccountsProperties: ComponentLinkedStorageAccountsPatch, + options?: ComponentLinkedStorageAccountsUpdateOptionalParams + ): Promise; + /** + * Delete linked storage accounts for an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage + * account. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + storageType: StorageType, + options?: ComponentLinkedStorageAccountsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentQuotaStatus.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentQuotaStatus.ts new file mode 100644 index 000000000000..0eea4b49a2b7 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/componentQuotaStatus.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + ComponentQuotaStatusGetOptionalParams, + ComponentQuotaStatusGetResponse +} from "../models"; + +/** Interface representing a ComponentQuotaStatus. */ +export interface ComponentQuotaStatus { + /** + * Returns daily data volume cap (quota) status for an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: ComponentQuotaStatusGetOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/components.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/components.ts new file mode 100644 index 000000000000..84fb14b12d30 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/components.ts @@ -0,0 +1,131 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ApplicationInsightsComponent, + ComponentsListOptionalParams, + ComponentsListByResourceGroupOptionalParams, + ComponentsDeleteOptionalParams, + ComponentsGetOptionalParams, + ComponentsGetResponse, + ComponentsCreateOrUpdateOptionalParams, + ComponentsCreateOrUpdateResponse, + TagsResource, + ComponentsUpdateTagsOptionalParams, + ComponentsUpdateTagsResponse, + ComponentPurgeBody, + ComponentsPurgeOptionalParams, + ComponentsPurgeResponse, + ComponentsGetPurgeStatusOptionalParams, + ComponentsGetPurgeStatusResponse +} from "../models"; + +/// +/** Interface representing a Components. */ +export interface Components { + /** + * Gets a list of all Application Insights components within a subscription. + * @param options The options parameters. + */ + list( + options?: ComponentsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a list of Application Insights components within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ComponentsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Deletes an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + options?: ComponentsDeleteOptionalParams + ): Promise; + /** + * Returns an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: ComponentsGetOptionalParams + ): Promise; + /** + * Creates (or updates) an Application Insights component. Note: You cannot specify a different value + * for InstrumentationKey nor AppId in the Put operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param insightProperties Properties that need to be specified to create an Application Insights + * component. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + resourceName: string, + insightProperties: ApplicationInsightsComponent, + options?: ComponentsCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param componentTags Updated tag information to set into the component instance. + * @param options The options parameters. + */ + updateTags( + resourceGroupName: string, + resourceName: string, + componentTags: TagsResource, + options?: ComponentsUpdateTagsOptionalParams + ): Promise; + /** + * Purges data in an Application Insights component by a set of user-defined filters. + * + * In order to manage system resources, purge requests are throttled at 50 requests per hour. You + * should batch the execution of purge requests by sending a single command whose predicate includes + * all user identities that require purging. Use the in operator to specify multiple identities. You + * should run the query prior to using for a purge request to verify that the results are expected. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param body Describes the body of a request to purge data in a single table of an Application + * Insights component + * @param options The options parameters. + */ + purge( + resourceGroupName: string, + resourceName: string, + body: ComponentPurgeBody, + options?: ComponentsPurgeOptionalParams + ): Promise; + /** + * Get status for an ongoing purge operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param purgeId In a purge status request, this is the Id of the operation the status of which is + * returned. + * @param options The options parameters. + */ + getPurgeStatus( + resourceGroupName: string, + resourceName: string, + purgeId: string, + options?: ComponentsGetPurgeStatusOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/exportConfigurations.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/exportConfigurations.ts new file mode 100644 index 000000000000..a9a3edcf01fa --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/exportConfigurations.ts @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + ExportConfigurationsListOptionalParams, + ExportConfigurationsListResponse, + ApplicationInsightsComponentExportRequest, + ExportConfigurationsCreateOptionalParams, + ExportConfigurationsCreateResponse, + ExportConfigurationsDeleteOptionalParams, + ExportConfigurationsDeleteResponse, + ExportConfigurationsGetOptionalParams, + ExportConfigurationsGetResponse, + ExportConfigurationsUpdateOptionalParams, + ExportConfigurationsUpdateResponse +} from "../models"; + +/** Interface representing a ExportConfigurations. */ +export interface ExportConfigurations { + /** + * Gets a list of Continuous Export configuration of an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: ExportConfigurationsListOptionalParams + ): Promise; + /** + * Create a Continuous Export configuration of an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param exportProperties Properties that need to be specified to create a Continuous Export + * configuration of a Application Insights component. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + resourceName: string, + exportProperties: ApplicationInsightsComponentExportRequest, + options?: ExportConfigurationsCreateOptionalParams + ): Promise; + /** + * Delete a Continuous Export configuration of an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights + * component. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + exportId: string, + options?: ExportConfigurationsDeleteOptionalParams + ): Promise; + /** + * Get the Continuous Export configuration for this export id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights + * component. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + exportId: string, + options?: ExportConfigurationsGetOptionalParams + ): Promise; + /** + * Update the Continuous Export configuration for this export id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights + * component. + * @param exportProperties Properties that need to be specified to update the Continuous Export + * configuration. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + exportId: string, + exportProperties: ApplicationInsightsComponentExportRequest, + options?: ExportConfigurationsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/favorites.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/favorites.ts new file mode 100644 index 000000000000..5ad0be7a2dd9 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/favorites.ts @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + FavoritesListOptionalParams, + FavoritesListResponse, + FavoritesGetOptionalParams, + FavoritesGetResponse, + ApplicationInsightsComponentFavorite, + FavoritesAddOptionalParams, + FavoritesAddResponse, + FavoritesUpdateOptionalParams, + FavoritesUpdateResponse, + FavoritesDeleteOptionalParams +} from "../models"; + +/** Interface representing a Favorites. */ +export interface Favorites { + /** + * Gets a list of favorites defined within an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: FavoritesListOptionalParams + ): Promise; + /** + * Get a single favorite by its FavoriteId, defined within an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + favoriteId: string, + options?: FavoritesGetOptionalParams + ): Promise; + /** + * Adds a new favorites to an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param favoriteProperties Properties that need to be specified to create a new favorite and add it + * to an Application Insights component. + * @param options The options parameters. + */ + add( + resourceGroupName: string, + resourceName: string, + favoriteId: string, + favoriteProperties: ApplicationInsightsComponentFavorite, + options?: FavoritesAddOptionalParams + ): Promise; + /** + * Updates a favorite that has already been added to an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param favoriteProperties Properties that need to be specified to update the existing favorite. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + favoriteId: string, + favoriteProperties: ApplicationInsightsComponentFavorite, + options?: FavoritesUpdateOptionalParams + ): Promise; + /** + * Remove a favorite that is associated to an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + favoriteId: string, + options?: FavoritesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/index.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..22f0c430dc3b --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/index.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./annotations"; +export * from "./aPIKeys"; +export * from "./exportConfigurations"; +export * from "./componentCurrentBillingFeatures"; +export * from "./componentQuotaStatus"; +export * from "./componentFeatureCapabilities"; +export * from "./componentAvailableFeatures"; +export * from "./proactiveDetectionConfigurations"; +export * from "./workItemConfigurations"; +export * from "./favorites"; +export * from "./webTestLocations"; +export * from "./webTests"; +export * from "./analyticsItems"; +export * from "./workbookTemplates"; +export * from "./myWorkbooks"; +export * from "./workbooks"; +export * from "./components"; +export * from "./componentLinkedStorageAccountsOperations"; +export * from "./operations"; +export * from "./liveToken"; diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/liveToken.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/liveToken.ts new file mode 100644 index 000000000000..2045c08c28e8 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/liveToken.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LiveTokenGetOptionalParams, LiveTokenGetResponse } from "../models"; + +/** Interface representing a LiveToken. */ +export interface LiveToken { + /** + * **Gets an access token for live metrics stream data.** + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + get( + resourceUri: string, + options?: LiveTokenGetOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/myWorkbooks.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/myWorkbooks.ts new file mode 100644 index 000000000000..46def1df128f --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/myWorkbooks.ts @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + MyWorkbook, + CategoryType, + MyWorkbooksListByResourceGroupOptionalParams, + MyWorkbooksListBySubscriptionOptionalParams, + MyWorkbooksGetOptionalParams, + MyWorkbooksGetResponse, + MyWorkbooksDeleteOptionalParams, + MyWorkbooksCreateOrUpdateOptionalParams, + MyWorkbooksCreateOrUpdateResponse, + MyWorkbooksUpdateOptionalParams, + MyWorkbooksUpdateResponse +} from "../models"; + +/// +/** Interface representing a MyWorkbooks. */ +export interface MyWorkbooks { + /** + * Get all private workbooks defined within a specified resource group and category. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param category Category of workbook to return. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + category: CategoryType, + options?: MyWorkbooksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get all private workbooks defined within a specified subscription and category. + * @param category Category of workbook to return. + * @param options The options parameters. + */ + listBySubscription( + category: CategoryType, + options?: MyWorkbooksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a single private workbook by its resourceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: MyWorkbooksGetOptionalParams + ): Promise; + /** + * Delete a private workbook. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + options?: MyWorkbooksDeleteOptionalParams + ): Promise; + /** + * Create a new private workbook. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookProperties Properties that need to be specified to create a new private workbook. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + resourceName: string, + workbookProperties: MyWorkbook, + options?: MyWorkbooksCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates a private workbook that has already been added. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookProperties Properties that need to be specified to create a new private workbook. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + workbookProperties: MyWorkbook, + options?: MyWorkbooksUpdateOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/operations.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..4578cf770899 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { OperationLive, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * List the available operations supported by the resource provider. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/proactiveDetectionConfigurations.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/proactiveDetectionConfigurations.ts new file mode 100644 index 000000000000..be564904a0ff --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/proactiveDetectionConfigurations.ts @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + ProactiveDetectionConfigurationsListOptionalParams, + ProactiveDetectionConfigurationsListResponse, + ProactiveDetectionConfigurationsGetOptionalParams, + ProactiveDetectionConfigurationsGetResponse, + ApplicationInsightsComponentProactiveDetectionConfiguration, + ProactiveDetectionConfigurationsUpdateOptionalParams, + ProactiveDetectionConfigurationsUpdateResponse +} from "../models"; + +/** Interface representing a ProactiveDetectionConfigurations. */ +export interface ProactiveDetectionConfigurations { + /** + * Gets a list of ProactiveDetection configurations of an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: ProactiveDetectionConfigurationsListOptionalParams + ): Promise; + /** + * Get the ProactiveDetection configuration for this configuration id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application + * Insights component. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + configurationId: string, + options?: ProactiveDetectionConfigurationsGetOptionalParams + ): Promise; + /** + * Update the ProactiveDetection configuration for this configuration id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application + * Insights component. + * @param proactiveDetectionProperties Properties that need to be specified to update the + * ProactiveDetection configuration. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + configurationId: string, + proactiveDetectionProperties: ApplicationInsightsComponentProactiveDetectionConfiguration, + options?: ProactiveDetectionConfigurationsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/webTestLocations.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/webTestLocations.ts new file mode 100644 index 000000000000..6bb6a15bec02 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/webTestLocations.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ApplicationInsightsComponentWebTestLocation, + WebTestLocationsListOptionalParams +} from "../models"; + +/// +/** Interface representing a WebTestLocations. */ +export interface WebTestLocations { + /** + * Gets a list of web test locations available to this Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: WebTestLocationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/webTests.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/webTests.ts new file mode 100644 index 000000000000..113a8444b933 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/webTests.ts @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + WebTest, + WebTestsListByResourceGroupOptionalParams, + WebTestsListOptionalParams, + WebTestsListByComponentOptionalParams, + WebTestsGetOptionalParams, + WebTestsGetResponse, + WebTestsCreateOrUpdateOptionalParams, + WebTestsCreateOrUpdateResponse, + TagsResource, + WebTestsUpdateTagsOptionalParams, + WebTestsUpdateTagsResponse, + WebTestsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a WebTests. */ +export interface WebTests { + /** + * Get all Application Insights web tests defined within a specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: WebTestsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get all Application Insights web test alerts definitions within a subscription. + * @param options The options parameters. + */ + list( + options?: WebTestsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get all Application Insights web tests defined for the specified component. + * @param componentName The name of the Application Insights component resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByComponent( + componentName: string, + resourceGroupName: string, + options?: WebTestsListByComponentOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a specific Application Insights web test definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param webTestName The name of the Application Insights webtest resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + webTestName: string, + options?: WebTestsGetOptionalParams + ): Promise; + /** + * Creates or updates an Application Insights web test definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param webTestName The name of the Application Insights webtest resource. + * @param webTestDefinition Properties that need to be specified to create or update an Application + * Insights web test definition. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + webTestName: string, + webTestDefinition: WebTest, + options?: WebTestsCreateOrUpdateOptionalParams + ): Promise; + /** + * Creates or updates an Application Insights web test definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param webTestName The name of the Application Insights webtest resource. + * @param webTestTags Updated tag information to set into the web test instance. + * @param options The options parameters. + */ + updateTags( + resourceGroupName: string, + webTestName: string, + webTestTags: TagsResource, + options?: WebTestsUpdateTagsOptionalParams + ): Promise; + /** + * Deletes an Application Insights web test. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param webTestName The name of the Application Insights webtest resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + webTestName: string, + options?: WebTestsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workItemConfigurations.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workItemConfigurations.ts new file mode 100644 index 000000000000..958744cb3b6e --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workItemConfigurations.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + WorkItemConfiguration, + WorkItemConfigurationsListOptionalParams, + WorkItemCreateConfiguration, + WorkItemConfigurationsCreateOptionalParams, + WorkItemConfigurationsCreateResponse, + WorkItemConfigurationsGetDefaultOptionalParams, + WorkItemConfigurationsGetDefaultResponse, + WorkItemConfigurationsDeleteOptionalParams, + WorkItemConfigurationsGetItemOptionalParams, + WorkItemConfigurationsGetItemResponse, + WorkItemConfigurationsUpdateItemOptionalParams, + WorkItemConfigurationsUpdateItemResponse +} from "../models"; + +/// +/** Interface representing a WorkItemConfigurations. */ +export interface WorkItemConfigurations { + /** + * Gets the list work item configurations that exist for the application + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: WorkItemConfigurationsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a work item configuration for an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigurationProperties Properties that need to be specified to create a work item + * configuration of a Application Insights component. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + resourceName: string, + workItemConfigurationProperties: WorkItemCreateConfiguration, + options?: WorkItemConfigurationsCreateOptionalParams + ): Promise; + /** + * Gets default work item configurations that exist for the application + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + getDefault( + resourceGroupName: string, + resourceName: string, + options?: WorkItemConfigurationsGetDefaultOptionalParams + ): Promise; + /** + * Delete a work item configuration of an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigId The unique work item configuration Id. This can be either friendly name of + * connector as defined in connector configuration + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + workItemConfigId: string, + options?: WorkItemConfigurationsDeleteOptionalParams + ): Promise; + /** + * Gets specified work item configuration for an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigId The unique work item configuration Id. This can be either friendly name of + * connector as defined in connector configuration + * @param options The options parameters. + */ + getItem( + resourceGroupName: string, + resourceName: string, + workItemConfigId: string, + options?: WorkItemConfigurationsGetItemOptionalParams + ): Promise; + /** + * Update a work item configuration for an Application Insights component. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigId The unique work item configuration Id. This can be either friendly name of + * connector as defined in connector configuration + * @param workItemConfigurationProperties Properties that need to be specified to update a work item + * configuration for this Application Insights component. + * @param options The options parameters. + */ + updateItem( + resourceGroupName: string, + resourceName: string, + workItemConfigId: string, + workItemConfigurationProperties: WorkItemCreateConfiguration, + options?: WorkItemConfigurationsUpdateItemOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workbookTemplates.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workbookTemplates.ts new file mode 100644 index 000000000000..69bac6e12019 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workbookTemplates.ts @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + WorkbookTemplate, + WorkbookTemplatesListByResourceGroupOptionalParams, + WorkbookTemplatesGetOptionalParams, + WorkbookTemplatesGetResponse, + WorkbookTemplatesDeleteOptionalParams, + WorkbookTemplatesCreateOrUpdateOptionalParams, + WorkbookTemplatesCreateOrUpdateResponse, + WorkbookTemplatesUpdateOptionalParams, + WorkbookTemplatesUpdateResponse +} from "../models"; + +/// +/** Interface representing a WorkbookTemplates. */ +export interface WorkbookTemplates { + /** + * Get all Workbook templates defined within a specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: WorkbookTemplatesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a single workbook template by its resourceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: WorkbookTemplatesGetOptionalParams + ): Promise; + /** + * Delete a workbook template. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + options?: WorkbookTemplatesDeleteOptionalParams + ): Promise; + /** + * Create a new workbook template. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookTemplateProperties Properties that need to be specified to create a new workbook. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + resourceName: string, + workbookTemplateProperties: WorkbookTemplate, + options?: WorkbookTemplatesCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates a workbook template that has already been added. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + options?: WorkbookTemplatesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workbooks.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workbooks.ts new file mode 100644 index 000000000000..ce7db2a1f776 --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/workbooks.ts @@ -0,0 +1,120 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Workbook, + CategoryType, + WorkbooksListBySubscriptionOptionalParams, + WorkbooksListByResourceGroupOptionalParams, + WorkbooksRevisionsListOptionalParams, + WorkbooksGetOptionalParams, + WorkbooksGetResponse, + WorkbooksDeleteOptionalParams, + WorkbooksCreateOrUpdateOptionalParams, + WorkbooksCreateOrUpdateResponse, + WorkbooksUpdateOptionalParams, + WorkbooksUpdateResponse, + WorkbooksRevisionGetOptionalParams, + WorkbooksRevisionGetResponse +} from "../models"; + +/// +/** Interface representing a Workbooks. */ +export interface Workbooks { + /** + * Get all private workbooks defined within a specified subscription and category. + * @param category Category of workbook to return. + * @param options The options parameters. + */ + listBySubscription( + category: CategoryType, + options?: WorkbooksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get all Workbooks defined within a specified resource group and category. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param category Category of workbook to return. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + category: CategoryType, + options?: WorkbooksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the revisions for the workbook defined by its resourceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + listRevisionsList( + resourceGroupName: string, + resourceName: string, + options?: WorkbooksRevisionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a single workbook by its resourceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: WorkbooksGetOptionalParams + ): Promise; + /** + * Delete a workbook. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + options?: WorkbooksDeleteOptionalParams + ): Promise; + /** + * Create a new workbook. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookProperties Properties that need to be specified to create a new workbook. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + resourceName: string, + workbookProperties: Workbook, + options?: WorkbooksCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates a workbook that has already been added. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + options?: WorkbooksUpdateOptionalParams + ): Promise; + /** + * Get a single workbook revision defined by its revisionId. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param revisionId The id of the workbook's revision. + * @param options The options parameters. + */ + revisionGet( + resourceGroupName: string, + resourceName: string, + revisionId: string, + options?: WorkbooksRevisionGetOptionalParams + ): Promise; +} diff --git a/sdk/applicationinsights/arm-appinsights/test/sampleTest.ts b/sdk/applicationinsights/arm-appinsights/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/applicationinsights/arm-appinsights/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/applicationinsights/arm-appinsights/tsconfig.json b/sdk/applicationinsights/arm-appinsights/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/applicationinsights/arm-appinsights/tsconfig.json +++ b/sdk/applicationinsights/arm-appinsights/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/applicationinsights/ci.yml b/sdk/applicationinsights/ci.yml new file mode 100644 index 000000000000..05dbd6a7210e --- /dev/null +++ b/sdk/applicationinsights/ci.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/applicationinsights/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/applicationinsights/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: applicationinsights + Artifacts: + - name: azure-arm-appinsights + safeName: azurearmappinsights + \ No newline at end of file diff --git a/sdk/datacatalog/arm-datacatalog/CHANGELOG.md b/sdk/datacatalog/arm-datacatalog/CHANGELOG.md new file mode 100644 index 000000000000..3be499a35319 --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 3.0.0 (2022-01-21) + +The package of @azure/arm-datacatalog is using our next generation design principles since version 3.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/datacatalog/arm-datacatalog/LICENSE b/sdk/datacatalog/arm-datacatalog/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/datacatalog/arm-datacatalog/README.md b/sdk/datacatalog/arm-datacatalog/README.md index bfe24b08786b..54a8eacf4df4 100644 --- a/sdk/datacatalog/arm-datacatalog/README.md +++ b/sdk/datacatalog/arm-datacatalog/README.md @@ -1,109 +1,98 @@ -## Azure DataCatalogRestClient SDK for JavaScript +# Azure DataCatalogRest client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for DataCatalogRestClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DataCatalogRest client. + +The Azure Data Catalog management API provides a RESTful set of web services that interact with Azure Data Catalog services. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/datacatalog/arm-datacatalog) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-datacatalog) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-datacatalog) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-datacatalog` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-datacatalog` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure DataCatalogRest client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-datacatalog @azure/identity +npm install @azure/arm-datacatalog ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `DataCatalogRestClient` -### How to use +To create a client object to access the Azure DataCatalogRest API, you will need the `endpoint` of your Azure DataCatalogRest resource and a `credential`. The Azure DataCatalogRest client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure DataCatalogRest resource in the [Azure Portal][azure_portal]. -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and list aDCOperations as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure DataCatalogRest** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Sample code +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { DataCatalogRestClient } = require("@azure/arm-datacatalog"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new DataCatalogRestClient(creds, subscriptionId); - -client.aDCOperations.list().then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new DataCatalogRestClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and list aDCOperations as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-datacatalog sample - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### DataCatalogRestClient + +`DataCatalogRestClient` is the primary interface for developers using the Azure DataCatalogRest client library. Explore the methods on this client object to understand the different features of the Azure DataCatalogRest service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdatacatalog%2Farm-datacatalog%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/datacatalog/arm-datacatalog/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/datacatalog/arm-datacatalog/_meta.json b/sdk/datacatalog/arm-datacatalog/_meta.json new file mode 100644 index 000000000000..08bd8c0cfb1d --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "readme": "specification/datacatalog/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/datacatalog/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" +} \ No newline at end of file diff --git a/sdk/datacatalog/arm-datacatalog/api-extractor.json b/sdk/datacatalog/arm-datacatalog/api-extractor.json new file mode 100644 index 000000000000..cf165eaa9c8b --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-datacatalog.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/datacatalog/arm-datacatalog/package.json b/sdk/datacatalog/arm-datacatalog/package.json index d14331b4d263..812530060871 100644 --- a/sdk/datacatalog/arm-datacatalog/package.json +++ b/sdk/datacatalog/arm-datacatalog/package.json @@ -1,57 +1,96 @@ { "name": "@azure/arm-datacatalog", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "DataCatalogRestClient Library with typescript type definitions for node.js and browser.", - "version": "1.2.0", + "description": "A generated SDK for DataCatalogRestClient.", + "version": "3.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^1.4.0", - "@azure/ms-rest-js": "^1.11.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.9.3" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-datacatalog.js", - "module": "./esm/dataCatalogRestClient.js", - "types": "./esm/dataCatalogRestClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-datacatalog.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", - "uglify-js": "^3.4.9" + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/main/sdk/datacatalog/arm-datacatalog", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/datacatalog/arm-datacatalog", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" - }, - "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-datacatalog.js.map'\" -o ./dist/arm-datacatalog.min.js ./dist/arm-datacatalog.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, + "//metadata": { + "constantPaths": [ + { "path": "src/DataCatalogRestClient.ts", "prefix": "packageDetails" } + ] + }, "autoPublish": true } diff --git a/sdk/datacatalog/arm-datacatalog/recordings/node/my_test/recording_sample_test.js b/sdk/datacatalog/arm-datacatalog/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/datacatalog/arm-datacatalog/review/arm-datacatalog.api.md b/sdk/datacatalog/arm-datacatalog/review/arm-datacatalog.api.md new file mode 100644 index 000000000000..75e1537d7a33 --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/review/arm-datacatalog.api.md @@ -0,0 +1,157 @@ +## API Report File for "@azure/arm-datacatalog" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type ADCCatalog = Resource & { + sku?: SkuType; + units?: number; + admins?: Principals[]; + users?: Principals[]; + successfullyProvisioned?: boolean; + enableAutomaticUnitAdjustment?: boolean; +}; + +// @public +export interface ADCCatalogs { + beginDelete(resourceGroupName: string, options?: ADCCatalogsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, options?: ADCCatalogsDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, properties: ADCCatalog, options?: ADCCatalogsCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, options?: ADCCatalogsGetOptionalParams): Promise; + listtByResourceGroup(resourceGroupName: string, options?: ADCCatalogsListtByResourceGroupOptionalParams): Promise; + update(resourceGroupName: string, properties: ADCCatalog, options?: ADCCatalogsUpdateOptionalParams): Promise; +} + +// @public +export interface ADCCatalogsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ADCCatalogsCreateOrUpdateResponse = ADCCatalog; + +// @public +export interface ADCCatalogsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ADCCatalogsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ADCCatalogsGetResponse = ADCCatalog; + +// @public +export interface ADCCatalogsListResult { + value?: ADCCatalog[]; +} + +// @public +export interface ADCCatalogsListtByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ADCCatalogsListtByResourceGroupResponse = ADCCatalogsListResult; + +// @public +export interface ADCCatalogsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ADCCatalogsUpdateResponse = ADCCatalog; + +// @public +export interface ADCOperations { + list(options?: ADCOperationsListOptionalParams): Promise; +} + +// @public +export interface ADCOperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ADCOperationsListResponse = OperationEntityListResult; + +// @public (undocumented) +export class DataCatalogRestClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, catalogName: string, options?: DataCatalogRestClientOptionalParams); + // (undocumented) + aDCCatalogs: ADCCatalogs; + // (undocumented) + aDCOperations: ADCOperations; + // (undocumented) + apiVersion: string; + // (undocumented) + catalogName: string; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface DataCatalogRestClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export enum KnownSkuType { + // (undocumented) + Free = "Free", + // (undocumented) + Standard = "Standard" +} + +// @public +export interface OperationDisplayInfo { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationEntity { + display?: OperationDisplayInfo; + name?: string; +} + +// @public +export interface OperationEntityListResult { + value?: OperationEntity[]; +} + +// @public +export interface Principals { + objectId?: string; + upn?: string; +} + +// @public +export interface Resource { + etag?: string; + readonly id?: string; + location?: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export type SkuType = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/datacatalog/arm-datacatalog/rollup.config.js b/sdk/datacatalog/arm-datacatalog/rollup.config.js index ccc17b025801..9be1955eb7f1 100644 --- a/sdk/datacatalog/arm-datacatalog/rollup.config.js +++ b/sdk/datacatalog/arm-datacatalog/rollup.config.js @@ -1,31 +1,188 @@ -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + /** - * @type {import('rollup').RollupFileOptions} + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. */ -const config = { - input: './esm/dataCatalogRestClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], - output: { - file: "./dist/arm-datacatalog.js", - format: "umd", - name: "Azure.ArmDatacatalog", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */` - }, - plugins: [ - nodeResolve({ module: true }) - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/datacatalog/arm-datacatalog/src/dataCatalogRestClient.ts b/sdk/datacatalog/arm-datacatalog/src/dataCatalogRestClient.ts index 81ff23bff504..b0dec4371f4e 100644 --- a/sdk/datacatalog/arm-datacatalog/src/dataCatalogRestClient.ts +++ b/sdk/datacatalog/arm-datacatalog/src/dataCatalogRestClient.ts @@ -1,52 +1,85 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { DataCatalogRestClientContext } from "./dataCatalogRestClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { ADCOperationsImpl, ADCCatalogsImpl } from "./operations"; +import { ADCOperations, ADCCatalogs } from "./operationsInterfaces"; +import { DataCatalogRestClientOptionalParams } from "./models"; - -class DataCatalogRestClient extends DataCatalogRestClientContext { - // Operation groups - aDCOperations: operations.ADCOperations; - aDCCatalogs: operations.ADCCatalogs; +export class DataCatalogRestClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + catalogName: string; /** * Initializes a new instance of the DataCatalogRestClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Gets subscription credentials which uniquely identify the Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param catalogName The name of the data catlog in the specified subscription and resource group. - * @param [options] The parameter options + * subscription. The subscription ID forms part of the URI for every service call. + * @param catalogName The name of the data catalog in the specified subscription and resource group. + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, catalogName: string, options?: Models.DataCatalogRestClientOptions) { - super(credentials, subscriptionId, catalogName, options); - this.aDCOperations = new operations.ADCOperations(this); - this.aDCCatalogs = new operations.ADCCatalogs(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + catalogName: string, + options?: DataCatalogRestClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + if (catalogName === undefined) { + throw new Error("'catalogName' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: DataCatalogRestClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-datacatalog/3.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - DataCatalogRestClient, - DataCatalogRestClientContext, - Models as DataCatalogRestModels, - Mappers as DataCatalogRestMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + this.catalogName = catalogName; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2016-03-30"; + this.aDCOperations = new ADCOperationsImpl(this); + this.aDCCatalogs = new ADCCatalogsImpl(this); + } + + aDCOperations: ADCOperations; + aDCCatalogs: ADCCatalogs; +} diff --git a/sdk/datacatalog/arm-datacatalog/src/dataCatalogRestClientContext.ts b/sdk/datacatalog/arm-datacatalog/src/dataCatalogRestClientContext.ts deleted file mode 100644 index 80b966832bdc..000000000000 --- a/sdk/datacatalog/arm-datacatalog/src/dataCatalogRestClientContext.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-datacatalog"; -const packageVersion = "1.2.0"; - -export class DataCatalogRestClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - subscriptionId: string; - apiVersion?: string; - catalogName: string; - - /** - * Initializes a new instance of the DataCatalogRestClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId Gets subscription credentials which uniquely identify the Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param catalogName The name of the data catlog in the specified subscription and resource group. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, catalogName: string, options?: Models.DataCatalogRestClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - if (catalogName == undefined) { - throw new Error('\'catalogName\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2016-03-30'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - this.catalogName = catalogName; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/datacatalog/arm-datacatalog/src/index.ts b/sdk/datacatalog/arm-datacatalog/src/index.ts new file mode 100644 index 000000000000..4c15fd0740bc --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/src/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./models"; +export { DataCatalogRestClient } from "./dataCatalogRestClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/datacatalog/arm-datacatalog/src/lroImpl.ts b/sdk/datacatalog/arm-datacatalog/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/datacatalog/arm-datacatalog/src/models/aDCCatalogsMappers.ts b/sdk/datacatalog/arm-datacatalog/src/models/aDCCatalogsMappers.ts deleted file mode 100644 index c25ac42f58e0..000000000000 --- a/sdk/datacatalog/arm-datacatalog/src/models/aDCCatalogsMappers.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - ADCCatalogsListResult, - ADCCatalog, - Resource, - BaseResource, - Principals, - CloudError -} from "../models/mappers"; - diff --git a/sdk/datacatalog/arm-datacatalog/src/models/aDCOperationsMappers.ts b/sdk/datacatalog/arm-datacatalog/src/models/aDCOperationsMappers.ts deleted file mode 100644 index aba5d8bf047b..000000000000 --- a/sdk/datacatalog/arm-datacatalog/src/models/aDCOperationsMappers.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - OperationEntityListResult, - OperationEntity, - OperationDisplayInfo, - CloudError -} from "../models/mappers"; - diff --git a/sdk/datacatalog/arm-datacatalog/src/models/index.ts b/sdk/datacatalog/arm-datacatalog/src/models/index.ts index 2c3606bc5249..183db7547e2b 100644 --- a/sdk/datacatalog/arm-datacatalog/src/models/index.ts +++ b/sdk/datacatalog/arm-datacatalog/src/models/index.ts @@ -1,295 +1,161 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +/** The list of Azure data catalog service operation response. */ +export interface OperationEntityListResult { + /** The list of operations. */ + value?: OperationEntity[]; +} +/** The operation supported by Azure Data Catalog Service. */ +export interface OperationEntity { + /** Operation name: {provider}/{resource}/{operation}. */ + name?: string; + /** The operation supported by Azure Data Catalog Service. */ + display?: OperationDisplayInfo; +} -/** - * @interface - * An interface representing Principals. - * User principals. - * - */ +/** The operation supported by Azure Data Catalog Service. */ +export interface OperationDisplayInfo { + /** The description of the operation. */ + description?: string; + /** The action that users can perform, based on their permission level. */ + operation?: string; + /** Service provider: Azure Data Catalog Service. */ + provider?: string; + /** Resource on which the operation is performed. */ + resource?: string; +} + +/** The response from the List Azure Data Catalog operation. */ +export interface ADCCatalogsListResult { + /** the list of Azure Data Catalogs. */ + value?: ADCCatalog[]; +} + +/** User principals. */ export interface Principals { - /** - * @member {string} [upn] UPN of the user. - */ + /** UPN of the user. */ upn?: string; - /** - * @member {string} [objectId] Object Id for the user - */ + /** Object Id for the user */ objectId?: string; } -/** - * @interface - * An interface representing Resource. - * The Resource model definition. - * - * @extends BaseResource - */ -export interface Resource extends BaseResource { +/** The Resource model definition. */ +export interface Resource { /** - * @member {string} [id] Resource Id - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * @member {string} [name] Resource name - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Resource name + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * @member {string} [type] Resource type - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** - * @member {string} [location] Resource location - */ + /** Resource location */ location?: string; - /** - * @member {{ [propertyName: string]: string }} [tags] Resource tags - */ + /** Resource tags */ tags?: { [propertyName: string]: string }; - /** - * @member {string} [etag] Resource etag - */ + /** Resource etag */ etag?: string; } -/** - * @interface - * An interface representing ADCCatalog. - * Azure Data Catalog. - * - * @extends Resource - */ -export interface ADCCatalog extends Resource { - /** - * @member {SkuType} [sku] Azure data catalog SKU. Possible values include: - * 'Free', 'Standard' - */ +/** Azure Data Catalog. */ +export type ADCCatalog = Resource & { + /** Azure data catalog SKU. */ sku?: SkuType; - /** - * @member {number} [units] Azure data catalog units. - */ + /** Azure data catalog units. */ units?: number; - /** - * @member {Principals[]} [admins] Azure data catalog admin list. - */ + /** Azure data catalog admin list. */ admins?: Principals[]; - /** - * @member {Principals[]} [users] Azure data catalog user list. - */ + /** Azure data catalog user list. */ users?: Principals[]; - /** - * @member {boolean} [successfullyProvisioned] Azure data catalog provision - * status. - */ + /** Azure data catalog provision status. */ successfullyProvisioned?: boolean; - /** - * @member {boolean} [enableAutomaticUnitAdjustment] Automatic unit - * adjustment enabled or not. - */ + /** Automatic unit adjustment enabled or not. */ enableAutomaticUnitAdjustment?: boolean; -} +}; -/** - * @interface - * An interface representing ADCCatalogsListResult. - * The response from the List Azure Data Catalog operation. - * - */ -export interface ADCCatalogsListResult { - /** - * @member {ADCCatalog[]} [value] the list of Azure Data Catalogs. - */ - value?: ADCCatalog[]; +/** Known values of {@link SkuType} that the service accepts. */ +export enum KnownSkuType { + Free = "Free", + Standard = "Standard" } /** - * @interface - * An interface representing OperationDisplayInfo. - * The operation supported by Azure Data Catalog Service. - * + * Defines values for SkuType. \ + * {@link KnownSkuType} can be used interchangeably with SkuType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Free** \ + * **Standard** */ -export interface OperationDisplayInfo { - /** - * @member {string} [description] The description of the operation. - */ - description?: string; - /** - * @member {string} [operation] The action that users can perform, based on - * their permission level. - */ - operation?: string; - /** - * @member {string} [provider] Service provider: Azure Data Catalog Service. - */ - provider?: string; - /** - * @member {string} [resource] Resource on which the operation is performed. - */ - resource?: string; -} +export type SkuType = string; -/** - * @interface - * An interface representing OperationEntity. - * The operation supported by Azure Data Catalog Service. - * - */ -export interface OperationEntity { - /** - * @member {string} [name] Operation name: {provider}/{resource}/{operation}. - */ - name?: string; - /** - * @member {OperationDisplayInfo} [display] The operation supported by Azure - * Data Catalog Service. - */ - display?: OperationDisplayInfo; -} +/** Optional parameters. */ +export interface ADCOperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing OperationEntityListResult. - * The list of Azure data catalog service operation response. - * - */ -export interface OperationEntityListResult { - /** - * @member {OperationEntity[]} [value] The list of operations. - */ - value?: OperationEntity[]; -} +/** Contains response data for the list operation. */ +export type ADCOperationsListResponse = OperationEntityListResult; -/** - * @interface - * An interface representing DataCatalogRestClientOptions. - * @extends AzureServiceClientOptions - */ -export interface DataCatalogRestClientOptions extends AzureServiceClientOptions { - /** - * @member {string} [baseUri] - */ - baseUri?: string; -} +/** Optional parameters. */ +export interface ADCCatalogsListtByResourceGroupOptionalParams + extends coreClient.OperationOptions {} +/** Contains response data for the listtByResourceGroup operation. */ +export type ADCCatalogsListtByResourceGroupResponse = ADCCatalogsListResult; -/** - * Defines values for SkuType. - * Possible values include: 'Free', 'Standard' - * @readonly - * @enum {string} - */ -export type SkuType = 'Free' | 'Standard'; +/** Optional parameters. */ +export interface ADCCatalogsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type ADCOperationsListResponse = OperationEntityListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationEntityListResult; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type ADCCatalogsCreateOrUpdateResponse = ADCCatalog; -/** - * Contains response data for the listtByResourceGroup operation. - */ -export type ADCCatalogsListtByResourceGroupResponse = ADCCatalogsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ADCCatalogsListResult; - }; -}; +/** Optional parameters. */ +export interface ADCCatalogsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ADCCatalogsCreateOrUpdateResponse = ADCCatalog & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ADCCatalog; - }; -}; +/** Contains response data for the get operation. */ +export type ADCCatalogsGetResponse = ADCCatalog; -/** - * Contains response data for the get operation. - */ -export type ADCCatalogsGetResponse = ADCCatalog & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ADCCatalog; - }; -}; +/** Optional parameters. */ +export interface ADCCatalogsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the update operation. - */ -export type ADCCatalogsUpdateResponse = ADCCatalog & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ADCCatalog; - }; -}; +/** Optional parameters. */ +export interface ADCCatalogsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ADCCatalogsUpdateResponse = ADCCatalog; + +/** Optional parameters. */ +export interface DataCatalogRestClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/datacatalog/arm-datacatalog/src/models/mappers.ts b/sdk/datacatalog/arm-datacatalog/src/models/mappers.ts index fd335ff89fc6..8874cc9ae6a8 100644 --- a/sdk/datacatalog/arm-datacatalog/src/models/mappers.ts +++ b/sdk/datacatalog/arm-datacatalog/src/models/mappers.ts @@ -1,21 +1,111 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; +export const OperationEntityListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationEntityListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationEntity" + } + } + } + } + } + } +}; -export const Principals: msRest.CompositeMapper = { - serializedName: "Principals", +export const OperationEntity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationEntity", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplayInfo" + } + } + } + } +}; + +export const OperationDisplayInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplayInfo", + modelProperties: { + description: { + serializedName: "description", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + } + } + } +}; + +export const ADCCatalogsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ADCCatalogsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ADCCatalog" + } + } + } + } + } + } +}; + +export const Principals: coreClient.CompositeMapper = { type: { name: "Composite", className: "Principals", @@ -36,29 +126,28 @@ export const Principals: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", className: "Resource", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } @@ -73,11 +162,7 @@ export const Resource: msRest.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } }, etag: { @@ -90,8 +175,7 @@ export const Resource: msRest.CompositeMapper = { } }; -export const ADCCatalog: msRest.CompositeMapper = { - serializedName: "ADCCatalog", +export const ADCCatalog: coreClient.CompositeMapper = { type: { name: "Composite", className: "ADCCatalog", @@ -148,104 +232,3 @@ export const ADCCatalog: msRest.CompositeMapper = { } } }; - -export const ADCCatalogsListResult: msRest.CompositeMapper = { - serializedName: "ADCCatalogsListResult", - type: { - name: "Composite", - className: "ADCCatalogsListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ADCCatalog" - } - } - } - } - } - } -}; - -export const OperationDisplayInfo: msRest.CompositeMapper = { - serializedName: "OperationDisplayInfo", - type: { - name: "Composite", - className: "OperationDisplayInfo", - modelProperties: { - description: { - serializedName: "description", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - type: { - name: "String" - } - }, - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - } - } - } -}; - -export const OperationEntity: msRest.CompositeMapper = { - serializedName: "OperationEntity", - type: { - name: "Composite", - className: "OperationEntity", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplayInfo" - } - } - } - } -}; - -export const OperationEntityListResult: msRest.CompositeMapper = { - serializedName: "OperationEntityListResult", - type: { - name: "Composite", - className: "OperationEntityListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationEntity" - } - } - } - } - } - } -}; diff --git a/sdk/datacatalog/arm-datacatalog/src/models/parameters.ts b/sdk/datacatalog/arm-datacatalog/src/models/parameters.ts index 9ec29ab6c2c7..95865dc52feb 100644 --- a/sdk/datacatalog/arm-datacatalog/src/models/parameters.ts +++ b/sdk/datacatalog/arm-datacatalog/src/models/parameters.ts @@ -1,65 +1,103 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { ADCCatalog as ADCCatalogMapper } from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2016-03-30", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const catalogName: msRest.OperationURLParameter = { - parameterPath: "catalogName", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "catalogName", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { + +export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { - required: true, - serializedName: "resourceGroupName", constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const properties: OperationParameter = { + parameterPath: "properties", + mapper: ADCCatalogMapper +}; + +export const catalogName: OperationURLParameter = { + parameterPath: "catalogName", mapper: { + serializedName: "catalogName", required: true, - serializedName: "subscriptionId", type: { name: "String" } diff --git a/sdk/datacatalog/arm-datacatalog/src/operations/aDCCatalogs.ts b/sdk/datacatalog/arm-datacatalog/src/operations/aDCCatalogs.ts index a8e717cffe94..17f0932cc3e6 100644 --- a/sdk/datacatalog/arm-datacatalog/src/operations/aDCCatalogs.ts +++ b/sdk/datacatalog/arm-datacatalog/src/operations/aDCCatalogs.ts @@ -1,344 +1,285 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/aDCCatalogsMappers"; +import { ADCCatalogs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataCatalogRestClientContext } from "../dataCatalogRestClientContext"; +import { DataCatalogRestClient } from "../dataCatalogRestClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ADCCatalogsListtByResourceGroupOptionalParams, + ADCCatalogsListtByResourceGroupResponse, + ADCCatalog, + ADCCatalogsCreateOrUpdateOptionalParams, + ADCCatalogsCreateOrUpdateResponse, + ADCCatalogsGetOptionalParams, + ADCCatalogsGetResponse, + ADCCatalogsDeleteOptionalParams, + ADCCatalogsUpdateOptionalParams, + ADCCatalogsUpdateResponse +} from "../models"; -/** Class representing a ADCCatalogs. */ -export class ADCCatalogs { - private readonly client: DataCatalogRestClientContext; +/** Class containing ADCCatalogs operations. */ +export class ADCCatalogsImpl implements ADCCatalogs { + private readonly client: DataCatalogRestClient; /** - * Create a ADCCatalogs. - * @param {DataCatalogRestClientContext} client Reference to the service client. + * Initialize a new instance of the class ADCCatalogs class. + * @param client Reference to the service client */ - constructor(client: DataCatalogRestClientContext) { + constructor(client: DataCatalogRestClient) { this.client = client; } /** - * The List catalogs in Resource Group operation lists all the Azure Data Catalogs available under - * the given resource group. - * @summary List catalogs in Resource Group (GET Resources) - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param [options] The optional parameters - * @returns Promise + * The List catalogs in Resource Group operation lists all the Azure Data Catalogs available under the + * given resource group. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param options The options parameters. */ - listtByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param callback The callback - */ - listtByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param options The optional parameters - * @param callback The callback - */ - listtByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listtByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listtByResourceGroup( + resourceGroupName: string, + options?: ADCCatalogsListtByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listtByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listtByResourceGroupOperationSpec + ); } /** * The Create Azure Data Catalog service operation creates a new data catalog service with the - * specified parameters. If the specific service already exists, then any patchable properties will - * be updated and any immutable properties will remain unchanged. - * @summary Create or Update Azure Data Catalog service (PUT Resource) - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. + * specified parameters. If the specific service already exists, then any patchable properties will be + * updated and any immutable properties will remain unchanged. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. * @param properties Properties supplied to the Create or Update a data catalog. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, properties: Models.ADCCatalog, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param properties Properties supplied to the Create or Update a data catalog. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, properties: Models.ADCCatalog, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param properties Properties supplied to the Create or Update a data catalog. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, properties: Models.ADCCatalog, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, properties: Models.ADCCatalog, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + properties: ADCCatalog, + options?: ADCCatalogsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - properties, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, properties, options }, + createOrUpdateOperationSpec + ); } /** - * The Get Azure Data Catalog Service operation retrieves a json representation of the data - * catalog. - * @summary Get Azure Data Catalog service (GET Resources) - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param callback The callback - */ - get(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param options The optional parameters - * @param callback The callback + * The Get Azure Data Catalog Service operation retrieves a json representation of the data catalog. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param options The options parameters. */ - get(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + options?: ADCCatalogsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + getOperationSpec + ); } /** * The Delete Azure Data Catalog Service operation deletes an existing data catalog. - * @summary Delete Azure Data Catalog Service (DELETE Resource) - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param [options] The optional parameters - * @returns Promise + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDelete( + resourceGroupName: string, + options?: ADCCatalogsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * The Update Azure Data Catalog Service operation can be used to update the existing deployment. - * The update call only supports the properties listed in the PATCH body. - * @summary Update Azure Data Catalog Service (PATCH Resource) - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param properties Properties supplied to the Update a data catalog. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, properties: Models.ADCCatalog, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param properties Properties supplied to the Update a data catalog. - * @param callback The callback - */ - update(resourceGroupName: string, properties: Models.ADCCatalog, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param properties Properties supplied to the Update a data catalog. - * @param options The optional parameters - * @param callback The callback + * The Delete Azure Data Catalog Service operation deletes an existing data catalog. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param options The options parameters. */ - update(resourceGroupName: string, properties: Models.ADCCatalog, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, properties: Models.ADCCatalog, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - properties, - options - }, - updateOperationSpec, - callback) as Promise; + async beginDeleteAndWait( + resourceGroupName: string, + options?: ADCCatalogsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(resourceGroupName, options); + return poller.pollUntilDone(); } /** - * The Delete Azure Data Catalog Service operation deletes an existing data catalog. - * @summary Delete Azure Data Catalog Service (DELETE Resource) - * @param resourceGroupName The name of the resource group within the user's subscription. The name - * is case insensitive. - * @param [options] The optional parameters - * @returns Promise + * The Update Azure Data Catalog Service operation can be used to update the existing deployment. The + * update call only supports the properties listed in the PATCH body. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param properties Properties supplied to the Update a data catalog. + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options); + update( + resourceGroupName: string, + properties: ADCCatalog, + options?: ADCCatalogsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, properties, options }, + updateOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listtByResourceGroupOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listtByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataCatalog/catalogs", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataCatalog/catalogs", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ADCCatalogsListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataCatalog/catalogs/{catalogName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.catalogName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], - requestBody: { - parameterPath: "properties", - mapper: { - ...Mappers.ADCCatalog, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataCatalog/catalogs/{catalogName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ADCCatalog }, 201: { bodyMapper: Mappers.ADCCatalog - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataCatalog/catalogs/{catalogName}", + requestBody: Parameters.properties, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.catalogName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataCatalog/catalogs/{catalogName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ADCCatalog - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.catalogName + ], + headerParameters: [Parameters.accept], serializer }; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataCatalog/catalogs/{catalogName}", +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataCatalog/catalogs/{catalogName}", + httpMethod: "DELETE", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.catalogName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "properties", - mapper: { - ...Mappers.ADCCatalog, - required: true - } - }, + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataCatalog/catalogs/{catalogName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.ADCCatalog - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataCatalog/catalogs/{catalogName}", + requestBody: Parameters.properties, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.catalogName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/datacatalog/arm-datacatalog/src/operations/aDCOperations.ts b/sdk/datacatalog/arm-datacatalog/src/operations/aDCOperations.ts index d75dd298f37a..d27ea783852f 100644 --- a/sdk/datacatalog/arm-datacatalog/src/operations/aDCOperations.ts +++ b/sdk/datacatalog/arm-datacatalog/src/operations/aDCOperations.ts @@ -1,74 +1,56 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/aDCOperationsMappers"; +import { ADCOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataCatalogRestClientContext } from "../dataCatalogRestClientContext"; +import { DataCatalogRestClient } from "../dataCatalogRestClient"; +import { + ADCOperationsListOptionalParams, + ADCOperationsListResponse +} from "../models"; -/** Class representing a ADCOperations. */ -export class ADCOperations { - private readonly client: DataCatalogRestClientContext; +/** Class containing ADCOperations operations. */ +export class ADCOperationsImpl implements ADCOperations { + private readonly client: DataCatalogRestClient; /** - * Create a ADCOperations. - * @param {DataCatalogRestClientContext} client Reference to the service client. + * Initialize a new instance of the class ADCOperations class. + * @param client Reference to the service client */ - constructor(client: DataCatalogRestClientContext) { + constructor(client: DataCatalogRestClient) { this.client = client; } /** * Lists all the available Azure Data Catalog service operations. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + list( + options?: ADCOperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.DataCatalog/operations", httpMethod: "GET", - path: "providers/Microsoft.DataCatalog/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationEntityListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/datacatalog/arm-datacatalog/src/operations/index.ts b/sdk/datacatalog/arm-datacatalog/src/operations/index.ts index b2d154cbed2d..c26173e68dce 100644 --- a/sdk/datacatalog/arm-datacatalog/src/operations/index.ts +++ b/sdk/datacatalog/arm-datacatalog/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./aDCOperations"; diff --git a/sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/aDCCatalogs.ts b/sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/aDCCatalogs.ts new file mode 100644 index 000000000000..e4fddeebb26f --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/aDCCatalogs.ts @@ -0,0 +1,93 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ADCCatalogsListtByResourceGroupOptionalParams, + ADCCatalogsListtByResourceGroupResponse, + ADCCatalog, + ADCCatalogsCreateOrUpdateOptionalParams, + ADCCatalogsCreateOrUpdateResponse, + ADCCatalogsGetOptionalParams, + ADCCatalogsGetResponse, + ADCCatalogsDeleteOptionalParams, + ADCCatalogsUpdateOptionalParams, + ADCCatalogsUpdateResponse +} from "../models"; + +/** Interface representing a ADCCatalogs. */ +export interface ADCCatalogs { + /** + * The List catalogs in Resource Group operation lists all the Azure Data Catalogs available under the + * given resource group. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param options The options parameters. + */ + listtByResourceGroup( + resourceGroupName: string, + options?: ADCCatalogsListtByResourceGroupOptionalParams + ): Promise; + /** + * The Create Azure Data Catalog service operation creates a new data catalog service with the + * specified parameters. If the specific service already exists, then any patchable properties will be + * updated and any immutable properties will remain unchanged. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param properties Properties supplied to the Create or Update a data catalog. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + properties: ADCCatalog, + options?: ADCCatalogsCreateOrUpdateOptionalParams + ): Promise; + /** + * The Get Azure Data Catalog Service operation retrieves a json representation of the data catalog. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + options?: ADCCatalogsGetOptionalParams + ): Promise; + /** + * The Delete Azure Data Catalog Service operation deletes an existing data catalog. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + options?: ADCCatalogsDeleteOptionalParams + ): Promise, void>>; + /** + * The Delete Azure Data Catalog Service operation deletes an existing data catalog. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + options?: ADCCatalogsDeleteOptionalParams + ): Promise; + /** + * The Update Azure Data Catalog Service operation can be used to update the existing deployment. The + * update call only supports the properties listed in the PATCH body. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param properties Properties supplied to the Update a data catalog. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + properties: ADCCatalog, + options?: ADCCatalogsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/aDCOperations.ts b/sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/aDCOperations.ts new file mode 100644 index 000000000000..b33fb99f97a0 --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/aDCOperations.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + ADCOperationsListOptionalParams, + ADCOperationsListResponse +} from "../models"; + +/** Interface representing a ADCOperations. */ +export interface ADCOperations { + /** + * Lists all the available Azure Data Catalog service operations. + * @param options The options parameters. + */ + list( + options?: ADCOperationsListOptionalParams + ): Promise; +} diff --git a/sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/index.ts b/sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..c26173e68dce --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/src/operationsInterfaces/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./aDCOperations"; +export * from "./aDCCatalogs"; diff --git a/sdk/datacatalog/arm-datacatalog/test/sampleTest.ts b/sdk/datacatalog/arm-datacatalog/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/datacatalog/arm-datacatalog/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/datacatalog/arm-datacatalog/tsconfig.json b/sdk/datacatalog/arm-datacatalog/tsconfig.json index 87bbf5b5fa49..6e3251194117 100644 --- a/sdk/datacatalog/arm-datacatalog/tsconfig.json +++ b/sdk/datacatalog/arm-datacatalog/tsconfig.json @@ -3,17 +3,17 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/datacatalog/ci.yml b/sdk/datacatalog/ci.yml new file mode 100644 index 000000000000..69f86784fb31 --- /dev/null +++ b/sdk/datacatalog/ci.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/datacatalog/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/datacatalog/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: datacatalog + Artifacts: + - name: azure-arm-datacatalog + safeName: azurearmdatacatalog + \ No newline at end of file diff --git a/sdk/storsimple1200series/arm-storsimple1200series/CHANGELOG.md b/sdk/storsimple1200series/arm-storsimple1200series/CHANGELOG.md new file mode 100644 index 000000000000..f980a809f843 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-01-21) + +The package of @azure/arm-storsimple1200series is using our next generation design principles since version 2.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/storsimple1200series/arm-storsimple1200series/LICENSE b/sdk/storsimple1200series/arm-storsimple1200series/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/storsimple1200series/arm-storsimple1200series/README.md b/sdk/storsimple1200series/arm-storsimple1200series/README.md index d4266c5f180b..0cf93073547b 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/README.md +++ b/sdk/storsimple1200series/arm-storsimple1200series/README.md @@ -1,99 +1,98 @@ -## Azure StorSimpleManagementClient SDK for JavaScript +# Azure StorSimpleManagement client library for JavaScript -This package contains an isomorphic SDK for StorSimpleManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure StorSimpleManagement client. + + + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple1200series/arm-storsimple1200series) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-storsimple1200series) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-storsimple1200series) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. -### How to Install +### Prerequisites -``` +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-storsimple1200series` package + +Install the Azure StorSimpleManagement client library for JavaScript with `npm`: + +```bash npm install @azure/arm-storsimple1200series ``` -### How to use +### Create and authenticate a `StorSimpleManagementClient` -#### nodejs - Authentication, client creation and list managers as an example written in TypeScript. +To create a client object to access the Azure StorSimpleManagement API, you will need the `endpoint` of your Azure StorSimpleManagement resource and a `credential`. The Azure StorSimpleManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure StorSimpleManagement resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -``` -npm install @azure/ms-rest-nodeauth -``` +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -##### Sample code - -```ts -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { StorSimpleManagementClient, StorSimpleManagementModels, StorSimpleManagementMappers } from "@azure/arm-storsimple1200series"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new StorSimpleManagementClient(creds, subscriptionId); - client.managers.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +```bash +npm install @azure/identity ``` -#### browser - Authentication, client creation and list managers as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure StorSimpleManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Install @azure/ms-rest-browserauth +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). +```javascript +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new StorSimpleManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -npm install @azure/ms-rest-browserauth -``` -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-storsimple1200series sample - - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### StorSimpleManagementClient + +`StorSimpleManagementClient` is the primary interface for developers using the Azure StorSimpleManagement client library. Explore the methods on this client object to understand the different features of the Azure StorSimpleManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` -## Related projects +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +## Next steps +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorsimple1200series%2Farm-storsimple1200series%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/storsimple1200series/arm-storsimple1200series/_meta.json b/sdk/storsimple1200series/arm-storsimple1200series/_meta.json new file mode 100644 index 000000000000..fc0d60d64f21 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "readme": "specification/storSimple1200Series/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/storSimple1200Series/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1 --generate-sample=true", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" +} \ No newline at end of file diff --git a/sdk/storsimple1200series/arm-storsimple1200series/api-extractor.json b/sdk/storsimple1200series/arm-storsimple1200series/api-extractor.json new file mode 100644 index 000000000000..9df25f12946a --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-storsimple1200series.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/package.json b/sdk/storsimple1200series/arm-storsimple1200series/package.json index 9a197dea0fdb..d3e1e63ac511 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/package.json +++ b/sdk/storsimple1200series/arm-storsimple1200series/package.json @@ -1,56 +1,106 @@ { "name": "@azure/arm-storsimple1200series", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "StorSimpleManagementClient Library with typescript type definitions for node.js and browser.", - "version": "1.1.0", + "description": "A generated SDK for StorSimpleManagementClient.", + "version": "2.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", - "tslib": "^1.9.3" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-storsimple1200series.js", - "module": "./esm/storSimpleManagementClient.js", - "types": "./esm/storSimpleManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-storsimple1200series.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", - "uglify-js": "^3.4.9" + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/main/sdk/storsimple1200series/arm-storsimple1200series", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple1200series/arm-storsimple1200series", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" - }, - "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-storsimple1200series.js.map'\" -o ./dist/arm-storsimple1200series.min.js ./dist/arm-storsimple1200series.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, - "autoPublish": true + "//metadata": { + "constantPaths": [ + { + "path": "src/StorSimpleManagementClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "//sampleConfiguration": { + "productName": "", + "productSlugs": ["azure"], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-storsimple1200series?view=azure-node-preview" + } } diff --git a/sdk/storsimple1200series/arm-storsimple1200series/recordings/node/my_test/recording_sample_test.js b/sdk/storsimple1200series/arm-storsimple1200series/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/review/arm-storsimple1200series.api.md b/sdk/storsimple1200series/arm-storsimple1200series/review/arm-storsimple1200series.api.md new file mode 100644 index 000000000000..c3e780df2411 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/review/arm-storsimple1200series.api.md @@ -0,0 +1,1708 @@ +## API Report File for "@azure/arm-storsimple1200series" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type AccessControlRecord = BaseModel & { + initiatorName: string; +}; + +// @public +export interface AccessControlRecordList { + value: AccessControlRecord[]; +} + +// @public +export interface AccessControlRecords { + beginCreateOrUpdate(accessControlRecordName: string, resourceGroupName: string, managerName: string, accessControlRecord: AccessControlRecord, options?: AccessControlRecordsCreateOrUpdateOptionalParams): Promise, AccessControlRecordsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(accessControlRecordName: string, resourceGroupName: string, managerName: string, accessControlRecord: AccessControlRecord, options?: AccessControlRecordsCreateOrUpdateOptionalParams): Promise; + beginDelete(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: AccessControlRecordsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: AccessControlRecordsDeleteOptionalParams): Promise; + get(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: AccessControlRecordsGetOptionalParams): Promise; + listByManager(resourceGroupName: string, managerName: string, options?: AccessControlRecordsListByManagerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AccessControlRecordsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccessControlRecordsCreateOrUpdateResponse = AccessControlRecord; + +// @public +export interface AccessControlRecordsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface AccessControlRecordsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessControlRecordsGetResponse = AccessControlRecord; + +// @public +export interface AccessControlRecordsListByManagerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessControlRecordsListByManagerResponse = AccessControlRecordList; + +// @public +export type Alert = BaseModel & { + title: string; + scope: AlertScope; + alertType: string; + appearedAtTime: Date; + appearedAtSourceTime: Date; + clearedAtTime?: Date; + clearedAtSourceTime?: Date; + source: AlertSource; + recommendation?: string; + resolutionReason?: string; + severity: AlertSeverity; + status: AlertStatus; + errorDetails?: AlertErrorDetails; + detailedInformation?: { + [propertyName: string]: string; + }; +}; + +// @public +export type AlertEmailNotificationStatus = "Enabled" | "Disabled"; + +// @public +export interface AlertErrorDetails { + errorCode?: string; + errorMessage?: string; + occurences?: number; +} + +// @public +export interface AlertFilter { + appearedOnTime?: Date; + severity?: AlertSeverity; + sourceName?: string; + sourceType?: AlertSourceType; + status?: AlertStatus; +} + +// @public +export interface AlertList { + nextLink?: string; + value: Alert[]; +} + +// @public +export interface Alerts { + clear(resourceGroupName: string, managerName: string, request: ClearAlertRequest, options?: AlertsClearOptionalParams): Promise; + listByManager(resourceGroupName: string, managerName: string, options?: AlertsListByManagerOptionalParams): PagedAsyncIterableIterator; + sendTestEmail(deviceName: string, resourceGroupName: string, managerName: string, request: SendTestAlertEmailRequest, options?: AlertsSendTestEmailOptionalParams): Promise; +} + +// @public +export interface AlertsClearOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertScope = "Resource" | "Device"; + +// @public +export type AlertSettings = BaseModel & { + emailNotification: AlertEmailNotificationStatus; + notificationToServiceOwners: ServiceOwnersAlertNotificationStatus; + alertNotificationCulture: string; + additionalRecipientEmailList?: string[]; +}; + +// @public +export type AlertSeverity = "Informational" | "Warning" | "Critical"; + +// @public +export interface AlertsListByManagerNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type AlertsListByManagerNextResponse = AlertList; + +// @public +export interface AlertsListByManagerOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type AlertsListByManagerResponse = AlertList; + +// @public +export interface AlertSource { + alertSourceType?: AlertSourceType; + name?: string; + timeZone?: string; +} + +// @public +export type AlertSourceType = "Resource" | "Device"; + +// @public +export interface AlertsSendTestEmailOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertStatus = "Active" | "Cleared"; + +// @public +export interface AsymmetricEncryptedSecret { + encryptionAlgorithm: EncryptionAlgorithm; + encryptionCertificateThumbprint?: string; + value: string; +} + +// @public +export type AuthType = "Invalid" | "AccessControlService" | "AzureActiveDirectory"; + +// @public +export interface AvailableProviderOperation { + display?: AvailableProviderOperationDisplay; + name?: string; + origin?: string; + properties?: Record; +} + +// @public +export interface AvailableProviderOperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface AvailableProviderOperations { + nextLink?: string; + value: AvailableProviderOperation[]; +} + +// @public +export interface AvailableProviderOperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AvailableProviderOperationsListNextResponse = AvailableProviderOperations; + +// @public +export interface AvailableProviderOperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AvailableProviderOperationsListResponse = AvailableProviderOperations; + +// @public +export interface AvailableProviderOperationsOperations { + list(options?: AvailableProviderOperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type Backup = BaseModel & { + targetId?: string; + targetType?: string; + sizeInBytes: number; + createdTime?: Date; + expirationTime?: Date; + initiatedBy: InitiatedBy; + deviceId: string; + elements: BackupElement[]; +}; + +// @public +export type BackupElement = BaseModel & { + sizeInBytes: number; + endpointName: string; + dataPolicy: DataPolicy; +}; + +// @public +export interface BackupFilter { + createdTime?: Date; + initiatedBy?: InitiatedBy; +} + +// @public +export interface BackupList { + nextLink?: string; + value: Backup[]; +} + +// @public +export interface Backups { + beginClone(deviceName: string, backupName: string, elementName: string, resourceGroupName: string, managerName: string, cloneRequest: CloneRequest, options?: BackupsCloneOptionalParams): Promise, void>>; + beginCloneAndWait(deviceName: string, backupName: string, elementName: string, resourceGroupName: string, managerName: string, cloneRequest: CloneRequest, options?: BackupsCloneOptionalParams): Promise; + beginDelete(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: BackupsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: BackupsDeleteOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: BackupsListByDeviceOptionalParams): PagedAsyncIterableIterator; + listByManager(resourceGroupName: string, managerName: string, options?: BackupsListByManagerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type BackupScheduleGroup = BaseModel & { + startTime: Time; +}; + +// @public +export interface BackupScheduleGroupList { + value: BackupScheduleGroup[]; +} + +// @public +export interface BackupScheduleGroups { + beginCreateOrUpdate(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, scheduleGroup: BackupScheduleGroup, options?: BackupScheduleGroupsCreateOrUpdateOptionalParams): Promise, BackupScheduleGroupsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, scheduleGroup: BackupScheduleGroup, options?: BackupScheduleGroupsCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: BackupScheduleGroupsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: BackupScheduleGroupsDeleteOptionalParams): Promise; + get(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: BackupScheduleGroupsGetOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: BackupScheduleGroupsListByDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BackupScheduleGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupScheduleGroupsCreateOrUpdateResponse = BackupScheduleGroup; + +// @public +export interface BackupScheduleGroupsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BackupScheduleGroupsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupScheduleGroupsGetResponse = BackupScheduleGroup; + +// @public +export interface BackupScheduleGroupsListByDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupScheduleGroupsListByDeviceResponse = BackupScheduleGroupList; + +// @public +export interface BackupsCloneOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BackupsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BackupsListByDeviceNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + forFailover?: boolean; +} + +// @public +export type BackupsListByDeviceNextResponse = BackupList; + +// @public +export interface BackupsListByDeviceOptionalParams extends coreClient.OperationOptions { + filter?: string; + forFailover?: boolean; +} + +// @public +export type BackupsListByDeviceResponse = BackupList; + +// @public +export interface BackupsListByManagerNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type BackupsListByManagerNextResponse = BackupList; + +// @public +export interface BackupsListByManagerOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type BackupsListByManagerResponse = BackupList; + +// @public +export interface BaseModel { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type ChapSettings = BaseModel & { + password: AsymmetricEncryptedSecret; +}; + +// @public +export interface ChapSettingsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ChapSettingsCreateOrUpdateResponse = ChapSettings; + +// @public +export interface ChapSettingsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ChapSettingsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ChapSettingsGetResponse = ChapSettings; + +// @public +export interface ChapSettingsList { + value: ChapSettings[]; +} + +// @public +export interface ChapSettingsListByDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ChapSettingsListByDeviceResponse = ChapSettingsList; + +// @public +export interface ChapSettingsOperations { + beginCreateOrUpdate(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, chapSetting: ChapSettings, options?: ChapSettingsCreateOrUpdateOptionalParams): Promise, ChapSettingsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, chapSetting: ChapSettings, options?: ChapSettingsCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: ChapSettingsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: ChapSettingsDeleteOptionalParams): Promise; + get(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: ChapSettingsGetOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: ChapSettingsListByDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ClearAlertRequest { + alerts: string[]; + resolutionMessage?: string; +} + +// @public +export interface CloneRequest { + disk?: IscsiDisk; + newEndpointName: string; + share?: FileShare; + targetAccessPointId: string; + targetDeviceId: string; +} + +// @public +export type CloudType = "Azure" | "S3" | "S3_RRS" | "OpenStack" | "HP"; + +// @public +export type ContractVersions = "InvalidVersion" | "V2011_09" | "V2012_02" | "V2012_05" | "V2012_12" | "V2013_04" | "V2013_10" | "V2013_11" | "V2014_04" | "V2014_06" | "V2014_07" | "V2014_09" | "V2014_10" | "V2014_12" | "V2015_01" | "V2015_02" | "V2015_04" | "V2015_05" | "V2015_06" | "V2015_07" | "V2015_08" | "V2015_10" | "V2015_12" | "V2016_01" | "V2016_02" | "V2016_04" | "V2016_05" | "V2016_07" | "V2016_08"; + +// @public +export type DataPolicy = "Invalid" | "Local" | "Tiered" | "Cloud"; + +// @public +export type Device = BaseModel & { + activationTime?: Date; + allowedDeviceOperations?: DeviceOperation[]; + culture?: string; + deviceCapabilities?: SupportedDeviceCapabilities[]; + deviceDescription?: string; + domainName?: string; + deviceSoftwareVersion?: string; + friendlySoftwareName?: string; + deviceConfigurationStatus?: DeviceConfigurationStatus; + modelDescription?: string; + status?: DeviceStatus; + typePropertiesType?: DeviceType; + details?: DeviceDetails; +}; + +// @public +export type DeviceConfigurationStatus = "Complete" | "Pending"; + +// @public +export interface DeviceDetails { + availableLocalStorageInBytes?: number; + availableStorageInBytes?: number; + endpointCount?: number; + provisionedLocalStorageInBytes?: number; + provisionedStorageInBytes?: number; + totalBackupSizeInBytes?: number; + totalLocalStorageInBytes?: number; + totalStorageInBytes?: number; + usingLocalStorageInBytes?: number; + usingStorageInBytes?: number; +} + +// @public +export interface DeviceList { + value: Device[]; +} + +// @public +export type DeviceOperation = "None" | "Delete" | "DeleteWithWarning" | "DRSource" | "DRTarget" | "Browsable" | "ReadOnlyForDR" | "Deactivate"; + +// @public +export interface DevicePatch { + deviceDescription?: string; +} + +// @public +export interface Devices { + beginCreateOrUpdateAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, alertSettings: AlertSettings, options?: DevicesCreateOrUpdateAlertSettingsOptionalParams): Promise, DevicesCreateOrUpdateAlertSettingsResponse>>; + beginCreateOrUpdateAlertSettingsAndWait(deviceName: string, resourceGroupName: string, managerName: string, alertSettings: AlertSettings, options?: DevicesCreateOrUpdateAlertSettingsOptionalParams): Promise; + beginCreateOrUpdateSecuritySettings(deviceName: string, resourceGroupName: string, managerName: string, securitySettings: SecuritySettings, options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams): Promise, void>>; + beginCreateOrUpdateSecuritySettingsAndWait(deviceName: string, resourceGroupName: string, managerName: string, securitySettings: SecuritySettings, options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams): Promise; + beginDeactivate(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesDeactivateOptionalParams): Promise, void>>; + beginDeactivateAndWait(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesDeactivateOptionalParams): Promise; + beginDelete(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesDeleteOptionalParams): Promise; + beginDownloadUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesDownloadUpdatesOptionalParams): Promise, void>>; + beginDownloadUpdatesAndWait(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesDownloadUpdatesOptionalParams): Promise; + beginFailover(deviceName: string, resourceGroupName: string, managerName: string, failoverRequest: FailoverRequest, options?: DevicesFailoverOptionalParams): Promise, void>>; + beginFailoverAndWait(deviceName: string, resourceGroupName: string, managerName: string, failoverRequest: FailoverRequest, options?: DevicesFailoverOptionalParams): Promise; + beginInstallUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesInstallUpdatesOptionalParams): Promise, void>>; + beginInstallUpdatesAndWait(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesInstallUpdatesOptionalParams): Promise; + beginPatch(deviceName: string, resourceGroupName: string, managerName: string, devicePatch: DevicePatch, options?: DevicesPatchOptionalParams): Promise, DevicesPatchResponse>>; + beginPatchAndWait(deviceName: string, resourceGroupName: string, managerName: string, devicePatch: DevicePatch, options?: DevicesPatchOptionalParams): Promise; + beginScanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesScanForUpdatesOptionalParams): Promise, void>>; + beginScanForUpdatesAndWait(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesScanForUpdatesOptionalParams): Promise; + get(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesGetOptionalParams): Promise; + getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesGetAlertSettingsOptionalParams): Promise; + getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesGetNetworkSettingsOptionalParams): Promise; + getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesGetTimeSettingsOptionalParams): Promise; + getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesGetUpdateSummaryOptionalParams): Promise; + listByManager(resourceGroupName: string, managerName: string, options?: DevicesListByManagerOptionalParams): PagedAsyncIterableIterator; + listFailoverTarget(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesListFailoverTargetOptionalParams): PagedAsyncIterableIterator; + listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesListMetricDefinitionOptionalParams): PagedAsyncIterableIterator; + listMetrics(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesListMetricsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DevicesCreateOrUpdateAlertSettingsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DevicesCreateOrUpdateAlertSettingsResponse = AlertSettings; + +// @public +export interface DevicesCreateOrUpdateSecuritySettingsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesDeactivateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesDownloadUpdatesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesFailoverOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesGetAlertSettingsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesGetAlertSettingsResponse = AlertSettings; + +// @public +export interface DevicesGetNetworkSettingsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesGetNetworkSettingsResponse = NetworkSettings; + +// @public +export interface DevicesGetOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type DevicesGetResponse = Device; + +// @public +export interface DevicesGetTimeSettingsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesGetTimeSettingsResponse = TimeSettings; + +// @public +export interface DevicesGetUpdateSummaryOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesGetUpdateSummaryResponse = Updates; + +// @public +export interface DevicesInstallUpdatesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesListByManagerOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type DevicesListByManagerResponse = DeviceList; + +// @public +export interface DevicesListFailoverTargetOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type DevicesListFailoverTargetResponse = DeviceList; + +// @public +export interface DevicesListMetricDefinitionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesListMetricDefinitionResponse = MetricDefinitionList; + +// @public +export interface DevicesListMetricsOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type DevicesListMetricsResponse = MetricList; + +// @public +export interface DevicesPatchOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DevicesPatchResponse = Device; + +// @public +export interface DevicesScanForUpdatesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeviceStatus = "Unknown" | "Online" | "Offline" | "RequiresAttention" | "MaintenanceMode" | "Creating" | "Provisioning" | "Deleted" | "ReadyToSetup" | "Deactivated" | "Deactivating"; + +// @public +export type DeviceType = "Invalid" | "Appliance" | "VirtualAppliance" | "Series9000OnPremVirtualAppliance" | "Series9000VirtualAppliance" | "Series9000PhysicalAppliance"; + +// @public +export type DhcpStatus = "Enabled" | "Disabled"; + +// @public +export type DiskStatus = "Online" | "Offline"; + +// @public +export type DownloadPhase = "Unknown" | "Initializing" | "Downloading" | "Verifying"; + +// @public +export type EncryptionAlgorithm = "None" | "AES256" | "RSAES_PKCS1_v_1_5"; + +// @public +export type EncryptionSettings = BaseModel & { + encryptionStatus: EncryptionStatus; + keyRolloverStatus: KeyRolloverStatus; +}; + +// @public +export type EncryptionStatus = "Enabled" | "Disabled"; + +// @public (undocumented) +export interface ErrorModel { + // (undocumented) + errorCode: string; + // (undocumented) + message: Message; + // (undocumented) + values?: Item[]; +} + +// @public +export interface FailoverRequest { + // (undocumented) + accesspointIds?: string[]; + // (undocumented) + keepSourceDevice?: boolean; + // (undocumented) + skipValidation?: boolean; + // (undocumented) + targetDeviceId?: string; +} + +// @public +export type FileServer = BaseModel & { + domainName: string; + storageDomainId: string; + backupScheduleGroupId: string; + description?: string; +}; + +// @public +export interface FileServerList { + value: FileServer[]; +} + +// @public +export interface FileServers { + beginBackupNow(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: FileServersBackupNowOptionalParams): Promise, void>>; + beginBackupNowAndWait(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: FileServersBackupNowOptionalParams): Promise; + beginCreateOrUpdate(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, fileServer: FileServer, options?: FileServersCreateOrUpdateOptionalParams): Promise, FileServersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, fileServer: FileServer, options?: FileServersCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: FileServersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: FileServersDeleteOptionalParams): Promise; + get(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: FileServersGetOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: FileServersListByDeviceOptionalParams): PagedAsyncIterableIterator; + listByManager(resourceGroupName: string, managerName: string, options?: FileServersListByManagerOptionalParams): PagedAsyncIterableIterator; + listMetricDefinition(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: FileServersListMetricDefinitionOptionalParams): PagedAsyncIterableIterator; + listMetrics(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: FileServersListMetricsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FileServersBackupNowOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface FileServersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FileServersCreateOrUpdateResponse = FileServer; + +// @public +export interface FileServersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface FileServersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileServersGetResponse = FileServer; + +// @public +export interface FileServersListByDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileServersListByDeviceResponse = FileServerList; + +// @public +export interface FileServersListByManagerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileServersListByManagerResponse = FileServerList; + +// @public +export interface FileServersListMetricDefinitionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileServersListMetricDefinitionResponse = MetricDefinitionList; + +// @public +export interface FileServersListMetricsOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type FileServersListMetricsResponse = MetricList; + +// @public +export type FileShare = BaseModel & { + description?: string; + shareStatus: ShareStatus; + dataPolicy: DataPolicy; + adminUser: string; + provisionedCapacityInBytes: number; + readonly usedCapacityInBytes?: number; + readonly localUsedCapacityInBytes?: number; + monitoringStatus: MonitoringStatus; +}; + +// @public +export interface FileShareList { + value: FileShare[]; +} + +// @public +export interface FileShares { + beginCreateOrUpdate(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, fileShare: FileShare, options?: FileSharesCreateOrUpdateOptionalParams): Promise, FileSharesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, fileShare: FileShare, options?: FileSharesCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: FileSharesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: FileSharesDeleteOptionalParams): Promise; + get(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: FileSharesGetOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: FileSharesListByDeviceOptionalParams): PagedAsyncIterableIterator; + listByFileServer(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: FileSharesListByFileServerOptionalParams): PagedAsyncIterableIterator; + listMetricDefinition(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: FileSharesListMetricDefinitionOptionalParams): PagedAsyncIterableIterator; + listMetrics(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: FileSharesListMetricsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FileSharesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FileSharesCreateOrUpdateResponse = FileShare; + +// @public +export interface FileSharesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface FileSharesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileSharesGetResponse = FileShare; + +// @public +export interface FileSharesListByDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileSharesListByDeviceResponse = FileShareList; + +// @public +export interface FileSharesListByFileServerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileSharesListByFileServerResponse = FileShareList; + +// @public +export interface FileSharesListMetricDefinitionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileSharesListMetricDefinitionResponse = MetricDefinitionList; + +// @public +export interface FileSharesListMetricsOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type FileSharesListMetricsResponse = MetricList; + +// @public +export type InitiatedBy = "Manual" | "Scheduled"; + +// @public +export interface IPConfig { + gateway: string; + ipAddress: string; + prefixLength?: number; +} + +// @public +export type IscsiDisk = BaseModel & { + description?: string; + diskStatus: DiskStatus; + accessControlRecords: string[]; + dataPolicy: DataPolicy; + provisionedCapacityInBytes: number; + readonly usedCapacityInBytes?: number; + readonly localUsedCapacityInBytes?: number; + monitoringStatus: MonitoringStatus; +}; + +// @public +export interface IscsiDiskList { + value: IscsiDisk[]; +} + +// @public +export interface IscsiDisks { + beginCreateOrUpdate(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, iscsiDisk: IscsiDisk, options?: IscsiDisksCreateOrUpdateOptionalParams): Promise, IscsiDisksCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, iscsiDisk: IscsiDisk, options?: IscsiDisksCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: IscsiDisksDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: IscsiDisksDeleteOptionalParams): Promise; + get(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: IscsiDisksGetOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: IscsiDisksListByDeviceOptionalParams): PagedAsyncIterableIterator; + listByIscsiServer(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: IscsiDisksListByIscsiServerOptionalParams): PagedAsyncIterableIterator; + listMetricDefinition(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: IscsiDisksListMetricDefinitionOptionalParams): PagedAsyncIterableIterator; + listMetrics(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: IscsiDisksListMetricsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface IscsiDisksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type IscsiDisksCreateOrUpdateResponse = IscsiDisk; + +// @public +export interface IscsiDisksDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface IscsiDisksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IscsiDisksGetResponse = IscsiDisk; + +// @public +export interface IscsiDisksListByDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IscsiDisksListByDeviceResponse = IscsiDiskList; + +// @public +export interface IscsiDisksListByIscsiServerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IscsiDisksListByIscsiServerResponse = IscsiDiskList; + +// @public +export interface IscsiDisksListMetricDefinitionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IscsiDisksListMetricDefinitionResponse = MetricDefinitionList; + +// @public +export interface IscsiDisksListMetricsOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type IscsiDisksListMetricsResponse = MetricList; + +// @public +export type IscsiServer = BaseModel & { + storageDomainId: string; + backupScheduleGroupId: string; + description?: string; + chapId?: string; + reverseChapId?: string; +}; + +// @public +export interface IscsiServerList { + value: IscsiServer[]; +} + +// @public +export interface IscsiServers { + beginBackupNow(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: IscsiServersBackupNowOptionalParams): Promise, void>>; + beginBackupNowAndWait(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: IscsiServersBackupNowOptionalParams): Promise; + beginCreateOrUpdate(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, iscsiServer: IscsiServer, options?: IscsiServersCreateOrUpdateOptionalParams): Promise, IscsiServersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, iscsiServer: IscsiServer, options?: IscsiServersCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: IscsiServersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: IscsiServersDeleteOptionalParams): Promise; + get(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: IscsiServersGetOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: IscsiServersListByDeviceOptionalParams): PagedAsyncIterableIterator; + listByManager(resourceGroupName: string, managerName: string, options?: IscsiServersListByManagerOptionalParams): PagedAsyncIterableIterator; + listMetricDefinition(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: IscsiServersListMetricDefinitionOptionalParams): PagedAsyncIterableIterator; + listMetrics(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: IscsiServersListMetricsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface IscsiServersBackupNowOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface IscsiServersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type IscsiServersCreateOrUpdateResponse = IscsiServer; + +// @public +export interface IscsiServersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface IscsiServersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IscsiServersGetResponse = IscsiServer; + +// @public +export interface IscsiServersListByDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IscsiServersListByDeviceResponse = IscsiServerList; + +// @public +export interface IscsiServersListByManagerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IscsiServersListByManagerResponse = IscsiServerList; + +// @public +export interface IscsiServersListMetricDefinitionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IscsiServersListMetricDefinitionResponse = MetricDefinitionList; + +// @public +export interface IscsiServersListMetricsOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type IscsiServersListMetricsResponse = MetricList; + +// @public (undocumented) +export interface Item { + // (undocumented) + key: string; + // (undocumented) + value: string; +} + +// @public +export type Job = BaseModel & { + status: JobStatus; + startTime?: Date; + endTime?: Date; + percentComplete: number; + error?: JobErrorDetails; + jobType?: JobType; + targetId?: string; + entityId?: string; + entityType?: string; + jobStages?: JobStage[]; + deviceId?: string; + isCancellable?: boolean; + stats?: JobStats; + targetType?: TargetType; + sourceDeviceId?: string; + backupPointInTime?: Date; + downloadProgress?: UpdateDownloadProgress; + installProgress?: UpdateInstallProgress; +}; + +// @public +export interface JobErrorDetails { + code: string; + errorDetails?: JobErrorItem[]; + message: string; +} + +// @public +export interface JobErrorItem { + code: string; + message: string; + recommendations?: string[]; +} + +// @public +export interface JobFilter { + jobType: JobType; + startTime?: Date; + status: JobStatus; +} + +// @public +export interface JobList { + nextLink?: string; + value: Job[]; +} + +// @public +export interface Jobs { + get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: JobsGetOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: JobsListByDeviceOptionalParams): PagedAsyncIterableIterator; + listByManager(resourceGroupName: string, managerName: string, options?: JobsListByManagerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface JobsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type JobsGetResponse = Job; + +// @public +export interface JobsListByDeviceNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type JobsListByDeviceNextResponse = JobList; + +// @public +export interface JobsListByDeviceOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type JobsListByDeviceResponse = JobList; + +// @public +export interface JobsListByManagerNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type JobsListByManagerNextResponse = JobList; + +// @public +export interface JobsListByManagerOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type JobsListByManagerResponse = JobList; + +// @public +export interface JobStage { + detail?: string; + errorCode?: string; + message?: string; + stageStatus: JobStatus; +} + +// @public +export interface JobStats { + completedWorkItemCount?: number; + estimatedTimeRemaining?: number; + totalWorkItemCount?: number; +} + +// @public +export type JobStatus = "Invalid" | "Running" | "Succeeded" | "Failed" | "Canceled" | "Paused" | "Scheduled"; + +// @public +export type JobType = "Backup" | "Clone" | "Failover" | "DownloadUpdates" | "InstallUpdates"; + +// @public +export type KeyRolloverStatus = "Required" | "NotRequired"; + +// @public +export type Manager = Resource & { + etag?: string; + cisIntrinsicSettings?: ManagerIntrinsicSettings; + sku?: ManagerSku; + readonly provisioningState?: string; +}; + +// @public +export type ManagerExtendedInfo = BaseModel & { + etag?: string; + version?: string; + integrityKey: string; + encryptionKey?: string; + encryptionKeyThumbprint?: string; + portalCertificateThumbprint?: string; + algorithm: string; +}; + +// @public +export interface ManagerIntrinsicSettings { + type: ManagerType; +} + +// @public +export interface ManagerList { + value: Manager[]; +} + +// @public +export interface ManagerPatch { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface Managers { + createExtendedInfo(resourceGroupName: string, managerName: string, managerExtendedInfo: ManagerExtendedInfo, options?: ManagersCreateExtendedInfoOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, managerName: string, manager: Manager, options?: ManagersCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, managerName: string, options?: ManagersDeleteOptionalParams): Promise; + deleteExtendedInfo(resourceGroupName: string, managerName: string, options?: ManagersDeleteExtendedInfoOptionalParams): Promise; + get(resourceGroupName: string, managerName: string, options?: ManagersGetOptionalParams): Promise; + getEncryptionKey(resourceGroupName: string, managerName: string, options?: ManagersGetEncryptionKeyOptionalParams): Promise; + getEncryptionSettings(resourceGroupName: string, managerName: string, options?: ManagersGetEncryptionSettingsOptionalParams): Promise; + getExtendedInfo(resourceGroupName: string, managerName: string, options?: ManagersGetExtendedInfoOptionalParams): Promise; + list(options?: ManagersListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: ManagersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listMetricDefinition(resourceGroupName: string, managerName: string, options?: ManagersListMetricDefinitionOptionalParams): PagedAsyncIterableIterator; + listMetrics(resourceGroupName: string, managerName: string, options?: ManagersListMetricsOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, managerName: string, parameters: ManagerPatch, options?: ManagersUpdateOptionalParams): Promise; + updateExtendedInfo(resourceGroupName: string, managerName: string, ifMatch: string, managerExtendedInfo: ManagerExtendedInfo, options?: ManagersUpdateExtendedInfoOptionalParams): Promise; + uploadRegistrationCertificate(certificateName: string, resourceGroupName: string, managerName: string, uploadCertificateRequestrequest: UploadCertificateRequest, options?: ManagersUploadRegistrationCertificateOptionalParams): Promise; +} + +// @public +export interface ManagersCreateExtendedInfoOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersCreateExtendedInfoResponse = ManagerExtendedInfo; + +// @public +export interface ManagersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersCreateOrUpdateResponse = Manager; + +// @public +export interface ManagersDeleteExtendedInfoOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ManagersDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ManagersGetEncryptionKeyOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersGetEncryptionKeyResponse = SymmetricEncryptedSecret; + +// @public +export interface ManagersGetEncryptionSettingsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersGetEncryptionSettingsResponse = EncryptionSettings; + +// @public +export interface ManagersGetExtendedInfoOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersGetExtendedInfoResponse = ManagerExtendedInfo; + +// @public +export interface ManagersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersGetResponse = Manager; + +// @public +export interface ManagerSku { + name: "Standard"; +} + +// @public +export interface ManagersListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersListByResourceGroupResponse = ManagerList; + +// @public +export interface ManagersListMetricDefinitionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersListMetricDefinitionResponse = MetricDefinitionList; + +// @public +export interface ManagersListMetricsOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ManagersListMetricsResponse = MetricList; + +// @public +export interface ManagersListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersListResponse = ManagerList; + +// @public +export interface ManagersUpdateExtendedInfoOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersUpdateExtendedInfoResponse = ManagerExtendedInfo; + +// @public +export interface ManagersUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersUpdateResponse = Manager; + +// @public +export interface ManagersUploadRegistrationCertificateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersUploadRegistrationCertificateResponse = UploadCertificateResponse; + +// @public +export type ManagerType = "GardaV1" | "HelsinkiV1"; + +// @public (undocumented) +export interface Message { + // (undocumented) + language?: string; + // (undocumented) + value?: string; +} + +// @public +export type MetricAggregationType = "Average" | "Last" | "Maximum" | "Minimum" | "None" | "Total"; + +// @public +export interface MetricAvailablity { + retention: string; + timeGrain: string; +} + +// @public +export interface MetricData { + average: number; + count: number; + maximum: number; + minimum: number; + sum: number; + timeStamp: Date; +} + +// @public +export interface MetricDefinition { + dimensions: MetricDimension[]; + metricAvailabilities: MetricAvailablity[]; + name: MetricName; + primaryAggregationType: MetricAggregationType; + resourceId: string; + type: string; + unit: MetricUnit; +} + +// @public +export interface MetricDefinitionList { + value: MetricDefinition[]; +} + +// @public +export interface MetricDimension { + name: string; + value: string; +} + +// @public +export interface MetricFilter { + endTime?: Date; + name?: MetricNameFilter; + startTime?: Date; + timeGrain?: string; +} + +// @public +export interface MetricList { + value: Metrics[]; +} + +// @public +export interface MetricName { + localizedValue: string; + value: string; +} + +// @public +export interface MetricNameFilter { + value?: string; +} + +// @public +export interface Metrics { + dimensions: MetricDimension[]; + endTime: Date; + name: MetricName; + primaryAggregation: MetricAggregationType; + resourceId: string; + startTime: Date; + timeGrain: string; + type: string; + unit: MetricUnit; + values: MetricData[]; +} + +// @public +export type MetricUnit = "Bytes" | "BytesPerSecond" | "Count" | "CountPerSecond" | "Percent" | "Seconds"; + +// @public +export type MonitoringStatus = "Enabled" | "Disabled"; + +// @public +export interface NetworkAdapter { + dhcpStatus: DhcpStatus; + iPv4Info?: IPConfig; + iPv6Info?: IPConfig; + linkSpeed?: number; + networkAdapterName: string; +} + +// @public +export type NetworkSettings = BaseModel & { + primaryDnsServer: string; + secondaryDnsServer?: string; + nodeNetworks: NodeNetwork[]; +}; + +// @public +export interface NodeNetwork { + networkAdapters: NetworkAdapter[]; +} + +// @public +export interface Resource { + readonly id?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export type SecuritySettings = BaseModel & { + deviceAdminPassword: AsymmetricEncryptedSecret; +}; + +// @public +export interface SendTestAlertEmailRequest { + emailList: string[]; +} + +// @public +export type ServiceOwnersAlertNotificationStatus = "Enabled" | "Disabled"; + +// @public +export type ShareStatus = "Online" | "Offline"; + +// @public +export type SslStatus = "Enabled" | "Disabled"; + +// @public +export type StorageAccountCredential = BaseModel & { + cloudType: CloudType; + endPoint: string; + login: string; + location?: string; + enableSSL: SslStatus; + accessKey?: AsymmetricEncryptedSecret; +}; + +// @public +export interface StorageAccountCredentialList { + value: StorageAccountCredential[]; +} + +// @public +export interface StorageAccountCredentials { + beginCreateOrUpdate(credentialName: string, resourceGroupName: string, managerName: string, storageAccount: StorageAccountCredential, options?: StorageAccountCredentialsCreateOrUpdateOptionalParams): Promise, StorageAccountCredentialsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(credentialName: string, resourceGroupName: string, managerName: string, storageAccount: StorageAccountCredential, options?: StorageAccountCredentialsCreateOrUpdateOptionalParams): Promise; + beginDelete(credentialName: string, resourceGroupName: string, managerName: string, options?: StorageAccountCredentialsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(credentialName: string, resourceGroupName: string, managerName: string, options?: StorageAccountCredentialsDeleteOptionalParams): Promise; + get(credentialName: string, resourceGroupName: string, managerName: string, options?: StorageAccountCredentialsGetOptionalParams): Promise; + listByManager(resourceGroupName: string, managerName: string, options?: StorageAccountCredentialsListByManagerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface StorageAccountCredentialsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageAccountCredentialsCreateOrUpdateResponse = StorageAccountCredential; + +// @public +export interface StorageAccountCredentialsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface StorageAccountCredentialsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAccountCredentialsGetResponse = StorageAccountCredential; + +// @public +export interface StorageAccountCredentialsListByManagerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAccountCredentialsListByManagerResponse = StorageAccountCredentialList; + +// @public +export type StorageDomain = BaseModel & { + storageAccountCredentialIds: string[]; + encryptionKey?: AsymmetricEncryptedSecret; + encryptionStatus: EncryptionStatus; +}; + +// @public +export interface StorageDomainList { + value: StorageDomain[]; +} + +// @public +export interface StorageDomains { + beginCreateOrUpdate(storageDomainName: string, resourceGroupName: string, managerName: string, storageDomain: StorageDomain, options?: StorageDomainsCreateOrUpdateOptionalParams): Promise, StorageDomainsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(storageDomainName: string, resourceGroupName: string, managerName: string, storageDomain: StorageDomain, options?: StorageDomainsCreateOrUpdateOptionalParams): Promise; + beginDelete(storageDomainName: string, resourceGroupName: string, managerName: string, options?: StorageDomainsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(storageDomainName: string, resourceGroupName: string, managerName: string, options?: StorageDomainsDeleteOptionalParams): Promise; + get(storageDomainName: string, resourceGroupName: string, managerName: string, options?: StorageDomainsGetOptionalParams): Promise; + listByManager(resourceGroupName: string, managerName: string, options?: StorageDomainsListByManagerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface StorageDomainsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageDomainsCreateOrUpdateResponse = StorageDomain; + +// @public +export interface StorageDomainsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface StorageDomainsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageDomainsGetResponse = StorageDomain; + +// @public +export interface StorageDomainsListByManagerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageDomainsListByManagerResponse = StorageDomainList; + +// @public (undocumented) +export class StorSimpleManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: StorSimpleManagementClientOptionalParams); + // (undocumented) + accessControlRecords: AccessControlRecords; + // (undocumented) + alerts: Alerts; + // (undocumented) + apiVersion: string; + // (undocumented) + availableProviderOperationsOperations: AvailableProviderOperationsOperations; + // (undocumented) + backups: Backups; + // (undocumented) + backupScheduleGroups: BackupScheduleGroups; + // (undocumented) + chapSettingsOperations: ChapSettingsOperations; + // (undocumented) + devices: Devices; + // (undocumented) + fileServers: FileServers; + // (undocumented) + fileShares: FileShares; + // (undocumented) + iscsiDisks: IscsiDisks; + // (undocumented) + iscsiServers: IscsiServers; + // (undocumented) + jobs: Jobs; + // (undocumented) + managers: Managers; + // (undocumented) + storageAccountCredentials: StorageAccountCredentials; + // (undocumented) + storageDomains: StorageDomains; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface StorSimpleManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type SupportedDeviceCapabilities = "Invalid" | "FileServer" | "IscsiServer"; + +// @public +export interface SymmetricEncryptedSecret { + encryptionAlgorithm: EncryptionAlgorithm; + value: string; + valueCertificateThumbprint?: string; +} + +// @public +export type TargetType = "FileServer" | "DiskServer"; + +// @public +export interface Time { + hour: number; + minute: number; +} + +// @public +export type TimeSettings = BaseModel & { + timeZone: string; + primaryTimeServer: string; + secondaryTimeServer?: string; +}; + +// @public +export interface UpdateDownloadProgress { + downloadPhase?: DownloadPhase; + numberOfUpdatesDownloaded?: number; + numberOfUpdatesToDownload?: number; + percentComplete?: number; + totalBytesDownloaded?: number; + totalBytesToDownload?: number; +} + +// @public +export interface UpdateInstallProgress { + numberOfUpdatesInstalled?: number; + numberOfUpdatesToInstall?: number; + percentComplete?: number; +} + +// @public +export type UpdateOperation = "Idle" | "Scanning" | "Downloading" | "Installing"; + +// @public +export type Updates = BaseModel & { + deviceVersion?: string; + deviceLastScannedTime?: Date; + regularUpdatesAvailable?: boolean; + rebootRequiredForInstall?: boolean; + totalItemsPendingForDownload?: number; + totalItemsPendingForInstall?: number; + status?: UpdateOperation; + lastCompletedScanTime?: Date; + lastCompletedDownloadJobTime?: Date; + lastCompletedInstallJobTime?: Date; + inProgressDownloadJobId?: string; + inProgressInstallJobId?: string; + inProgressScanStartedTime?: Date; + inProgressDownloadJobStartedTime?: Date; + inProgressInstallJobStartedTime?: Date; +}; + +// @public +export interface UploadCertificateRequest { + authType?: AuthType; + certificate: string; + readonly contractVersion?: ContractVersions; +} + +// @public +export type UploadCertificateResponse = BaseModel & { + authType?: AuthType; + certificate: string; + resourceId: number; + aadAuthority: string; + aadTenantId: string; + servicePrincipalClientId: string; + servicePrincipalObjectId: string; + azureManagementEndpointAudience: string; + subject: string; + validFrom: Date; + validTo: Date; + thumbprint: string; + friendlyName: string; + issuer: string; +}; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/storsimple1200series/arm-storsimple1200series/rollup.config.js b/sdk/storsimple1200series/arm-storsimple1200series/rollup.config.js index f5260e972e41..9be1955eb7f1 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/rollup.config.js +++ b/sdk/storsimple1200series/arm-storsimple1200series/rollup.config.js @@ -1,31 +1,188 @@ -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + /** - * @type {import('rollup').RollupFileOptions} + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. */ -const config = { - input: './esm/storSimpleManagementClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], - output: { - file: "./dist/arm-storsimple1200series.js", - format: "umd", - name: "Azure.ArmStorsimple1200series", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */` - }, - plugins: [ - nodeResolve({ module: true }) - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/sample.env b/sdk/storsimple1200series/arm-storsimple1200series/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsCreateOrUpdate.ts new file mode 100644 index 000000000000..ad818047715b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsCreateOrUpdate.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or Updates an access control record. + * + * @summary Creates or Updates an access control record. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsCreateOrUpdate.json + */ +import { + AccessControlRecord, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const accessControlRecordName = "AcrForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const accessControlRecord: AccessControlRecord = { + name: "AcrForSDKTest", + initiatorName: "iqn.2017-06.com.contoso:ForTest" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.beginCreateOrUpdateAndWait( + accessControlRecordName, + resourceGroupName, + managerName, + accessControlRecord + ); + console.log(result); +} + +accessControlRecordsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsDelete.ts new file mode 100644 index 000000000000..07f6e830f98e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsDelete.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the access control record. + * + * @summary Deletes the access control record. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const accessControlRecordName = "AcrForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.beginDeleteAndWait( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsGet.ts new file mode 100644 index 000000000000..4fe6dd4ee7d6 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsGet.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified access control record name. + * + * @summary Returns the properties of the specified access control record name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const accessControlRecordName = "AcrForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.get( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsListByManager.ts new file mode 100644 index 000000000000..e4b619484831 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/accessControlRecordsListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the access control records in a manager. + * + * @summary Retrieves all the access control records in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessControlRecords.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +accessControlRecordsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsClear.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsClear.ts new file mode 100644 index 000000000000..a4623e0fc231 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsClear.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clear the alerts. + * + * @summary Clear the alerts. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsClear.json + */ +import { + ClearAlertRequest, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsClear() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const request: ClearAlertRequest = { + alerts: [ + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hManagerForSDKTest4/devices/is2-hlmdhdgu1et/alerts/a1f3a945-74dc-4387-bf17-a4f226374833" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.alerts.clear( + resourceGroupName, + managerName, + request + ); + console.log(result); +} + +alertsClear().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsListByManager.ts new file mode 100644 index 000000000000..8ac9dfa9ff87 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the alerts in a manager. + * + * @summary Retrieves all the alerts in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const filter = "status eq 'Active' and severity eq 'Critical'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.alerts.listByManager( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +alertsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsSendTestEmail.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsSendTestEmail.ts new file mode 100644 index 000000000000..67cde92f0297 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/alertsSendTestEmail.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Sends a test alert email. + * + * @summary Sends a test alert email. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsSendTestEmail.json + */ +import { + SendTestAlertEmailRequest, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsSendTestEmail() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "is2-hlmdhdgu1et"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const request: SendTestAlertEmailRequest = { + emailList: ["testemailid@contoso.com"] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.alerts.sendTestEmail( + deviceName, + resourceGroupName, + managerName, + request + ); + console.log(result); +} + +alertsSendTestEmail().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsCreateOrUpdate.ts new file mode 100644 index 000000000000..6ca96614f23f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsCreateOrUpdate.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or Updates the backup schedule Group. + * + * @summary Creates or Updates the backup schedule Group. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsCreateOrUpdate.json + */ +import { + BackupScheduleGroup, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupScheduleGroupsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const scheduleGroupName = "BackupSchGroupForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const scheduleGroup: BackupScheduleGroup = { + name: "BackupSchGroupForSDKTest", + startTime: { hour: 17, minute: 38 } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backupScheduleGroups.beginCreateOrUpdateAndWait( + deviceName, + scheduleGroupName, + resourceGroupName, + managerName, + scheduleGroup + ); + console.log(result); +} + +backupScheduleGroupsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsDelete.ts new file mode 100644 index 000000000000..dfb3f076555b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsDelete.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup schedule group. + * + * @summary Deletes the backup schedule group. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupScheduleGroupsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const scheduleGroupName = "BackupSchGroupForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backupScheduleGroups.beginDeleteAndWait( + deviceName, + scheduleGroupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupScheduleGroupsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsGet.ts new file mode 100644 index 000000000000..79870db7b8d0 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsGet.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified backup schedule group name. + * + * @summary Returns the properties of the specified backup schedule group name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupScheduleGroupsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const scheduleGroupName = "BackupSchGroupForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backupScheduleGroups.get( + deviceName, + scheduleGroupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupScheduleGroupsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsListByDevice.ts new file mode 100644 index 000000000000..1b27cfe814e1 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupScheduleGroupsListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backup schedule groups in a device. + * + * @summary Retrieves all the backup schedule groups in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupScheduleGroupsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backupScheduleGroups.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupScheduleGroupsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsClone.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsClone.ts new file mode 100644 index 000000000000..6e8d446b42fd --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsClone.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clones the given backup element to a new disk or share with given details. + * + * @summary Clones the given backup element to a new disk or share with given details. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsClone.json + */ +import { + CloneRequest, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsClone() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const backupName = "58d33025-e837-41cc-b15f-7c85ced64aab"; + const elementName = "2304968f-91af-4f59-8b79-31e321eee40e"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const cloneRequest: CloneRequest = { + newEndpointName: "ClonedTieredFileShareForSDKTest", + share: { + name: "TieredFileShareForSDKTest", + description: "Restore file Share", + adminUser: "HSDK-4XY4FI2IVGStorSimpleAdmin", + dataPolicy: "Tiered", + monitoringStatus: "Enabled", + provisionedCapacityInBytes: 536870912000, + shareStatus: "Online" + }, + targetAccessPointId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/hsdk-4xy4fi2ivg/fileServers/HSDK-4XY4FI2IVG", + targetDeviceId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/hsdk-4xy4fi2ivg" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backups.beginCloneAndWait( + deviceName, + backupName, + elementName, + resourceGroupName, + managerName, + cloneRequest + ); + console.log(result); +} + +backupsClone().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsDelete.ts new file mode 100644 index 000000000000..a0e5274a2da6 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsDelete.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup. + * + * @summary Deletes the backup. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const backupName = "315c3461-96ad-41bf-af0b-3a8be5113203"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backups.beginDeleteAndWait( + deviceName, + backupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsListByDevice.ts new file mode 100644 index 000000000000..a7a3660f18c8 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backups in a device. Can be used to get the backups for failover also. + * + * @summary Retrieves all the backups in a device. Can be used to get the backups for failover also. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "initiatedBy eq 'Manual'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsListByManager.ts new file mode 100644 index 000000000000..960b1ce77d5c --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/backupsListByManager.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backups in a manager. + * + * @summary Retrieves all the backups in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "createdTime ge '2018-08-10T17:30:03Z' and createdTime le '2018-08-14T17:30:03Z' and initiatedBy eq 'Manual'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.listByManager( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsCreateOrUpdate.ts new file mode 100644 index 000000000000..a13e65f3ffbf --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsCreateOrUpdate.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the chap setting. + * + * @summary Creates or updates the chap setting. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsCreateOrUpdate.json + */ +import { + ChapSettings, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function chapSettingsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const chapUserName = "ChapSettingForSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const chapSetting: ChapSettings = { + name: "ChapSettingForSDK", + password: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertificateThumbprint: + "D73DB57C4CDD6761E159F8D1E8A7D759424983FD", + value: "" + } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.chapSettingsOperations.beginCreateOrUpdateAndWait( + deviceName, + chapUserName, + resourceGroupName, + managerName, + chapSetting + ); + console.log(result); +} + +chapSettingsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsDelete.ts new file mode 100644 index 000000000000..cbcf0acf5674 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsDelete.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the chap setting. + * + * @summary Deletes the chap setting. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function chapSettingsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const chapUserName = "ChapSettingForSDKForDelete"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.chapSettingsOperations.beginDeleteAndWait( + deviceName, + chapUserName, + resourceGroupName, + managerName + ); + console.log(result); +} + +chapSettingsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsGet.ts new file mode 100644 index 000000000000..a076ceaba575 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsGet.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified chap setting name. + * + * @summary Returns the properties of the specified chap setting name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function chapSettingsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const chapUserName = "ChapSettingForSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.chapSettingsOperations.get( + deviceName, + chapUserName, + resourceGroupName, + managerName + ); + console.log(result); +} + +chapSettingsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsListByDevice.ts new file mode 100644 index 000000000000..247f028b57d5 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/chapSettingsListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the chap settings in a device. + * + * @summary Retrieves all the chap settings in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function chapSettingsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.chapSettingsOperations.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +chapSettingsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesCreateOrUpdateAlertSettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesCreateOrUpdateAlertSettings.ts new file mode 100644 index 000000000000..324a571a3d4a --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesCreateOrUpdateAlertSettings.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the alert settings + * + * @summary Creates or updates the alert settings + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesCreateOrUpdateAlertSettings.json + */ +import { + AlertSettings, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesCreateOrUpdateAlertSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const alertSettings: AlertSettings = { + name: "default", + additionalRecipientEmailList: ["testuser@abc.com"], + alertNotificationCulture: "en-US", + emailNotification: "Enabled", + notificationToServiceOwners: "Disabled" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginCreateOrUpdateAlertSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + alertSettings + ); + console.log(result); +} + +devicesCreateOrUpdateAlertSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesCreateOrUpdateSecuritySettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesCreateOrUpdateSecuritySettings.ts new file mode 100644 index 000000000000..1d7e9c54c0a3 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesCreateOrUpdateSecuritySettings.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the security settings. + * + * @summary Creates or updates the security settings. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesCreateOrUpdateSecuritySettings.json + */ +import { + SecuritySettings, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesCreateOrUpdateSecuritySettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const securitySettings: SecuritySettings = { + deviceAdminPassword: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertificateThumbprint: + "D73DB57C4CDD6761E159F8D1E8A7D759424983FD", + value: "" + } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginCreateOrUpdateSecuritySettingsAndWait( + deviceName, + resourceGroupName, + managerName, + securitySettings + ); + console.log(result); +} + +devicesCreateOrUpdateSecuritySettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDeactivate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDeactivate.ts new file mode 100644 index 000000000000..16882c80637e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDeactivate.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deactivates the device. + * + * @summary Deactivates the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDeactivate.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesDeactivate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "SDK-DELETE"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForDeleteOperation"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginDeactivateAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDeactivate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDelete.ts new file mode 100644 index 000000000000..9b2ac4493d9e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDelete.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the device. + * + * @summary Deletes the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "SDK-DELETE"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForDeleteOperation"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginDeleteAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDownloadUpdates.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDownloadUpdates.ts new file mode 100644 index 000000000000..42d78323bcca --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesDownloadUpdates.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Downloads updates on the device. + * + * @summary Downloads updates on the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDownloadUpdates.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesDownloadUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginDownloadUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDownloadUpdates().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesFailover.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesFailover.ts new file mode 100644 index 000000000000..a02503ea4aa1 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesFailover.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Fails over the device to another device. + * + * @summary Fails over the device to another device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesFailover.json + */ +import { + FailoverRequest, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesFailover() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const failoverRequest: FailoverRequest = { + accesspointIds: [ + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-0NZI14MDTF/iscsiServers/HSDK-0NZI14MDTF" + ], + keepSourceDevice: true, + skipValidation: true, + targetDeviceId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-UGU4PITWNI" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginFailoverAndWait( + deviceName, + resourceGroupName, + managerName, + failoverRequest + ); + console.log(result); +} + +devicesFailover().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGet.ts new file mode 100644 index 000000000000..457048676f6c --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGet.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified device name. + * + * @summary Returns the properties of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.get( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetAlertSettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetAlertSettings.ts new file mode 100644 index 000000000000..46bf6b76389d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetAlertSettings.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the alert settings of the specified device name. + * + * @summary Returns the alert settings of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetAlertSettings.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGetAlertSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getAlertSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGetAlertSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetNetworkSettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetNetworkSettings.ts new file mode 100644 index 000000000000..9970571428d9 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetNetworkSettings.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the network settings of the specified device name. + * + * @summary Returns the network settings of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetNetworkSettings.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGetNetworkSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getNetworkSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGetNetworkSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetTimeSettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetTimeSettings.ts new file mode 100644 index 000000000000..b44246a597f3 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetTimeSettings.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the time settings of the specified device name. + * + * @summary Returns the time settings of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetTimeSettings.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGetTimeSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getTimeSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGetTimeSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetUpdateSummary.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetUpdateSummary.ts new file mode 100644 index 000000000000..4cc8c167a996 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesGetUpdateSummary.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the update summary of the specified device name. + * + * @summary Returns the update summary of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetUpdateSummary.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGetUpdateSummary() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HBVT-02X525X2W0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getUpdateSummary( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGetUpdateSummary().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesInstallUpdates.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesInstallUpdates.ts new file mode 100644 index 000000000000..39b6049cd781 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesInstallUpdates.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Installs the updates on the device. + * + * @summary Installs the updates on the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesInstallUpdates.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesInstallUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginInstallUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesInstallUpdates().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListByManager.ts new file mode 100644 index 000000000000..8fb6d2951a8b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the devices in a manager. + * + * @summary Retrieves all the devices in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListFailoverTarget.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListFailoverTarget.ts new file mode 100644 index 000000000000..06befe7b6933 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListFailoverTarget.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the devices which can be used as failover targets for the given device. + * + * @summary Retrieves all the devices which can be used as failover targets for the given device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListFailoverTarget.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListFailoverTarget() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listFailoverTarget( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListFailoverTarget().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListMetricDefinition.ts new file mode 100644 index 000000000000..2519d724bd77 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListMetricDefinition.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definition of all metrics aggregated at device. + * + * @summary Retrieves metric definition of all metrics aggregated at device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listMetricDefinition( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListMetrics.ts new file mode 100644 index 000000000000..1fbcfe8f703f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesListMetrics.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves the device metrics. + * + * @summary Retrieves the device metrics. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listMetrics( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesPatch.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesPatch.ts new file mode 100644 index 000000000000..4d23d81e818d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesPatch.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Patches the device. + * + * @summary Patches the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesPatch.json + */ +import { + DevicePatch, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesPatch() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const devicePatch: DevicePatch = { + deviceDescription: "NewDescription8/14/2018 2:30:34 PM" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginPatchAndWait( + deviceName, + resourceGroupName, + managerName, + devicePatch + ); + console.log(result); +} + +devicesPatch().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesScanForUpdates.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesScanForUpdates.ts new file mode 100644 index 000000000000..0c71aba0683f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/devicesScanForUpdates.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Scans for updates on the device. + * + * @summary Scans for updates on the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesScanForUpdates.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesScanForUpdates() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HBVT-02X525X2W0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginScanForUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesScanForUpdates().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersBackupNow.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersBackupNow.ts new file mode 100644 index 000000000000..3abec42d3d72 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersBackupNow.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Backup the file server now. + * + * @summary Backup the file server now. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersBackupNow.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersBackupNow() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.beginBackupNowAndWait( + deviceName, + fileServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileServersBackupNow().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersCreateOrUpdate.ts new file mode 100644 index 000000000000..10a3ec745cac --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersCreateOrUpdate.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the file server. + * + * @summary Creates or updates the file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersCreateOrUpdate.json + */ +import { + FileServer, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const fileServer: FileServer = { + name: "HSDK-4XY4FI2IVG", + description: "Demo FileServer for SDK Test", + backupScheduleGroupId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/hsdk-4xy4fi2ivg/backupScheduleGroups/BackupSchGroupForSDKTest", + domainName: "fareast.corp.microsoft.com", + storageDomainId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/storageDomains/sd-fs-HSDK-4XY4FI2IVG" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.beginCreateOrUpdateAndWait( + deviceName, + fileServerName, + resourceGroupName, + managerName, + fileServer + ); + console.log(result); +} + +fileServersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersDelete.ts new file mode 100644 index 000000000000..6b3b4cc0cb57 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersDelete.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the file server. + * + * @summary Deletes the file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.beginDeleteAndWait( + deviceName, + fileServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileServersDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersGet.ts new file mode 100644 index 000000000000..1c74babe7814 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersGet.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified file server name. + * + * @summary Returns the properties of the specified file server name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.get( + deviceName, + fileServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileServersGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListByDevice.ts new file mode 100644 index 000000000000..2ee06d1febb3 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file servers in a device. + * + * @summary Retrieves all the file servers in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListByManager.ts new file mode 100644 index 000000000000..64c80b2b6542 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file servers in a manager. + * + * @summary Retrieves all the file servers in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListMetricDefinition.ts new file mode 100644 index 000000000000..1bdd6dc7c068 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListMetricDefinition.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions of all metrics aggregated at the file server. + * + * @summary Retrieves metric definitions of all metrics aggregated at the file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listMetricDefinition( + deviceName, + fileServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListMetrics.ts new file mode 100644 index 000000000000..84e461df1004 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileServersListMetrics.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the file server metrics. + * + * @summary Gets the file server metrics. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listMetrics( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesCreateOrUpdate.ts new file mode 100644 index 000000000000..26d37cccd20d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesCreateOrUpdate.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the file share. + * + * @summary Creates or updates the file share. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesCreateOrUpdate.json + */ +import { + FileShare, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const shareName = "Auto-TestFileShare1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const fileShare: FileShare = { + name: "Auto-TestFileShare1", + description: "Demo FileShare for SDK Test Tiered", + adminUser: "fareastidcdlslb", + dataPolicy: "Tiered", + monitoringStatus: "Enabled", + provisionedCapacityInBytes: 536870912000, + shareStatus: "Online" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileShares.beginCreateOrUpdateAndWait( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + fileShare + ); + console.log(result); +} + +fileSharesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesDelete.ts new file mode 100644 index 000000000000..14502b8c3b4e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesDelete.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the file share. + * + * @summary Deletes the file share. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const shareName = "Auto-TestFileShare2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileShares.beginDeleteAndWait( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileSharesDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesGet.ts new file mode 100644 index 000000000000..57967b479ad9 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesGet.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified file share name. + * + * @summary Returns the properties of the specified file share name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const shareName = "Auto-TestFileShare1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileShares.get( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileSharesGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListByDevice.ts new file mode 100644 index 000000000000..ff44d904f698 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file shares in a device. + * + * @summary Retrieves all the file shares in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListByFileServer.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListByFileServer.ts new file mode 100644 index 000000000000..4894f278f690 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListByFileServer.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file shares in a file server. + * + * @summary Retrieves all the file shares in a file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListByFileServer.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesListByFileServer() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const fileServerName = "HSDK-ARCSX4MVKZ"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listByFileServer( + deviceName, + fileServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListByFileServer().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListMetricDefinition.ts new file mode 100644 index 000000000000..f4baef7da534 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListMetricDefinition.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions of all metrics aggregated at the file share. + * + * @summary Retrieves metric definitions of all metrics aggregated at the file share. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const shareName = "Auto-TestFileShare2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listMetricDefinition( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListMetrics.ts new file mode 100644 index 000000000000..40fc7b9567eb --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/fileSharesListMetrics.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the file share metrics + * + * @summary Gets the file share metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const shareName = "Auto-TestFileShare2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listMetrics( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksCreateOrUpdate.ts new file mode 100644 index 000000000000..cec2a3923f63 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksCreateOrUpdate.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the iSCSI disk. + * + * @summary Creates or updates the iSCSI disk. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksCreateOrUpdate.json + */ +import { + IscsiDisk, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const diskName = "Auto-TestIscsiDisk1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const iscsiDisk: IscsiDisk = { + name: "Auto-TestIscsiDisk1", + description: "Demo IscsiDisk for SDK Test Tiered", + accessControlRecords: [], + dataPolicy: "Tiered", + diskStatus: "Online", + monitoringStatus: "Enabled", + provisionedCapacityInBytes: 536870912000 + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiDisks.beginCreateOrUpdateAndWait( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + iscsiDisk + ); + console.log(result); +} + +iscsiDisksCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksDelete.ts new file mode 100644 index 000000000000..d3826bc2d0bc --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksDelete.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the iSCSI disk. + * + * @summary Deletes the iSCSI disk. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const diskName = "ClonedTieredIscsiDiskForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiDisks.beginDeleteAndWait( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiDisksDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksGet.ts new file mode 100644 index 000000000000..11a539c5f87d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksGet.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified iSCSI disk name. + * + * @summary Returns the properties of the specified iSCSI disk name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const diskName = "Auto-TestIscsiDisk1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiDisks.get( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiDisksGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListByDevice.ts new file mode 100644 index 000000000000..3cf181b35888 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the iSCSI disks in a device. + * + * @summary Retrieves all the iSCSI disks in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListByIscsiServer.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListByIscsiServer.ts new file mode 100644 index 000000000000..ad1042a0b739 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListByIscsiServer.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the disks in a iSCSI server. + * + * @summary Retrieves all the disks in a iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListByIscsiServer.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksListByIscsiServer() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listByIscsiServer( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListByIscsiServer().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListMetricDefinition.ts new file mode 100644 index 000000000000..d2db4add42e7 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListMetricDefinition.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions for all metric aggregated at the iSCSI disk. + * + * @summary Retrieves metric definitions for all metric aggregated at the iSCSI disk. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const diskName = "TieredIscsiDiskForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listMetricDefinition( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListMetrics.ts new file mode 100644 index 000000000000..839d31fa3e8e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiDisksListMetrics.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the iSCSI disk metrics + * + * @summary Gets the iSCSI disk metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const diskName = "TieredIscsiDiskForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listMetrics( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersBackupNow.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersBackupNow.ts new file mode 100644 index 000000000000..e2ce4f313618 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersBackupNow.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Backup the iSCSI server now. + * + * @summary Backup the iSCSI server now. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersBackupNow.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersBackupNow() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.beginBackupNowAndWait( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiServersBackupNow().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersCreateOrUpdate.ts new file mode 100644 index 000000000000..eb4b5b047811 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersCreateOrUpdate.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the iSCSI server. + * + * @summary Creates or updates the iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersCreateOrUpdate.json + */ +import { + IscsiServer, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const iscsiServer: IscsiServer = { + name: "HSDK-WSJQERQW3F", + type: "Microsoft.StorSimple/managers/devices/iscsiServers", + backupScheduleGroupId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-WSJQERQW3F/backupScheduleGroups/Default-HSDK-WSJQERQW3F-BackupScheduleGroup", + chapId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-WSJQERQW3F/chapSettings/ChapSettingForSDK", + id: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-WSJQERQW3F/iscsiServers/HSDK-WSJQERQW3F", + reverseChapId: "", + storageDomainId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/storageDomains/Default-HSDK-WSJQERQW3F-StorageDomain" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.beginCreateOrUpdateAndWait( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + iscsiServer + ); + console.log(result); +} + +iscsiServersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersDelete.ts new file mode 100644 index 000000000000..9da36dc4cb58 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersDelete.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the iSCSI server. + * + * @summary Deletes the iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.beginDeleteAndWait( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiServersDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersGet.ts new file mode 100644 index 000000000000..6b2c54f0a100 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersGet.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified iSCSI server name. + * + * @summary Returns the properties of the specified iSCSI server name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.get( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiServersGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListByDevice.ts new file mode 100644 index 000000000000..196bfc7fc4c8 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the iSCSI in a device. + * + * @summary Retrieves all the iSCSI in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListByManager.ts new file mode 100644 index 000000000000..6f4f9044619f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the iSCSI servers in a manager. + * + * @summary Retrieves all the iSCSI servers in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListMetricDefinition.ts new file mode 100644 index 000000000000..6e08d7004d6d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListMetricDefinition.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions for all metrics aggregated at iSCSI server. + * + * @summary Retrieves metric definitions for all metrics aggregated at iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listMetricDefinition( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListMetrics.ts new file mode 100644 index 000000000000..6ae9e71fc05d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/iscsiServersListMetrics.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the iSCSI server metrics + * + * @summary Gets the iSCSI server metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listMetrics( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsGet.ts new file mode 100644 index 000000000000..b1d83983112d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsGet.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified job name. + * + * @summary Returns the properties of the specified job name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const jobName = "06c7ee19-35a2-4248-bf1b-408009b31b63"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.jobs.get( + deviceName, + jobName, + resourceGroupName, + managerName + ); + console.log(result); +} + +jobsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsListByDevice.ts new file mode 100644 index 000000000000..94fa931a6215 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the jobs in a device. + * + * @summary Retrieves all the jobs in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "jobType eq 'Backup'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.jobs.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsListByManager.ts new file mode 100644 index 000000000000..e2d8c7b21b5a --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/jobsListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the jobs in a manager. + * + * @summary Retrieves all the jobs in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "jobType eq 'Backup'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.jobs.listByManager( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersCreateExtendedInfo.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersCreateExtendedInfo.ts new file mode 100644 index 000000000000..8f82f6702d3f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersCreateExtendedInfo.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates the extended info of the manager. + * + * @summary Creates the extended info of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersCreateExtendedInfo.json + */ +import { + ManagerExtendedInfo, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersCreateExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const managerExtendedInfo: ManagerExtendedInfo = { + name: "vaultExtendedInfo", + type: "Microsoft.StorSimple/Managers/extendedInformation", + algorithm: "SHA256", + etag: "6531d5d7-3ced-4f78-83b6-804368f2ca0c", + id: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/Managers/hManagerForSDKTestextendedInformation/vaultExtendedInfo", + integrityKey: "e6501980-7efe-4602-bb0e-3cb9a08a6003" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.createExtendedInfo( + resourceGroupName, + managerName, + managerExtendedInfo + ); + console.log(result); +} + +managersCreateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersCreateOrUpdate.ts new file mode 100644 index 000000000000..9b9caee7503e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersCreateOrUpdate.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the manager. + * + * @summary Creates or updates the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersCreateOrUpdate.json + */ +import { + Manager, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const manager: Manager = { + name: "hManagerForSDKTest", + cisIntrinsicSettings: { type: "HelsinkiV1" }, + location: "westus", + sku: { name: "Standard" } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.createOrUpdate( + resourceGroupName, + managerName, + manager + ); + console.log(result); +} + +managersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersDelete.ts new file mode 100644 index 000000000000..6b35c38939b1 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersDelete.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the manager. + * + * @summary Deletes the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.delete(resourceGroupName, managerName); + console.log(result); +} + +managersDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersDeleteExtendedInfo.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersDeleteExtendedInfo.ts new file mode 100644 index 000000000000..85f7aac67f14 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersDeleteExtendedInfo.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the extended info of the manager. + * + * @summary Deletes the extended info of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersDeleteExtendedInfo.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersDeleteExtendedInfo() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.deleteExtendedInfo( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersDeleteExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGet.ts new file mode 100644 index 000000000000..52f1776baaa9 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGet.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified manager name. + * + * @summary Returns the properties of the specified manager name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.get(resourceGroupName, managerName); + console.log(result); +} + +managersGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetEncryptionKey.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetEncryptionKey.ts new file mode 100644 index 000000000000..58d26380f5b8 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetEncryptionKey.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the symmetric encryption key of the manager. + * + * @summary Returns the symmetric encryption key of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetEncryptionKey.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetEncryptionKey() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.getEncryptionKey( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetEncryptionKey().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetEncryptionSettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetEncryptionSettings.ts new file mode 100644 index 000000000000..1cdf630be1e4 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetEncryptionSettings.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the encryption settings of the manager. + * + * @summary Returns the encryption settings of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetEncryptionSettings.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetEncryptionSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.getEncryptionSettings( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetEncryptionSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetExtendedInfo.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetExtendedInfo.ts new file mode 100644 index 000000000000..04b7457efb93 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersGetExtendedInfo.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the extended information of the specified manager name. + * + * @summary Returns the extended information of the specified manager name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetExtendedInfo.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetExtendedInfo() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.getExtendedInfo( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersList.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersList.ts new file mode 100644 index 000000000000..5f76b075763d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersList.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a subscription. + * + * @summary Retrieves all the managers in a subscription. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersList.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersList() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +managersList().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListByResourceGroup.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListByResourceGroup.ts new file mode 100644 index 000000000000..7ab5e31759ba --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListByResourceGroup.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a resource group. + * + * @summary Retrieves all the managers in a resource group. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListByResourceGroup.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListByResourceGroup() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListByResourceGroup().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListMetricDefinition.ts new file mode 100644 index 000000000000..0501a6aa56f2 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListMetricDefinition.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definition of all metrics aggregated at manager. + * + * @summary Retrieves metric definition of all metrics aggregated at manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listMetricDefinition( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListMetrics.ts new file mode 100644 index 000000000000..898231c71614 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersListMetrics.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the manager metrics + * + * @summary Gets the manager metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-04T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listMetrics( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUpdate.ts new file mode 100644 index 000000000000..54c2fb9814b0 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUpdate.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the StorSimple Manager. + * + * @summary Updates the StorSimple Manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUpdate.json + */ +import { + ManagerPatch, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters: ManagerPatch = { tags: { tagName: "ForSDKTest" } }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.update( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +managersUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUpdateExtendedInfo.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUpdateExtendedInfo.ts new file mode 100644 index 000000000000..81aaa9cf071f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUpdateExtendedInfo.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the extended info of the manager. + * + * @summary Updates the extended info of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUpdateExtendedInfo.json + */ +import { + ManagerExtendedInfo, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersUpdateExtendedInfo() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const ifMatch = "6531d5d7-3ced-4f78-83b6-804368f2ca0c"; + const managerExtendedInfo: ManagerExtendedInfo = { + name: "vaultExtendedInfo", + type: "Microsoft.StorSimple/Managers/extendedInformation", + algorithm: "SHA256", + etag: "6531d5d7-3ced-4f78-83b6-804368f2ca0c", + id: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/Managers/hManagerForSDKTestextendedInformation/vaultExtendedInfo", + integrityKey: "e6501980-7efe-4602-bb0e-3cb9a08a6003" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.updateExtendedInfo( + resourceGroupName, + managerName, + ifMatch, + managerExtendedInfo + ); + console.log(result); +} + +managersUpdateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUploadRegistrationCertificate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUploadRegistrationCertificate.ts new file mode 100644 index 000000000000..f8934d768ef1 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/managersUploadRegistrationCertificate.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Upload Vault Cred Certificate. +Returns UploadCertificateResponse + * + * @summary Upload Vault Cred Certificate. +Returns UploadCertificateResponse + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUploadRegistrationCertificate.json + */ +import { + UploadCertificateRequest, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersUploadRegistrationCertificate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const certificateName = "windows"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const uploadCertificateRequestrequest: UploadCertificateRequest = { + authType: "AzureActiveDirectory", + certificate: + "MIIC3TCCAcWgAwIBAgIQEr0bAWD6wJtA4LIbZ9NtgzANBgkqhkiG9w0BAQUFADAeMRwwGgYDVQQDExNXaW5kb3dzIEF6dXJlIFRvb2xzMB4XDTE4MDkxMDE1MzY0MFoXDTE4MDkxMzE1NDY0MFowHjEcMBoGA1UEAxMTV2luZG93cyBBenVyZSBUb29sczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANUsKkz2Z4fECKMyNeLb9v3pr1XF4dVe+MITDtgphjl81ng190Y0IHgCVnh4YjfplUSpMk/1xii0rI5AAPwoz3ze2qRPtnwCiTaoVLkUe6knNRPzrRvVXHB81J0/14MO0lwdByHhdccRcVJZPLt5724t4aQny82v2AayJdDDkBBWNlpcqPy6n3sygP00THMPP0O3sFqy924eHqoDj3qSw79/meaZBJt9S5odPuFoskxjHuI4lM6BmK1Ql7p8Wo9/GhTOIoMz81orKPHRDleLjutwL4mb6NnhI5rfT/MxnHD6m82c4YYqiZC3XiTyJWVCkWkp7PK92OdRp6FA87rdKDMCAwEAAaMXMBUwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADggEBAIYlezVU68TuEblkn06vM5dfzSmHKJOQgW61nDlLnyKrmSJtzKZLCAswTE2VyJHwKNdZgW15coJFINjWBLWcLr0/GjNV4u3Z+UL3NhBFQd5xuMtKsIhuoscKtyk0JHQXpBvHNmOUCobfQfOBQfTVC7kmyWdtlGztFUVxD28s6S5gMb1FEWWN68NOOJ3/ZhaTbUEM54yw8Hk8/f0L/Zn/7BYHUyWWA3KStAaYn89C/ZFF+952ark2VaKGIjBRQzgrJEIR8dI4r46I3DoEfzGPESKvQPvVLhOX84RG0PLPOtnRbHBVew1Nh3HE9kgCubkPKK+NPWE9IHZPoRmOTWBe+zU=", + contractVersion: "V2012_12" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.uploadRegistrationCertificate( + certificateName, + resourceGroupName, + managerName, + uploadCertificateRequestrequest + ); + console.log(result); +} + +managersUploadRegistrationCertificate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/operationsList.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/operationsList.ts new file mode 100644 index 000000000000..4420c4bc4afa --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/operationsList.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to List of AvailableProviderOperations + * + * @summary List of AvailableProviderOperations + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/OperationsList.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availableProviderOperationsOperations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsCreateOrUpdate.ts new file mode 100644 index 000000000000..9c250aceb1b4 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsCreateOrUpdate.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the storage account credential + * + * @summary Creates or updates the storage account credential + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsCreateOrUpdate.json + */ +import { + StorageAccountCredential, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credentialName = "DummySacForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const storageAccount: StorageAccountCredential = { + name: "DummySacForSDKTest", + accessKey: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertificateThumbprint: + "D73DB57C4CDD6761E159F8D1E8A7D759424983FD", + value: + "Ev1tm0QBmpGGm4a58GkqLqx8veJEEgQtg5K3Jizpmy7JdSv9dlcRwk59THw6KIdMDlEHcS8mPyneBtOEQsh4wkcFB7qrmQz+KsRAyIhEm6bwPEm3qN8+aDDzNcXn/6vu/sqV0AP7zit9/s7SxXGxjKrz4zKnOy16/DbzRRmUHNO+HO6JUM0cUfHXTX0mEecbsXqBq0A8IEG8z+bJgXX1EhoGkzE6yVsObm4S1AcKrLiwWjqmSLji5Q8gGO+y4KTTmC3p45h5GHHXjJyOccHhySWDAffxnTzUD/sOoh+aD2VkAYrL3DdnkVzhAdfcZfVI4soONx7tYMloZIVsfW1M2Q==" + }, + cloudType: "Azure", + enableSSL: "Enabled", + endPoint: "blob.core.windows.net", + location: "West US", + login: "SacForSDKTest" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.beginCreateOrUpdateAndWait( + credentialName, + resourceGroupName, + managerName, + storageAccount + ); + console.log(result); +} + +storageAccountCredentialsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsDelete.ts new file mode 100644 index 000000000000..166fe83f1d12 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsDelete.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the storage account credential + * + * @summary Deletes the storage account credential + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credentialName = "DummySacForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.beginDeleteAndWait( + credentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsGet.ts new file mode 100644 index 000000000000..769e5b493e3f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsGet.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified storage account credential name. + * + * @summary Returns the properties of the specified storage account credential name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credentialName = "SacForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.get( + credentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsListByManager.ts new file mode 100644 index 000000000000..ffa808d0f60e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the storage account credentials in a manager. + * + * @summary Retrieves all the storage account credentials in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageAccountCredentials.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +storageAccountCredentialsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsCreateOrUpdate.ts new file mode 100644 index 000000000000..d293a57d4799 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsCreateOrUpdate.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the storage domain. + * + * @summary Creates or updates the storage domain. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsCreateOrUpdate.json + */ +import { + StorageDomain, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageDomainsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const storageDomainName = "sd-fs-HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const storageDomain: StorageDomain = { + name: "sd-fs-HSDK-4XY4FI2IVG", + encryptionStatus: "Disabled", + storageAccountCredentialIds: [ + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/storageAccountCredentials/sacforsdktest" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageDomains.beginCreateOrUpdateAndWait( + storageDomainName, + resourceGroupName, + managerName, + storageDomain + ); + console.log(result); +} + +storageDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsDelete.ts new file mode 100644 index 000000000000..da353a2c16c7 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsDelete.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the storage domain. + * + * @summary Deletes the storage domain. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageDomainsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const storageDomainName = "sd-fs-HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageDomains.beginDeleteAndWait( + storageDomainName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageDomainsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsGet.ts new file mode 100644 index 000000000000..fc1821aedf56 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsGet.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified storage domain name. + * + * @summary Returns the properties of the specified storage domain name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageDomainsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const storageDomainName = "sd-fs-HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageDomains.get( + storageDomainName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageDomainsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsListByManager.ts new file mode 100644 index 000000000000..a08aaa5a83da --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageDomainsListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the storage domains in a manager. + * + * @summary Retrieves all the storage domains in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageDomainsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageDomains.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +storageDomainsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/README.md b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/README.md new file mode 100644 index 000000000000..a7b3bbd16a76 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/README.md @@ -0,0 +1,236 @@ +# client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accessControlRecordsCreateOrUpdate.js][accesscontrolrecordscreateorupdate] | Creates or Updates an access control record. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsCreateOrUpdate.json | +| [accessControlRecordsDelete.js][accesscontrolrecordsdelete] | Deletes the access control record. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsDelete.json | +| [accessControlRecordsGet.js][accesscontrolrecordsget] | Returns the properties of the specified access control record name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsGet.json | +| [accessControlRecordsListByManager.js][accesscontrolrecordslistbymanager] | Retrieves all the access control records in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsListByManager.json | +| [alertsClear.js][alertsclear] | Clear the alerts. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsClear.json | +| [alertsListByManager.js][alertslistbymanager] | Retrieves all the alerts in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsListByManager.json | +| [alertsSendTestEmail.js][alertssendtestemail] | Sends a test alert email. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsSendTestEmail.json | +| [backupScheduleGroupsCreateOrUpdate.js][backupschedulegroupscreateorupdate] | Creates or Updates the backup schedule Group. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsCreateOrUpdate.json | +| [backupScheduleGroupsDelete.js][backupschedulegroupsdelete] | Deletes the backup schedule group. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsDelete.json | +| [backupScheduleGroupsGet.js][backupschedulegroupsget] | Returns the properties of the specified backup schedule group name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsGet.json | +| [backupScheduleGroupsListByDevice.js][backupschedulegroupslistbydevice] | Retrieves all the backup schedule groups in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsListByDevice.json | +| [backupsClone.js][backupsclone] | Clones the given backup element to a new disk or share with given details. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsClone.json | +| [backupsDelete.js][backupsdelete] | Deletes the backup. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsDelete.json | +| [backupsListByDevice.js][backupslistbydevice] | Retrieves all the backups in a device. Can be used to get the backups for failover also. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsListByDevice.json | +| [backupsListByManager.js][backupslistbymanager] | Retrieves all the backups in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsListByManager.json | +| [chapSettingsCreateOrUpdate.js][chapsettingscreateorupdate] | Creates or updates the chap setting. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsCreateOrUpdate.json | +| [chapSettingsDelete.js][chapsettingsdelete] | Deletes the chap setting. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsDelete.json | +| [chapSettingsGet.js][chapsettingsget] | Returns the properties of the specified chap setting name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsGet.json | +| [chapSettingsListByDevice.js][chapsettingslistbydevice] | Retrieves all the chap settings in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsListByDevice.json | +| [devicesCreateOrUpdateAlertSettings.js][devicescreateorupdatealertsettings] | Creates or updates the alert settings x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesCreateOrUpdateAlertSettings.json | +| [devicesCreateOrUpdateSecuritySettings.js][devicescreateorupdatesecuritysettings] | Creates or updates the security settings. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesCreateOrUpdateSecuritySettings.json | +| [devicesDeactivate.js][devicesdeactivate] | Deactivates the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDeactivate.json | +| [devicesDelete.js][devicesdelete] | Deletes the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDelete.json | +| [devicesDownloadUpdates.js][devicesdownloadupdates] | Downloads updates on the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDownloadUpdates.json | +| [devicesFailover.js][devicesfailover] | Fails over the device to another device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesFailover.json | +| [devicesGet.js][devicesget] | Returns the properties of the specified device name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGet.json | +| [devicesGetAlertSettings.js][devicesgetalertsettings] | Returns the alert settings of the specified device name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetAlertSettings.json | +| [devicesGetNetworkSettings.js][devicesgetnetworksettings] | Returns the network settings of the specified device name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetNetworkSettings.json | +| [devicesGetTimeSettings.js][devicesgettimesettings] | Returns the time settings of the specified device name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetTimeSettings.json | +| [devicesGetUpdateSummary.js][devicesgetupdatesummary] | Returns the update summary of the specified device name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetUpdateSummary.json | +| [devicesInstallUpdates.js][devicesinstallupdates] | Installs the updates on the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesInstallUpdates.json | +| [devicesListByManager.js][deviceslistbymanager] | Retrieves all the devices in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListByManager.json | +| [devicesListFailoverTarget.js][deviceslistfailovertarget] | Retrieves all the devices which can be used as failover targets for the given device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListFailoverTarget.json | +| [devicesListMetricDefinition.js][deviceslistmetricdefinition] | Retrieves metric definition of all metrics aggregated at device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListMetricDefinition.json | +| [devicesListMetrics.js][deviceslistmetrics] | Retrieves the device metrics. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListMetrics.json | +| [devicesPatch.js][devicespatch] | Patches the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesPatch.json | +| [devicesScanForUpdates.js][devicesscanforupdates] | Scans for updates on the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesScanForUpdates.json | +| [fileServersBackupNow.js][fileserversbackupnow] | Backup the file server now. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersBackupNow.json | +| [fileServersCreateOrUpdate.js][fileserverscreateorupdate] | Creates or updates the file server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersCreateOrUpdate.json | +| [fileServersDelete.js][fileserversdelete] | Deletes the file server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersDelete.json | +| [fileServersGet.js][fileserversget] | Returns the properties of the specified file server name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersGet.json | +| [fileServersListByDevice.js][fileserverslistbydevice] | Retrieves all the file servers in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListByDevice.json | +| [fileServersListByManager.js][fileserverslistbymanager] | Retrieves all the file servers in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListByManager.json | +| [fileServersListMetricDefinition.js][fileserverslistmetricdefinition] | Retrieves metric definitions of all metrics aggregated at the file server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListMetricDefinition.json | +| [fileServersListMetrics.js][fileserverslistmetrics] | Gets the file server metrics. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListMetrics.json | +| [fileSharesCreateOrUpdate.js][filesharescreateorupdate] | Creates or updates the file share. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesCreateOrUpdate.json | +| [fileSharesDelete.js][filesharesdelete] | Deletes the file share. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesDelete.json | +| [fileSharesGet.js][filesharesget] | Returns the properties of the specified file share name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesGet.json | +| [fileSharesListByDevice.js][fileshareslistbydevice] | Retrieves all the file shares in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListByDevice.json | +| [fileSharesListByFileServer.js][fileshareslistbyfileserver] | Retrieves all the file shares in a file server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListByFileServer.json | +| [fileSharesListMetricDefinition.js][fileshareslistmetricdefinition] | Retrieves metric definitions of all metrics aggregated at the file share. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListMetricDefinition.json | +| [fileSharesListMetrics.js][fileshareslistmetrics] | Gets the file share metrics x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListMetrics.json | +| [iscsiDisksCreateOrUpdate.js][iscsidiskscreateorupdate] | Creates or updates the iSCSI disk. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksCreateOrUpdate.json | +| [iscsiDisksDelete.js][iscsidisksdelete] | Deletes the iSCSI disk. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksDelete.json | +| [iscsiDisksGet.js][iscsidisksget] | Returns the properties of the specified iSCSI disk name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksGet.json | +| [iscsiDisksListByDevice.js][iscsidiskslistbydevice] | Retrieves all the iSCSI disks in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListByDevice.json | +| [iscsiDisksListByIscsiServer.js][iscsidiskslistbyiscsiserver] | Retrieves all the disks in a iSCSI server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListByIscsiServer.json | +| [iscsiDisksListMetricDefinition.js][iscsidiskslistmetricdefinition] | Retrieves metric definitions for all metric aggregated at the iSCSI disk. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListMetricDefinition.json | +| [iscsiDisksListMetrics.js][iscsidiskslistmetrics] | Gets the iSCSI disk metrics x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListMetrics.json | +| [iscsiServersBackupNow.js][iscsiserversbackupnow] | Backup the iSCSI server now. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersBackupNow.json | +| [iscsiServersCreateOrUpdate.js][iscsiserverscreateorupdate] | Creates or updates the iSCSI server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersCreateOrUpdate.json | +| [iscsiServersDelete.js][iscsiserversdelete] | Deletes the iSCSI server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersDelete.json | +| [iscsiServersGet.js][iscsiserversget] | Returns the properties of the specified iSCSI server name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersGet.json | +| [iscsiServersListByDevice.js][iscsiserverslistbydevice] | Retrieves all the iSCSI in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListByDevice.json | +| [iscsiServersListByManager.js][iscsiserverslistbymanager] | Retrieves all the iSCSI servers in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListByManager.json | +| [iscsiServersListMetricDefinition.js][iscsiserverslistmetricdefinition] | Retrieves metric definitions for all metrics aggregated at iSCSI server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListMetricDefinition.json | +| [iscsiServersListMetrics.js][iscsiserverslistmetrics] | Gets the iSCSI server metrics x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListMetrics.json | +| [jobsGet.js][jobsget] | Returns the properties of the specified job name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsGet.json | +| [jobsListByDevice.js][jobslistbydevice] | Retrieves all the jobs in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsListByDevice.json | +| [jobsListByManager.js][jobslistbymanager] | Retrieves all the jobs in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsListByManager.json | +| [managersCreateExtendedInfo.js][managerscreateextendedinfo] | Creates the extended info of the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersCreateExtendedInfo.json | +| [managersCreateOrUpdate.js][managerscreateorupdate] | Creates or updates the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersCreateOrUpdate.json | +| [managersDelete.js][managersdelete] | Deletes the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersDelete.json | +| [managersDeleteExtendedInfo.js][managersdeleteextendedinfo] | Deletes the extended info of the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersDeleteExtendedInfo.json | +| [managersGet.js][managersget] | Returns the properties of the specified manager name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGet.json | +| [managersGetEncryptionKey.js][managersgetencryptionkey] | Returns the symmetric encryption key of the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetEncryptionKey.json | +| [managersGetEncryptionSettings.js][managersgetencryptionsettings] | Returns the encryption settings of the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetEncryptionSettings.json | +| [managersGetExtendedInfo.js][managersgetextendedinfo] | Returns the extended information of the specified manager name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetExtendedInfo.json | +| [managersList.js][managerslist] | Retrieves all the managers in a subscription. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersList.json | +| [managersListByResourceGroup.js][managerslistbyresourcegroup] | Retrieves all the managers in a resource group. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListByResourceGroup.json | +| [managersListMetricDefinition.js][managerslistmetricdefinition] | Retrieves metric definition of all metrics aggregated at manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListMetricDefinition.json | +| [managersListMetrics.js][managerslistmetrics] | Gets the manager metrics x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListMetrics.json | +| [managersUpdate.js][managersupdate] | Updates the StorSimple Manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUpdate.json | +| [managersUpdateExtendedInfo.js][managersupdateextendedinfo] | Updates the extended info of the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUpdateExtendedInfo.json | +| [managersUploadRegistrationCertificate.js][managersuploadregistrationcertificate] | Upload Vault Cred Certificate. Returns UploadCertificateResponse x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUploadRegistrationCertificate.json | +| [operationsList.js][operationslist] | List of AvailableProviderOperations x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/OperationsList.json | +| [storageAccountCredentialsCreateOrUpdate.js][storageaccountcredentialscreateorupdate] | Creates or updates the storage account credential x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsCreateOrUpdate.json | +| [storageAccountCredentialsDelete.js][storageaccountcredentialsdelete] | Deletes the storage account credential x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsDelete.json | +| [storageAccountCredentialsGet.js][storageaccountcredentialsget] | Returns the properties of the specified storage account credential name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsGet.json | +| [storageAccountCredentialsListByManager.js][storageaccountcredentialslistbymanager] | Retrieves all the storage account credentials in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsListByManager.json | +| [storageDomainsCreateOrUpdate.js][storagedomainscreateorupdate] | Creates or updates the storage domain. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsCreateOrUpdate.json | +| [storageDomainsDelete.js][storagedomainsdelete] | Deletes the storage domain. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsDelete.json | +| [storageDomainsGet.js][storagedomainsget] | Returns the properties of the specified storage domain name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsGet.json | +| [storageDomainsListByManager.js][storagedomainslistbymanager] | Retrieves all the storage domains in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsListByManager.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node accessControlRecordsCreateOrUpdate.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node accessControlRecordsCreateOrUpdate.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accesscontrolrecordscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsCreateOrUpdate.js +[accesscontrolrecordsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsDelete.js +[accesscontrolrecordsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsGet.js +[accesscontrolrecordslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsListByManager.js +[alertsclear]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsClear.js +[alertslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsListByManager.js +[alertssendtestemail]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsSendTestEmail.js +[backupschedulegroupscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsCreateOrUpdate.js +[backupschedulegroupsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsDelete.js +[backupschedulegroupsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsGet.js +[backupschedulegroupslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsListByDevice.js +[backupsclone]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsClone.js +[backupsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsDelete.js +[backupslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsListByDevice.js +[backupslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsListByManager.js +[chapsettingscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsCreateOrUpdate.js +[chapsettingsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsDelete.js +[chapsettingsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsGet.js +[chapsettingslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsListByDevice.js +[devicescreateorupdatealertsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesCreateOrUpdateAlertSettings.js +[devicescreateorupdatesecuritysettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesCreateOrUpdateSecuritySettings.js +[devicesdeactivate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDeactivate.js +[devicesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDelete.js +[devicesdownloadupdates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDownloadUpdates.js +[devicesfailover]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesFailover.js +[devicesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGet.js +[devicesgetalertsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetAlertSettings.js +[devicesgetnetworksettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetNetworkSettings.js +[devicesgettimesettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetTimeSettings.js +[devicesgetupdatesummary]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetUpdateSummary.js +[devicesinstallupdates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesInstallUpdates.js +[deviceslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListByManager.js +[deviceslistfailovertarget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListFailoverTarget.js +[deviceslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListMetricDefinition.js +[deviceslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListMetrics.js +[devicespatch]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesPatch.js +[devicesscanforupdates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesScanForUpdates.js +[fileserversbackupnow]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersBackupNow.js +[fileserverscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersCreateOrUpdate.js +[fileserversdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersDelete.js +[fileserversget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersGet.js +[fileserverslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListByDevice.js +[fileserverslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListByManager.js +[fileserverslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListMetricDefinition.js +[fileserverslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListMetrics.js +[filesharescreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesCreateOrUpdate.js +[filesharesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesDelete.js +[filesharesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesGet.js +[fileshareslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListByDevice.js +[fileshareslistbyfileserver]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListByFileServer.js +[fileshareslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListMetricDefinition.js +[fileshareslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListMetrics.js +[iscsidiskscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksCreateOrUpdate.js +[iscsidisksdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksDelete.js +[iscsidisksget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksGet.js +[iscsidiskslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListByDevice.js +[iscsidiskslistbyiscsiserver]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListByIscsiServer.js +[iscsidiskslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListMetricDefinition.js +[iscsidiskslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListMetrics.js +[iscsiserversbackupnow]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersBackupNow.js +[iscsiserverscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersCreateOrUpdate.js +[iscsiserversdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersDelete.js +[iscsiserversget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersGet.js +[iscsiserverslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListByDevice.js +[iscsiserverslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListByManager.js +[iscsiserverslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListMetricDefinition.js +[iscsiserverslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListMetrics.js +[jobsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsGet.js +[jobslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsListByDevice.js +[jobslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsListByManager.js +[managerscreateextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersCreateExtendedInfo.js +[managerscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersCreateOrUpdate.js +[managersdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersDelete.js +[managersdeleteextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersDeleteExtendedInfo.js +[managersget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGet.js +[managersgetencryptionkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetEncryptionKey.js +[managersgetencryptionsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetEncryptionSettings.js +[managersgetextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetExtendedInfo.js +[managerslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersList.js +[managerslistbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListByResourceGroup.js +[managerslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListMetricDefinition.js +[managerslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListMetrics.js +[managersupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUpdate.js +[managersupdateextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUpdateExtendedInfo.js +[managersuploadregistrationcertificate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUploadRegistrationCertificate.js +[operationslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/operationsList.js +[storageaccountcredentialscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsCreateOrUpdate.js +[storageaccountcredentialsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsDelete.js +[storageaccountcredentialsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsGet.js +[storageaccountcredentialslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsListByManager.js +[storagedomainscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsCreateOrUpdate.js +[storagedomainsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsDelete.js +[storagedomainsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsGet.js +[storagedomainslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsListByManager.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-storsimple1200series?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple1200series/arm-storsimple1200series/README.md diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsCreateOrUpdate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsCreateOrUpdate.js new file mode 100644 index 000000000000..08bccbf80a0c --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsCreateOrUpdate.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or Updates an access control record. + * + * @summary Creates or Updates an access control record. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsCreateOrUpdate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function accessControlRecordsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const accessControlRecordName = "AcrForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const accessControlRecord = { + name: "AcrForSDKTest", + initiatorName: "iqn.2017-06.com.contoso:ForTest", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.beginCreateOrUpdateAndWait( + accessControlRecordName, + resourceGroupName, + managerName, + accessControlRecord + ); + console.log(result); +} + +accessControlRecordsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsDelete.js new file mode 100644 index 000000000000..8a1b4a3926ac --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsDelete.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the access control record. + * + * @summary Deletes the access control record. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function accessControlRecordsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const accessControlRecordName = "AcrForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.beginDeleteAndWait( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsGet.js new file mode 100644 index 000000000000..60c6ab1a4f81 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsGet.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified access control record name. + * + * @summary Returns the properties of the specified access control record name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function accessControlRecordsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const accessControlRecordName = "AcrForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.get( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsListByManager.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsListByManager.js new file mode 100644 index 000000000000..fc8438a6da7d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/accessControlRecordsListByManager.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the access control records in a manager. + * + * @summary Retrieves all the access control records in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsListByManager.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function accessControlRecordsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessControlRecords.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +accessControlRecordsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsClear.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsClear.js new file mode 100644 index 000000000000..496ca413a75b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsClear.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clear the alerts. + * + * @summary Clear the alerts. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsClear.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function alertsClear() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const request = { + alerts: [ + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hManagerForSDKTest4/devices/is2-hlmdhdgu1et/alerts/a1f3a945-74dc-4387-bf17-a4f226374833", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.alerts.clear(resourceGroupName, managerName, request); + console.log(result); +} + +alertsClear().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsListByManager.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsListByManager.js new file mode 100644 index 000000000000..a58c0d1dd32d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsListByManager.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the alerts in a manager. + * + * @summary Retrieves all the alerts in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsListByManager.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function alertsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const filter = "status eq 'Active' and severity eq 'Critical'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.alerts.listByManager(resourceGroupName, managerName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +alertsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsSendTestEmail.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsSendTestEmail.js new file mode 100644 index 000000000000..6f83cd921c67 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/alertsSendTestEmail.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Sends a test alert email. + * + * @summary Sends a test alert email. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsSendTestEmail.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function alertsSendTestEmail() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "is2-hlmdhdgu1et"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const request = { + emailList: ["testemailid@contoso.com"], + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.alerts.sendTestEmail( + deviceName, + resourceGroupName, + managerName, + request + ); + console.log(result); +} + +alertsSendTestEmail().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsCreateOrUpdate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsCreateOrUpdate.js new file mode 100644 index 000000000000..2b2d5fd84f80 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsCreateOrUpdate.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or Updates the backup schedule Group. + * + * @summary Creates or Updates the backup schedule Group. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsCreateOrUpdate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupScheduleGroupsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const scheduleGroupName = "BackupSchGroupForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const scheduleGroup = { + name: "BackupSchGroupForSDKTest", + startTime: { hour: 17, minute: 38 }, + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backupScheduleGroups.beginCreateOrUpdateAndWait( + deviceName, + scheduleGroupName, + resourceGroupName, + managerName, + scheduleGroup + ); + console.log(result); +} + +backupScheduleGroupsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsDelete.js new file mode 100644 index 000000000000..2d7be85ce484 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsDelete.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup schedule group. + * + * @summary Deletes the backup schedule group. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupScheduleGroupsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const scheduleGroupName = "BackupSchGroupForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backupScheduleGroups.beginDeleteAndWait( + deviceName, + scheduleGroupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupScheduleGroupsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsGet.js new file mode 100644 index 000000000000..0f6f3638fcd3 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsGet.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified backup schedule group name. + * + * @summary Returns the properties of the specified backup schedule group name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupScheduleGroupsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const scheduleGroupName = "BackupSchGroupForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backupScheduleGroups.get( + deviceName, + scheduleGroupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupScheduleGroupsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsListByDevice.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsListByDevice.js new file mode 100644 index 000000000000..7a16f20d8f03 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupScheduleGroupsListByDevice.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backup schedule groups in a device. + * + * @summary Retrieves all the backup schedule groups in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsListByDevice.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupScheduleGroupsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backupScheduleGroups.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupScheduleGroupsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsClone.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsClone.js new file mode 100644 index 000000000000..7afde6f2fb67 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsClone.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clones the given backup element to a new disk or share with given details. + * + * @summary Clones the given backup element to a new disk or share with given details. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsClone.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupsClone() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const backupName = "58d33025-e837-41cc-b15f-7c85ced64aab"; + const elementName = "2304968f-91af-4f59-8b79-31e321eee40e"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const cloneRequest = { + newEndpointName: "ClonedTieredFileShareForSDKTest", + share: { + name: "TieredFileShareForSDKTest", + description: "Restore file Share", + adminUser: "HSDK-4XY4FI2IVGStorSimpleAdmin", + dataPolicy: "Tiered", + monitoringStatus: "Enabled", + provisionedCapacityInBytes: 536870912000, + shareStatus: "Online", + }, + targetAccessPointId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/hsdk-4xy4fi2ivg/fileServers/HSDK-4XY4FI2IVG", + targetDeviceId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/hsdk-4xy4fi2ivg", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backups.beginCloneAndWait( + deviceName, + backupName, + elementName, + resourceGroupName, + managerName, + cloneRequest + ); + console.log(result); +} + +backupsClone().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsDelete.js new file mode 100644 index 000000000000..be3b07a093da --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsDelete.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup. + * + * @summary Deletes the backup. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const backupName = "315c3461-96ad-41bf-af0b-3a8be5113203"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backups.beginDeleteAndWait( + deviceName, + backupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsListByDevice.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsListByDevice.js new file mode 100644 index 000000000000..8edf7531b5e9 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsListByDevice.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backups in a device. Can be used to get the backups for failover also. + * + * @summary Retrieves all the backups in a device. Can be used to get the backups for failover also. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsListByDevice.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "initiatedBy eq 'Manual'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsListByManager.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsListByManager.js new file mode 100644 index 000000000000..424475c2a3eb --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/backupsListByManager.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backups in a manager. + * + * @summary Retrieves all the backups in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsListByManager.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "createdTime ge '2018-08-10T17:30:03Z' and createdTime le '2018-08-14T17:30:03Z' and initiatedBy eq 'Manual'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.listByManager(resourceGroupName, managerName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +backupsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsCreateOrUpdate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsCreateOrUpdate.js new file mode 100644 index 000000000000..7d6f11be60bd --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsCreateOrUpdate.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the chap setting. + * + * @summary Creates or updates the chap setting. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsCreateOrUpdate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function chapSettingsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const chapUserName = "ChapSettingForSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const chapSetting = { + name: "ChapSettingForSDK", + password: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertificateThumbprint: "D73DB57C4CDD6761E159F8D1E8A7D759424983FD", + value: "", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.chapSettingsOperations.beginCreateOrUpdateAndWait( + deviceName, + chapUserName, + resourceGroupName, + managerName, + chapSetting + ); + console.log(result); +} + +chapSettingsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsDelete.js new file mode 100644 index 000000000000..f14cd18fdbf2 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsDelete.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the chap setting. + * + * @summary Deletes the chap setting. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function chapSettingsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const chapUserName = "ChapSettingForSDKForDelete"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.chapSettingsOperations.beginDeleteAndWait( + deviceName, + chapUserName, + resourceGroupName, + managerName + ); + console.log(result); +} + +chapSettingsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsGet.js new file mode 100644 index 000000000000..db36eb315d0d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsGet.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified chap setting name. + * + * @summary Returns the properties of the specified chap setting name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function chapSettingsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const chapUserName = "ChapSettingForSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.chapSettingsOperations.get( + deviceName, + chapUserName, + resourceGroupName, + managerName + ); + console.log(result); +} + +chapSettingsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsListByDevice.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsListByDevice.js new file mode 100644 index 000000000000..f424b4bbe3ea --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/chapSettingsListByDevice.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the chap settings in a device. + * + * @summary Retrieves all the chap settings in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsListByDevice.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function chapSettingsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.chapSettingsOperations.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +chapSettingsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesCreateOrUpdateAlertSettings.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesCreateOrUpdateAlertSettings.js new file mode 100644 index 000000000000..dfaeed464de6 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesCreateOrUpdateAlertSettings.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the alert settings + * + * @summary Creates or updates the alert settings + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesCreateOrUpdateAlertSettings.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesCreateOrUpdateAlertSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const alertSettings = { + name: "default", + additionalRecipientEmailList: ["testuser@abc.com"], + alertNotificationCulture: "en-US", + emailNotification: "Enabled", + notificationToServiceOwners: "Disabled", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginCreateOrUpdateAlertSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + alertSettings + ); + console.log(result); +} + +devicesCreateOrUpdateAlertSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesCreateOrUpdateSecuritySettings.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesCreateOrUpdateSecuritySettings.js new file mode 100644 index 000000000000..46f0492a234a --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesCreateOrUpdateSecuritySettings.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the security settings. + * + * @summary Creates or updates the security settings. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesCreateOrUpdateSecuritySettings.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesCreateOrUpdateSecuritySettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const securitySettings = { + deviceAdminPassword: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertificateThumbprint: "D73DB57C4CDD6761E159F8D1E8A7D759424983FD", + value: "", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginCreateOrUpdateSecuritySettingsAndWait( + deviceName, + resourceGroupName, + managerName, + securitySettings + ); + console.log(result); +} + +devicesCreateOrUpdateSecuritySettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDeactivate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDeactivate.js new file mode 100644 index 000000000000..08e9bcb06cd6 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDeactivate.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deactivates the device. + * + * @summary Deactivates the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDeactivate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesDeactivate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "SDK-DELETE"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForDeleteOperation"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginDeactivateAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDeactivate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDelete.js new file mode 100644 index 000000000000..2a3ba8497ba5 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDelete.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the device. + * + * @summary Deletes the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "SDK-DELETE"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForDeleteOperation"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginDeleteAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDownloadUpdates.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDownloadUpdates.js new file mode 100644 index 000000000000..dcb26e117bbf --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesDownloadUpdates.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Downloads updates on the device. + * + * @summary Downloads updates on the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDownloadUpdates.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesDownloadUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginDownloadUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDownloadUpdates().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesFailover.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesFailover.js new file mode 100644 index 000000000000..af13b6975631 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesFailover.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Fails over the device to another device. + * + * @summary Fails over the device to another device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesFailover.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesFailover() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const failoverRequest = { + accesspointIds: [ + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-0NZI14MDTF/iscsiServers/HSDK-0NZI14MDTF", + ], + keepSourceDevice: true, + skipValidation: true, + targetDeviceId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-UGU4PITWNI", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginFailoverAndWait( + deviceName, + resourceGroupName, + managerName, + failoverRequest + ); + console.log(result); +} + +devicesFailover().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGet.js new file mode 100644 index 000000000000..b84db6014a8b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGet.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified device name. + * + * @summary Returns the properties of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.get(deviceName, resourceGroupName, managerName); + console.log(result); +} + +devicesGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetAlertSettings.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetAlertSettings.js new file mode 100644 index 000000000000..4d00193e1a47 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetAlertSettings.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the alert settings of the specified device name. + * + * @summary Returns the alert settings of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetAlertSettings.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesGetAlertSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getAlertSettings(deviceName, resourceGroupName, managerName); + console.log(result); +} + +devicesGetAlertSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetNetworkSettings.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetNetworkSettings.js new file mode 100644 index 000000000000..958d47463414 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetNetworkSettings.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the network settings of the specified device name. + * + * @summary Returns the network settings of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetNetworkSettings.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesGetNetworkSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getNetworkSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGetNetworkSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetTimeSettings.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetTimeSettings.js new file mode 100644 index 000000000000..e2891b762b8f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetTimeSettings.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the time settings of the specified device name. + * + * @summary Returns the time settings of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetTimeSettings.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesGetTimeSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getTimeSettings(deviceName, resourceGroupName, managerName); + console.log(result); +} + +devicesGetTimeSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetUpdateSummary.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetUpdateSummary.js new file mode 100644 index 000000000000..9e3605e7084f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesGetUpdateSummary.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the update summary of the specified device name. + * + * @summary Returns the update summary of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetUpdateSummary.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesGetUpdateSummary() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HBVT-02X525X2W0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getUpdateSummary(deviceName, resourceGroupName, managerName); + console.log(result); +} + +devicesGetUpdateSummary().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesInstallUpdates.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesInstallUpdates.js new file mode 100644 index 000000000000..e8950f1d468e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesInstallUpdates.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Installs the updates on the device. + * + * @summary Installs the updates on the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesInstallUpdates.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesInstallUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginInstallUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesInstallUpdates().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListByManager.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListByManager.js new file mode 100644 index 000000000000..504044625c39 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListByManager.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the devices in a manager. + * + * @summary Retrieves all the devices in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListByManager.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listByManager(resourceGroupName, managerName)) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListFailoverTarget.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListFailoverTarget.js new file mode 100644 index 000000000000..1bd2c746f200 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListFailoverTarget.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the devices which can be used as failover targets for the given device. + * + * @summary Retrieves all the devices which can be used as failover targets for the given device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListFailoverTarget.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesListFailoverTarget() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listFailoverTarget( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListFailoverTarget().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListMetricDefinition.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListMetricDefinition.js new file mode 100644 index 000000000000..b0ee46747765 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListMetricDefinition.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definition of all metrics aggregated at device. + * + * @summary Retrieves metric definition of all metrics aggregated at device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListMetricDefinition.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listMetricDefinition( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListMetrics.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListMetrics.js new file mode 100644 index 000000000000..54d2d4565026 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesListMetrics.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves the device metrics. + * + * @summary Retrieves the device metrics. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListMetrics.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listMetrics( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesPatch.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesPatch.js new file mode 100644 index 000000000000..26168ed2e4c5 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesPatch.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Patches the device. + * + * @summary Patches the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesPatch.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesPatch() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const devicePatch = { + deviceDescription: "NewDescription8/14/2018 2:30:34 PM", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginPatchAndWait( + deviceName, + resourceGroupName, + managerName, + devicePatch + ); + console.log(result); +} + +devicesPatch().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesScanForUpdates.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesScanForUpdates.js new file mode 100644 index 000000000000..84f629038d8c --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/devicesScanForUpdates.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Scans for updates on the device. + * + * @summary Scans for updates on the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesScanForUpdates.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesScanForUpdates() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HBVT-02X525X2W0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginScanForUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesScanForUpdates().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersBackupNow.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersBackupNow.js new file mode 100644 index 000000000000..0dafadab689d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersBackupNow.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Backup the file server now. + * + * @summary Backup the file server now. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersBackupNow.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileServersBackupNow() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.beginBackupNowAndWait( + deviceName, + fileServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileServersBackupNow().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersCreateOrUpdate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersCreateOrUpdate.js new file mode 100644 index 000000000000..d44515757ccc --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersCreateOrUpdate.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the file server. + * + * @summary Creates or updates the file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersCreateOrUpdate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileServersCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const fileServer = { + name: "HSDK-4XY4FI2IVG", + description: "Demo FileServer for SDK Test", + backupScheduleGroupId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/hsdk-4xy4fi2ivg/backupScheduleGroups/BackupSchGroupForSDKTest", + domainName: "fareast.corp.microsoft.com", + storageDomainId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/storageDomains/sd-fs-HSDK-4XY4FI2IVG", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.beginCreateOrUpdateAndWait( + deviceName, + fileServerName, + resourceGroupName, + managerName, + fileServer + ); + console.log(result); +} + +fileServersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersDelete.js new file mode 100644 index 000000000000..f3c49bc5834f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersDelete.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the file server. + * + * @summary Deletes the file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileServersDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.beginDeleteAndWait( + deviceName, + fileServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileServersDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersGet.js new file mode 100644 index 000000000000..a27fb870b73f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersGet.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified file server name. + * + * @summary Returns the properties of the specified file server name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileServersGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.get( + deviceName, + fileServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileServersGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListByDevice.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListByDevice.js new file mode 100644 index 000000000000..21cdb8fd0337 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListByDevice.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file servers in a device. + * + * @summary Retrieves all the file servers in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListByDevice.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileServersListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListByManager.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListByManager.js new file mode 100644 index 000000000000..6364e1edad8d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListByManager.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file servers in a manager. + * + * @summary Retrieves all the file servers in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListByManager.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileServersListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listByManager(resourceGroupName, managerName)) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListMetricDefinition.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListMetricDefinition.js new file mode 100644 index 000000000000..43d237f8f214 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListMetricDefinition.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions of all metrics aggregated at the file server. + * + * @summary Retrieves metric definitions of all metrics aggregated at the file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListMetricDefinition.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileServersListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listMetricDefinition( + deviceName, + fileServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListMetrics.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListMetrics.js new file mode 100644 index 000000000000..1ef75bceeee0 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileServersListMetrics.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the file server metrics. + * + * @summary Gets the file server metrics. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListMetrics.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileServersListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listMetrics( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesCreateOrUpdate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesCreateOrUpdate.js new file mode 100644 index 000000000000..a2402b86f59f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesCreateOrUpdate.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the file share. + * + * @summary Creates or updates the file share. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesCreateOrUpdate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileSharesCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const shareName = "Auto-TestFileShare1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const fileShare = { + name: "Auto-TestFileShare1", + description: "Demo FileShare for SDK Test Tiered", + adminUser: "fareastidcdlslb", + dataPolicy: "Tiered", + monitoringStatus: "Enabled", + provisionedCapacityInBytes: 536870912000, + shareStatus: "Online", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileShares.beginCreateOrUpdateAndWait( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + fileShare + ); + console.log(result); +} + +fileSharesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesDelete.js new file mode 100644 index 000000000000..ddfc2b9998b4 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesDelete.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the file share. + * + * @summary Deletes the file share. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileSharesDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const shareName = "Auto-TestFileShare2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileShares.beginDeleteAndWait( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileSharesDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesGet.js new file mode 100644 index 000000000000..076c177ef1b8 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesGet.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified file share name. + * + * @summary Returns the properties of the specified file share name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileSharesGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const shareName = "Auto-TestFileShare1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileShares.get( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileSharesGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListByDevice.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListByDevice.js new file mode 100644 index 000000000000..8fd71fcd5d30 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListByDevice.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file shares in a device. + * + * @summary Retrieves all the file shares in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListByDevice.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileSharesListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListByFileServer.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListByFileServer.js new file mode 100644 index 000000000000..59cdbf542da9 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListByFileServer.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file shares in a file server. + * + * @summary Retrieves all the file shares in a file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListByFileServer.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileSharesListByFileServer() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const fileServerName = "HSDK-ARCSX4MVKZ"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listByFileServer( + deviceName, + fileServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListByFileServer().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListMetricDefinition.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListMetricDefinition.js new file mode 100644 index 000000000000..81410c5a3b6a --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListMetricDefinition.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions of all metrics aggregated at the file share. + * + * @summary Retrieves metric definitions of all metrics aggregated at the file share. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListMetricDefinition.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileSharesListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const shareName = "Auto-TestFileShare2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listMetricDefinition( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListMetrics.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListMetrics.js new file mode 100644 index 000000000000..129fb5873291 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/fileSharesListMetrics.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the file share metrics + * + * @summary Gets the file share metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListMetrics.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function fileSharesListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const shareName = "Auto-TestFileShare2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listMetrics( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksCreateOrUpdate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksCreateOrUpdate.js new file mode 100644 index 000000000000..3eddbc7bc5a2 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksCreateOrUpdate.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the iSCSI disk. + * + * @summary Creates or updates the iSCSI disk. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksCreateOrUpdate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiDisksCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const diskName = "Auto-TestIscsiDisk1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const iscsiDisk = { + name: "Auto-TestIscsiDisk1", + description: "Demo IscsiDisk for SDK Test Tiered", + accessControlRecords: [], + dataPolicy: "Tiered", + diskStatus: "Online", + monitoringStatus: "Enabled", + provisionedCapacityInBytes: 536870912000, + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiDisks.beginCreateOrUpdateAndWait( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + iscsiDisk + ); + console.log(result); +} + +iscsiDisksCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksDelete.js new file mode 100644 index 000000000000..cecdc1c20c39 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksDelete.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the iSCSI disk. + * + * @summary Deletes the iSCSI disk. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiDisksDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const diskName = "ClonedTieredIscsiDiskForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiDisks.beginDeleteAndWait( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiDisksDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksGet.js new file mode 100644 index 000000000000..8bf0817f1033 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksGet.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified iSCSI disk name. + * + * @summary Returns the properties of the specified iSCSI disk name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiDisksGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const diskName = "Auto-TestIscsiDisk1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiDisks.get( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiDisksGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListByDevice.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListByDevice.js new file mode 100644 index 000000000000..498a670fd608 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListByDevice.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the iSCSI disks in a device. + * + * @summary Retrieves all the iSCSI disks in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListByDevice.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiDisksListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListByIscsiServer.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListByIscsiServer.js new file mode 100644 index 000000000000..01fc9e977b0f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListByIscsiServer.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the disks in a iSCSI server. + * + * @summary Retrieves all the disks in a iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListByIscsiServer.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiDisksListByIscsiServer() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listByIscsiServer( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListByIscsiServer().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListMetricDefinition.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListMetricDefinition.js new file mode 100644 index 000000000000..bc19f0ee1a86 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListMetricDefinition.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions for all metric aggregated at the iSCSI disk. + * + * @summary Retrieves metric definitions for all metric aggregated at the iSCSI disk. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListMetricDefinition.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiDisksListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const diskName = "TieredIscsiDiskForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listMetricDefinition( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListMetrics.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListMetrics.js new file mode 100644 index 000000000000..c530b883991a --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiDisksListMetrics.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the iSCSI disk metrics + * + * @summary Gets the iSCSI disk metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListMetrics.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiDisksListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const diskName = "TieredIscsiDiskForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listMetrics( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersBackupNow.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersBackupNow.js new file mode 100644 index 000000000000..60be6bd09a74 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersBackupNow.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Backup the iSCSI server now. + * + * @summary Backup the iSCSI server now. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersBackupNow.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiServersBackupNow() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.beginBackupNowAndWait( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiServersBackupNow().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersCreateOrUpdate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersCreateOrUpdate.js new file mode 100644 index 000000000000..d66325b1a098 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersCreateOrUpdate.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the iSCSI server. + * + * @summary Creates or updates the iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersCreateOrUpdate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiServersCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const iscsiServer = { + name: "HSDK-WSJQERQW3F", + type: "Microsoft.StorSimple/managers/devices/iscsiServers", + backupScheduleGroupId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-WSJQERQW3F/backupScheduleGroups/Default-HSDK-WSJQERQW3F-BackupScheduleGroup", + chapId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-WSJQERQW3F/chapSettings/ChapSettingForSDK", + id: "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-WSJQERQW3F/iscsiServers/HSDK-WSJQERQW3F", + reverseChapId: "", + storageDomainId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/storageDomains/Default-HSDK-WSJQERQW3F-StorageDomain", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.beginCreateOrUpdateAndWait( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + iscsiServer + ); + console.log(result); +} + +iscsiServersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersDelete.js new file mode 100644 index 000000000000..7abd11d11fd6 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersDelete.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the iSCSI server. + * + * @summary Deletes the iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiServersDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.beginDeleteAndWait( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiServersDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersGet.js new file mode 100644 index 000000000000..c1a5ecc1d27a --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersGet.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified iSCSI server name. + * + * @summary Returns the properties of the specified iSCSI server name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiServersGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.get( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiServersGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListByDevice.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListByDevice.js new file mode 100644 index 000000000000..7db82376546c --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListByDevice.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the iSCSI in a device. + * + * @summary Retrieves all the iSCSI in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListByDevice.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiServersListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListByManager.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListByManager.js new file mode 100644 index 000000000000..6608038cad38 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListByManager.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the iSCSI servers in a manager. + * + * @summary Retrieves all the iSCSI servers in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListByManager.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiServersListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listByManager(resourceGroupName, managerName)) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListMetricDefinition.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListMetricDefinition.js new file mode 100644 index 000000000000..bcce448a6228 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListMetricDefinition.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions for all metrics aggregated at iSCSI server. + * + * @summary Retrieves metric definitions for all metrics aggregated at iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListMetricDefinition.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiServersListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listMetricDefinition( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListMetrics.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListMetrics.js new file mode 100644 index 000000000000..5870173ecfb3 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/iscsiServersListMetrics.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the iSCSI server metrics + * + * @summary Gets the iSCSI server metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListMetrics.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function iscsiServersListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listMetrics( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsGet.js new file mode 100644 index 000000000000..c95aa1171bb0 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsGet.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified job name. + * + * @summary Returns the properties of the specified job name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function jobsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const jobName = "06c7ee19-35a2-4248-bf1b-408009b31b63"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.jobs.get(deviceName, jobName, resourceGroupName, managerName); + console.log(result); +} + +jobsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsListByDevice.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsListByDevice.js new file mode 100644 index 000000000000..b881c80b63bc --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsListByDevice.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the jobs in a device. + * + * @summary Retrieves all the jobs in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsListByDevice.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function jobsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "jobType eq 'Backup'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.jobs.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsListByManager.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsListByManager.js new file mode 100644 index 000000000000..be72557c588a --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/jobsListByManager.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the jobs in a manager. + * + * @summary Retrieves all the jobs in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsListByManager.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function jobsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "jobType eq 'Backup'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.jobs.listByManager(resourceGroupName, managerName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersCreateExtendedInfo.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersCreateExtendedInfo.js new file mode 100644 index 000000000000..d57894d8f319 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersCreateExtendedInfo.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates the extended info of the manager. + * + * @summary Creates the extended info of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersCreateExtendedInfo.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersCreateExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const managerExtendedInfo = { + name: "vaultExtendedInfo", + type: "Microsoft.StorSimple/Managers/extendedInformation", + algorithm: "SHA256", + etag: "6531d5d7-3ced-4f78-83b6-804368f2ca0c", + id: "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/Managers/hManagerForSDKTestextendedInformation/vaultExtendedInfo", + integrityKey: "e6501980-7efe-4602-bb0e-3cb9a08a6003", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.createExtendedInfo( + resourceGroupName, + managerName, + managerExtendedInfo + ); + console.log(result); +} + +managersCreateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersCreateOrUpdate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersCreateOrUpdate.js new file mode 100644 index 000000000000..9f84d39de7cf --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersCreateOrUpdate.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the manager. + * + * @summary Creates or updates the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersCreateOrUpdate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const manager = { + name: "hManagerForSDKTest", + cisIntrinsicSettings: { type: "HelsinkiV1" }, + location: "westus", + sku: { name: "Standard" }, + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.createOrUpdate(resourceGroupName, managerName, manager); + console.log(result); +} + +managersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersDelete.js new file mode 100644 index 000000000000..233ddf2c498a --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersDelete.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the manager. + * + * @summary Deletes the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.delete(resourceGroupName, managerName); + console.log(result); +} + +managersDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersDeleteExtendedInfo.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersDeleteExtendedInfo.js new file mode 100644 index 000000000000..831c2593339c --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersDeleteExtendedInfo.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the extended info of the manager. + * + * @summary Deletes the extended info of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersDeleteExtendedInfo.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersDeleteExtendedInfo() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.deleteExtendedInfo(resourceGroupName, managerName); + console.log(result); +} + +managersDeleteExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGet.js new file mode 100644 index 000000000000..b8e566b1deea --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGet.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified manager name. + * + * @summary Returns the properties of the specified manager name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.get(resourceGroupName, managerName); + console.log(result); +} + +managersGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetEncryptionKey.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetEncryptionKey.js new file mode 100644 index 000000000000..dc8f1a9e15be --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetEncryptionKey.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the symmetric encryption key of the manager. + * + * @summary Returns the symmetric encryption key of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetEncryptionKey.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersGetEncryptionKey() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.getEncryptionKey(resourceGroupName, managerName); + console.log(result); +} + +managersGetEncryptionKey().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetEncryptionSettings.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetEncryptionSettings.js new file mode 100644 index 000000000000..23ba4529563c --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetEncryptionSettings.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the encryption settings of the manager. + * + * @summary Returns the encryption settings of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetEncryptionSettings.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersGetEncryptionSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.getEncryptionSettings(resourceGroupName, managerName); + console.log(result); +} + +managersGetEncryptionSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetExtendedInfo.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetExtendedInfo.js new file mode 100644 index 000000000000..48ec91e90cd8 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersGetExtendedInfo.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the extended information of the specified manager name. + * + * @summary Returns the extended information of the specified manager name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetExtendedInfo.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersGetExtendedInfo() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.getExtendedInfo(resourceGroupName, managerName); + console.log(result); +} + +managersGetExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersList.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersList.js new file mode 100644 index 000000000000..5ae15000b0b7 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersList.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a subscription. + * + * @summary Retrieves all the managers in a subscription. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersList.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersList() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +managersList().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListByResourceGroup.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListByResourceGroup.js new file mode 100644 index 000000000000..0aec8bf51edf --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListByResourceGroup.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a resource group. + * + * @summary Retrieves all the managers in a resource group. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListByResourceGroup.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersListByResourceGroup() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +managersListByResourceGroup().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListMetricDefinition.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListMetricDefinition.js new file mode 100644 index 000000000000..0ec9a5ac8521 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListMetricDefinition.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definition of all metrics aggregated at manager. + * + * @summary Retrieves metric definition of all metrics aggregated at manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListMetricDefinition.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listMetricDefinition(resourceGroupName, managerName)) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListMetrics.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListMetrics.js new file mode 100644 index 000000000000..14f3dfb513c8 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersListMetrics.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the manager metrics + * + * @summary Gets the manager metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListMetrics.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "startTime ge '2018-08-04T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listMetrics(resourceGroupName, managerName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUpdate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUpdate.js new file mode 100644 index 000000000000..1c45140023b9 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUpdate.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the StorSimple Manager. + * + * @summary Updates the StorSimple Manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUpdate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters = { tags: { tagName: "ForSDKTest" } }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.update(resourceGroupName, managerName, parameters); + console.log(result); +} + +managersUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUpdateExtendedInfo.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUpdateExtendedInfo.js new file mode 100644 index 000000000000..5b98b5d53071 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUpdateExtendedInfo.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the extended info of the manager. + * + * @summary Updates the extended info of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUpdateExtendedInfo.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersUpdateExtendedInfo() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const ifMatch = "6531d5d7-3ced-4f78-83b6-804368f2ca0c"; + const managerExtendedInfo = { + name: "vaultExtendedInfo", + type: "Microsoft.StorSimple/Managers/extendedInformation", + algorithm: "SHA256", + etag: "6531d5d7-3ced-4f78-83b6-804368f2ca0c", + id: "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/Managers/hManagerForSDKTestextendedInformation/vaultExtendedInfo", + integrityKey: "e6501980-7efe-4602-bb0e-3cb9a08a6003", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.updateExtendedInfo( + resourceGroupName, + managerName, + ifMatch, + managerExtendedInfo + ); + console.log(result); +} + +managersUpdateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUploadRegistrationCertificate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUploadRegistrationCertificate.js new file mode 100644 index 000000000000..dc9765082fe8 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/managersUploadRegistrationCertificate.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Upload Vault Cred Certificate. +Returns UploadCertificateResponse + * + * @summary Upload Vault Cred Certificate. +Returns UploadCertificateResponse + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUploadRegistrationCertificate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersUploadRegistrationCertificate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const certificateName = "windows"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const uploadCertificateRequestrequest = { + authType: "AzureActiveDirectory", + certificate: + "MIIC3TCCAcWgAwIBAgIQEr0bAWD6wJtA4LIbZ9NtgzANBgkqhkiG9w0BAQUFADAeMRwwGgYDVQQDExNXaW5kb3dzIEF6dXJlIFRvb2xzMB4XDTE4MDkxMDE1MzY0MFoXDTE4MDkxMzE1NDY0MFowHjEcMBoGA1UEAxMTV2luZG93cyBBenVyZSBUb29sczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANUsKkz2Z4fECKMyNeLb9v3pr1XF4dVe+MITDtgphjl81ng190Y0IHgCVnh4YjfplUSpMk/1xii0rI5AAPwoz3ze2qRPtnwCiTaoVLkUe6knNRPzrRvVXHB81J0/14MO0lwdByHhdccRcVJZPLt5724t4aQny82v2AayJdDDkBBWNlpcqPy6n3sygP00THMPP0O3sFqy924eHqoDj3qSw79/meaZBJt9S5odPuFoskxjHuI4lM6BmK1Ql7p8Wo9/GhTOIoMz81orKPHRDleLjutwL4mb6NnhI5rfT/MxnHD6m82c4YYqiZC3XiTyJWVCkWkp7PK92OdRp6FA87rdKDMCAwEAAaMXMBUwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADggEBAIYlezVU68TuEblkn06vM5dfzSmHKJOQgW61nDlLnyKrmSJtzKZLCAswTE2VyJHwKNdZgW15coJFINjWBLWcLr0/GjNV4u3Z+UL3NhBFQd5xuMtKsIhuoscKtyk0JHQXpBvHNmOUCobfQfOBQfTVC7kmyWdtlGztFUVxD28s6S5gMb1FEWWN68NOOJ3/ZhaTbUEM54yw8Hk8/f0L/Zn/7BYHUyWWA3KStAaYn89C/ZFF+952ark2VaKGIjBRQzgrJEIR8dI4r46I3DoEfzGPESKvQPvVLhOX84RG0PLPOtnRbHBVew1Nh3HE9kgCubkPKK+NPWE9IHZPoRmOTWBe+zU=", + contractVersion: "V2012_12", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.uploadRegistrationCertificate( + certificateName, + resourceGroupName, + managerName, + uploadCertificateRequestrequest + ); + console.log(result); +} + +managersUploadRegistrationCertificate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/operationsList.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/operationsList.js new file mode 100644 index 000000000000..90ebd77108f5 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/operationsList.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to List of AvailableProviderOperations + * + * @summary List of AvailableProviderOperations + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/OperationsList.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availableProviderOperationsOperations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/package.json b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/package.json new file mode 100644 index 000000000000..158067f5222f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "azure-arm-storsimple1200series-samples-js", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/storsimple1200series/arm-storsimple1200series" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple1200series/arm-storsimple1200series", + "dependencies": { + "@azure/arm-storsimple1200series": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/sample.env b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsCreateOrUpdate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsCreateOrUpdate.js new file mode 100644 index 000000000000..4e64865c7970 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsCreateOrUpdate.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the storage account credential + * + * @summary Creates or updates the storage account credential + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsCreateOrUpdate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageAccountCredentialsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credentialName = "DummySacForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const storageAccount = { + name: "DummySacForSDKTest", + accessKey: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertificateThumbprint: "D73DB57C4CDD6761E159F8D1E8A7D759424983FD", + value: + "Ev1tm0QBmpGGm4a58GkqLqx8veJEEgQtg5K3Jizpmy7JdSv9dlcRwk59THw6KIdMDlEHcS8mPyneBtOEQsh4wkcFB7qrmQz+KsRAyIhEm6bwPEm3qN8+aDDzNcXn/6vu/sqV0AP7zit9/s7SxXGxjKrz4zKnOy16/DbzRRmUHNO+HO6JUM0cUfHXTX0mEecbsXqBq0A8IEG8z+bJgXX1EhoGkzE6yVsObm4S1AcKrLiwWjqmSLji5Q8gGO+y4KTTmC3p45h5GHHXjJyOccHhySWDAffxnTzUD/sOoh+aD2VkAYrL3DdnkVzhAdfcZfVI4soONx7tYMloZIVsfW1M2Q==", + }, + cloudType: "Azure", + enableSSL: "Enabled", + endPoint: "blob.core.windows.net", + location: "West US", + login: "SacForSDKTest", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.beginCreateOrUpdateAndWait( + credentialName, + resourceGroupName, + managerName, + storageAccount + ); + console.log(result); +} + +storageAccountCredentialsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsDelete.js new file mode 100644 index 000000000000..ec0b6ead8ed4 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsDelete.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the storage account credential + * + * @summary Deletes the storage account credential + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageAccountCredentialsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credentialName = "DummySacForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.beginDeleteAndWait( + credentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsGet.js new file mode 100644 index 000000000000..153031f7517b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsGet.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified storage account credential name. + * + * @summary Returns the properties of the specified storage account credential name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageAccountCredentialsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credentialName = "SacForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.get( + credentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsListByManager.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsListByManager.js new file mode 100644 index 000000000000..eca50e0f412e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageAccountCredentialsListByManager.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the storage account credentials in a manager. + * + * @summary Retrieves all the storage account credentials in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsListByManager.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageAccountCredentialsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageAccountCredentials.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +storageAccountCredentialsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsCreateOrUpdate.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsCreateOrUpdate.js new file mode 100644 index 000000000000..bba54cfdc8f7 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsCreateOrUpdate.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the storage domain. + * + * @summary Creates or updates the storage domain. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsCreateOrUpdate.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageDomainsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const storageDomainName = "sd-fs-HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const storageDomain = { + name: "sd-fs-HSDK-4XY4FI2IVG", + encryptionStatus: "Disabled", + storageAccountCredentialIds: [ + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/storageAccountCredentials/sacforsdktest", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageDomains.beginCreateOrUpdateAndWait( + storageDomainName, + resourceGroupName, + managerName, + storageDomain + ); + console.log(result); +} + +storageDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsDelete.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsDelete.js new file mode 100644 index 000000000000..f8b7ba47d929 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsDelete.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the storage domain. + * + * @summary Deletes the storage domain. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsDelete.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageDomainsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const storageDomainName = "sd-fs-HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageDomains.beginDeleteAndWait( + storageDomainName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageDomainsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsGet.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsGet.js new file mode 100644 index 000000000000..5bda676228be --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsGet.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified storage domain name. + * + * @summary Returns the properties of the specified storage domain name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsGet.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageDomainsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const storageDomainName = "sd-fs-HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageDomains.get(storageDomainName, resourceGroupName, managerName); + console.log(result); +} + +storageDomainsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsListByManager.js b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsListByManager.js new file mode 100644 index 000000000000..72c700ac8e77 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/javascript/storageDomainsListByManager.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the storage domains in a manager. + * + * @summary Retrieves all the storage domains in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsListByManager.json + */ +const { StorSimpleManagementClient } = require("@azure/arm-storsimple1200series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageDomainsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageDomains.listByManager(resourceGroupName, managerName)) { + resArray.push(item); + } + console.log(resArray); +} + +storageDomainsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/README.md b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/README.md new file mode 100644 index 000000000000..b8a9256808a9 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/README.md @@ -0,0 +1,249 @@ +# client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accessControlRecordsCreateOrUpdate.ts][accesscontrolrecordscreateorupdate] | Creates or Updates an access control record. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsCreateOrUpdate.json | +| [accessControlRecordsDelete.ts][accesscontrolrecordsdelete] | Deletes the access control record. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsDelete.json | +| [accessControlRecordsGet.ts][accesscontrolrecordsget] | Returns the properties of the specified access control record name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsGet.json | +| [accessControlRecordsListByManager.ts][accesscontrolrecordslistbymanager] | Retrieves all the access control records in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsListByManager.json | +| [alertsClear.ts][alertsclear] | Clear the alerts. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsClear.json | +| [alertsListByManager.ts][alertslistbymanager] | Retrieves all the alerts in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsListByManager.json | +| [alertsSendTestEmail.ts][alertssendtestemail] | Sends a test alert email. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsSendTestEmail.json | +| [backupScheduleGroupsCreateOrUpdate.ts][backupschedulegroupscreateorupdate] | Creates or Updates the backup schedule Group. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsCreateOrUpdate.json | +| [backupScheduleGroupsDelete.ts][backupschedulegroupsdelete] | Deletes the backup schedule group. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsDelete.json | +| [backupScheduleGroupsGet.ts][backupschedulegroupsget] | Returns the properties of the specified backup schedule group name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsGet.json | +| [backupScheduleGroupsListByDevice.ts][backupschedulegroupslistbydevice] | Retrieves all the backup schedule groups in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsListByDevice.json | +| [backupsClone.ts][backupsclone] | Clones the given backup element to a new disk or share with given details. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsClone.json | +| [backupsDelete.ts][backupsdelete] | Deletes the backup. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsDelete.json | +| [backupsListByDevice.ts][backupslistbydevice] | Retrieves all the backups in a device. Can be used to get the backups for failover also. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsListByDevice.json | +| [backupsListByManager.ts][backupslistbymanager] | Retrieves all the backups in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsListByManager.json | +| [chapSettingsCreateOrUpdate.ts][chapsettingscreateorupdate] | Creates or updates the chap setting. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsCreateOrUpdate.json | +| [chapSettingsDelete.ts][chapsettingsdelete] | Deletes the chap setting. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsDelete.json | +| [chapSettingsGet.ts][chapsettingsget] | Returns the properties of the specified chap setting name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsGet.json | +| [chapSettingsListByDevice.ts][chapsettingslistbydevice] | Retrieves all the chap settings in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsListByDevice.json | +| [devicesCreateOrUpdateAlertSettings.ts][devicescreateorupdatealertsettings] | Creates or updates the alert settings x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesCreateOrUpdateAlertSettings.json | +| [devicesCreateOrUpdateSecuritySettings.ts][devicescreateorupdatesecuritysettings] | Creates or updates the security settings. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesCreateOrUpdateSecuritySettings.json | +| [devicesDeactivate.ts][devicesdeactivate] | Deactivates the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDeactivate.json | +| [devicesDelete.ts][devicesdelete] | Deletes the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDelete.json | +| [devicesDownloadUpdates.ts][devicesdownloadupdates] | Downloads updates on the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDownloadUpdates.json | +| [devicesFailover.ts][devicesfailover] | Fails over the device to another device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesFailover.json | +| [devicesGet.ts][devicesget] | Returns the properties of the specified device name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGet.json | +| [devicesGetAlertSettings.ts][devicesgetalertsettings] | Returns the alert settings of the specified device name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetAlertSettings.json | +| [devicesGetNetworkSettings.ts][devicesgetnetworksettings] | Returns the network settings of the specified device name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetNetworkSettings.json | +| [devicesGetTimeSettings.ts][devicesgettimesettings] | Returns the time settings of the specified device name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetTimeSettings.json | +| [devicesGetUpdateSummary.ts][devicesgetupdatesummary] | Returns the update summary of the specified device name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetUpdateSummary.json | +| [devicesInstallUpdates.ts][devicesinstallupdates] | Installs the updates on the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesInstallUpdates.json | +| [devicesListByManager.ts][deviceslistbymanager] | Retrieves all the devices in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListByManager.json | +| [devicesListFailoverTarget.ts][deviceslistfailovertarget] | Retrieves all the devices which can be used as failover targets for the given device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListFailoverTarget.json | +| [devicesListMetricDefinition.ts][deviceslistmetricdefinition] | Retrieves metric definition of all metrics aggregated at device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListMetricDefinition.json | +| [devicesListMetrics.ts][deviceslistmetrics] | Retrieves the device metrics. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListMetrics.json | +| [devicesPatch.ts][devicespatch] | Patches the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesPatch.json | +| [devicesScanForUpdates.ts][devicesscanforupdates] | Scans for updates on the device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesScanForUpdates.json | +| [fileServersBackupNow.ts][fileserversbackupnow] | Backup the file server now. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersBackupNow.json | +| [fileServersCreateOrUpdate.ts][fileserverscreateorupdate] | Creates or updates the file server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersCreateOrUpdate.json | +| [fileServersDelete.ts][fileserversdelete] | Deletes the file server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersDelete.json | +| [fileServersGet.ts][fileserversget] | Returns the properties of the specified file server name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersGet.json | +| [fileServersListByDevice.ts][fileserverslistbydevice] | Retrieves all the file servers in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListByDevice.json | +| [fileServersListByManager.ts][fileserverslistbymanager] | Retrieves all the file servers in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListByManager.json | +| [fileServersListMetricDefinition.ts][fileserverslistmetricdefinition] | Retrieves metric definitions of all metrics aggregated at the file server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListMetricDefinition.json | +| [fileServersListMetrics.ts][fileserverslistmetrics] | Gets the file server metrics. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListMetrics.json | +| [fileSharesCreateOrUpdate.ts][filesharescreateorupdate] | Creates or updates the file share. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesCreateOrUpdate.json | +| [fileSharesDelete.ts][filesharesdelete] | Deletes the file share. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesDelete.json | +| [fileSharesGet.ts][filesharesget] | Returns the properties of the specified file share name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesGet.json | +| [fileSharesListByDevice.ts][fileshareslistbydevice] | Retrieves all the file shares in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListByDevice.json | +| [fileSharesListByFileServer.ts][fileshareslistbyfileserver] | Retrieves all the file shares in a file server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListByFileServer.json | +| [fileSharesListMetricDefinition.ts][fileshareslistmetricdefinition] | Retrieves metric definitions of all metrics aggregated at the file share. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListMetricDefinition.json | +| [fileSharesListMetrics.ts][fileshareslistmetrics] | Gets the file share metrics x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListMetrics.json | +| [iscsiDisksCreateOrUpdate.ts][iscsidiskscreateorupdate] | Creates or updates the iSCSI disk. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksCreateOrUpdate.json | +| [iscsiDisksDelete.ts][iscsidisksdelete] | Deletes the iSCSI disk. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksDelete.json | +| [iscsiDisksGet.ts][iscsidisksget] | Returns the properties of the specified iSCSI disk name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksGet.json | +| [iscsiDisksListByDevice.ts][iscsidiskslistbydevice] | Retrieves all the iSCSI disks in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListByDevice.json | +| [iscsiDisksListByIscsiServer.ts][iscsidiskslistbyiscsiserver] | Retrieves all the disks in a iSCSI server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListByIscsiServer.json | +| [iscsiDisksListMetricDefinition.ts][iscsidiskslistmetricdefinition] | Retrieves metric definitions for all metric aggregated at the iSCSI disk. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListMetricDefinition.json | +| [iscsiDisksListMetrics.ts][iscsidiskslistmetrics] | Gets the iSCSI disk metrics x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListMetrics.json | +| [iscsiServersBackupNow.ts][iscsiserversbackupnow] | Backup the iSCSI server now. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersBackupNow.json | +| [iscsiServersCreateOrUpdate.ts][iscsiserverscreateorupdate] | Creates or updates the iSCSI server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersCreateOrUpdate.json | +| [iscsiServersDelete.ts][iscsiserversdelete] | Deletes the iSCSI server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersDelete.json | +| [iscsiServersGet.ts][iscsiserversget] | Returns the properties of the specified iSCSI server name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersGet.json | +| [iscsiServersListByDevice.ts][iscsiserverslistbydevice] | Retrieves all the iSCSI in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListByDevice.json | +| [iscsiServersListByManager.ts][iscsiserverslistbymanager] | Retrieves all the iSCSI servers in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListByManager.json | +| [iscsiServersListMetricDefinition.ts][iscsiserverslistmetricdefinition] | Retrieves metric definitions for all metrics aggregated at iSCSI server. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListMetricDefinition.json | +| [iscsiServersListMetrics.ts][iscsiserverslistmetrics] | Gets the iSCSI server metrics x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListMetrics.json | +| [jobsGet.ts][jobsget] | Returns the properties of the specified job name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsGet.json | +| [jobsListByDevice.ts][jobslistbydevice] | Retrieves all the jobs in a device. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsListByDevice.json | +| [jobsListByManager.ts][jobslistbymanager] | Retrieves all the jobs in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsListByManager.json | +| [managersCreateExtendedInfo.ts][managerscreateextendedinfo] | Creates the extended info of the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersCreateExtendedInfo.json | +| [managersCreateOrUpdate.ts][managerscreateorupdate] | Creates or updates the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersCreateOrUpdate.json | +| [managersDelete.ts][managersdelete] | Deletes the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersDelete.json | +| [managersDeleteExtendedInfo.ts][managersdeleteextendedinfo] | Deletes the extended info of the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersDeleteExtendedInfo.json | +| [managersGet.ts][managersget] | Returns the properties of the specified manager name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGet.json | +| [managersGetEncryptionKey.ts][managersgetencryptionkey] | Returns the symmetric encryption key of the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetEncryptionKey.json | +| [managersGetEncryptionSettings.ts][managersgetencryptionsettings] | Returns the encryption settings of the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetEncryptionSettings.json | +| [managersGetExtendedInfo.ts][managersgetextendedinfo] | Returns the extended information of the specified manager name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetExtendedInfo.json | +| [managersList.ts][managerslist] | Retrieves all the managers in a subscription. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersList.json | +| [managersListByResourceGroup.ts][managerslistbyresourcegroup] | Retrieves all the managers in a resource group. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListByResourceGroup.json | +| [managersListMetricDefinition.ts][managerslistmetricdefinition] | Retrieves metric definition of all metrics aggregated at manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListMetricDefinition.json | +| [managersListMetrics.ts][managerslistmetrics] | Gets the manager metrics x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListMetrics.json | +| [managersUpdate.ts][managersupdate] | Updates the StorSimple Manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUpdate.json | +| [managersUpdateExtendedInfo.ts][managersupdateextendedinfo] | Updates the extended info of the manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUpdateExtendedInfo.json | +| [managersUploadRegistrationCertificate.ts][managersuploadregistrationcertificate] | Upload Vault Cred Certificate. Returns UploadCertificateResponse x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUploadRegistrationCertificate.json | +| [operationsList.ts][operationslist] | List of AvailableProviderOperations x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/OperationsList.json | +| [storageAccountCredentialsCreateOrUpdate.ts][storageaccountcredentialscreateorupdate] | Creates or updates the storage account credential x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsCreateOrUpdate.json | +| [storageAccountCredentialsDelete.ts][storageaccountcredentialsdelete] | Deletes the storage account credential x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsDelete.json | +| [storageAccountCredentialsGet.ts][storageaccountcredentialsget] | Returns the properties of the specified storage account credential name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsGet.json | +| [storageAccountCredentialsListByManager.ts][storageaccountcredentialslistbymanager] | Retrieves all the storage account credentials in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsListByManager.json | +| [storageDomainsCreateOrUpdate.ts][storagedomainscreateorupdate] | Creates or updates the storage domain. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsCreateOrUpdate.json | +| [storageDomainsDelete.ts][storagedomainsdelete] | Deletes the storage domain. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsDelete.json | +| [storageDomainsGet.ts][storagedomainsget] | Returns the properties of the specified storage domain name. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsGet.json | +| [storageDomainsListByManager.ts][storagedomainslistbymanager] | Retrieves all the storage domains in a manager. x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsListByManager.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/accessControlRecordsCreateOrUpdate.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/accessControlRecordsCreateOrUpdate.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accesscontrolrecordscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsCreateOrUpdate.ts +[accesscontrolrecordsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsDelete.ts +[accesscontrolrecordsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsGet.ts +[accesscontrolrecordslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsListByManager.ts +[alertsclear]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsClear.ts +[alertslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsListByManager.ts +[alertssendtestemail]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsSendTestEmail.ts +[backupschedulegroupscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsCreateOrUpdate.ts +[backupschedulegroupsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsDelete.ts +[backupschedulegroupsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsGet.ts +[backupschedulegroupslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsListByDevice.ts +[backupsclone]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsClone.ts +[backupsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsDelete.ts +[backupslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsListByDevice.ts +[backupslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsListByManager.ts +[chapsettingscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsCreateOrUpdate.ts +[chapsettingsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsDelete.ts +[chapsettingsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsGet.ts +[chapsettingslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsListByDevice.ts +[devicescreateorupdatealertsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesCreateOrUpdateAlertSettings.ts +[devicescreateorupdatesecuritysettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesCreateOrUpdateSecuritySettings.ts +[devicesdeactivate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDeactivate.ts +[devicesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDelete.ts +[devicesdownloadupdates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDownloadUpdates.ts +[devicesfailover]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesFailover.ts +[devicesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGet.ts +[devicesgetalertsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetAlertSettings.ts +[devicesgetnetworksettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetNetworkSettings.ts +[devicesgettimesettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetTimeSettings.ts +[devicesgetupdatesummary]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetUpdateSummary.ts +[devicesinstallupdates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesInstallUpdates.ts +[deviceslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListByManager.ts +[deviceslistfailovertarget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListFailoverTarget.ts +[deviceslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListMetricDefinition.ts +[deviceslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListMetrics.ts +[devicespatch]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesPatch.ts +[devicesscanforupdates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesScanForUpdates.ts +[fileserversbackupnow]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersBackupNow.ts +[fileserverscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersCreateOrUpdate.ts +[fileserversdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersDelete.ts +[fileserversget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersGet.ts +[fileserverslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListByDevice.ts +[fileserverslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListByManager.ts +[fileserverslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListMetricDefinition.ts +[fileserverslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListMetrics.ts +[filesharescreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesCreateOrUpdate.ts +[filesharesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesDelete.ts +[filesharesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesGet.ts +[fileshareslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListByDevice.ts +[fileshareslistbyfileserver]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListByFileServer.ts +[fileshareslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListMetricDefinition.ts +[fileshareslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListMetrics.ts +[iscsidiskscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksCreateOrUpdate.ts +[iscsidisksdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksDelete.ts +[iscsidisksget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksGet.ts +[iscsidiskslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListByDevice.ts +[iscsidiskslistbyiscsiserver]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListByIscsiServer.ts +[iscsidiskslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListMetricDefinition.ts +[iscsidiskslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListMetrics.ts +[iscsiserversbackupnow]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersBackupNow.ts +[iscsiserverscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersCreateOrUpdate.ts +[iscsiserversdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersDelete.ts +[iscsiserversget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersGet.ts +[iscsiserverslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListByDevice.ts +[iscsiserverslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListByManager.ts +[iscsiserverslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListMetricDefinition.ts +[iscsiserverslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListMetrics.ts +[jobsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsGet.ts +[jobslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsListByDevice.ts +[jobslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsListByManager.ts +[managerscreateextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersCreateExtendedInfo.ts +[managerscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersCreateOrUpdate.ts +[managersdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersDelete.ts +[managersdeleteextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersDeleteExtendedInfo.ts +[managersget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGet.ts +[managersgetencryptionkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetEncryptionKey.ts +[managersgetencryptionsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetEncryptionSettings.ts +[managersgetextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetExtendedInfo.ts +[managerslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersList.ts +[managerslistbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListByResourceGroup.ts +[managerslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListMetricDefinition.ts +[managerslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListMetrics.ts +[managersupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUpdate.ts +[managersupdateextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUpdateExtendedInfo.ts +[managersuploadregistrationcertificate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUploadRegistrationCertificate.ts +[operationslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/operationsList.ts +[storageaccountcredentialscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsCreateOrUpdate.ts +[storageaccountcredentialsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsDelete.ts +[storageaccountcredentialsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsGet.ts +[storageaccountcredentialslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsListByManager.ts +[storagedomainscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsCreateOrUpdate.ts +[storagedomainsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsDelete.ts +[storagedomainsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsGet.ts +[storagedomainslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsListByManager.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-storsimple1200series?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple1200series/arm-storsimple1200series/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/package.json b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/package.json new file mode 100644 index 000000000000..bfbd330cdf9b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "azure-arm-storsimple1200series-samples-ts", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/storsimple1200series/arm-storsimple1200series" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple1200series/arm-storsimple1200series", + "dependencies": { + "@azure/arm-storsimple1200series": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.4.0", + "rimraf": "latest" + } +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/sample.env b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsCreateOrUpdate.ts new file mode 100644 index 000000000000..ad818047715b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsCreateOrUpdate.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or Updates an access control record. + * + * @summary Creates or Updates an access control record. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsCreateOrUpdate.json + */ +import { + AccessControlRecord, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const accessControlRecordName = "AcrForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const accessControlRecord: AccessControlRecord = { + name: "AcrForSDKTest", + initiatorName: "iqn.2017-06.com.contoso:ForTest" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.beginCreateOrUpdateAndWait( + accessControlRecordName, + resourceGroupName, + managerName, + accessControlRecord + ); + console.log(result); +} + +accessControlRecordsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsDelete.ts new file mode 100644 index 000000000000..07f6e830f98e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsDelete.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the access control record. + * + * @summary Deletes the access control record. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const accessControlRecordName = "AcrForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.beginDeleteAndWait( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsGet.ts new file mode 100644 index 000000000000..4fe6dd4ee7d6 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsGet.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified access control record name. + * + * @summary Returns the properties of the specified access control record name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const accessControlRecordName = "AcrForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.get( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsListByManager.ts new file mode 100644 index 000000000000..e4b619484831 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/accessControlRecordsListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the access control records in a manager. + * + * @summary Retrieves all the access control records in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AccessControlRecordsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessControlRecords.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +accessControlRecordsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsClear.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsClear.ts new file mode 100644 index 000000000000..a4623e0fc231 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsClear.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clear the alerts. + * + * @summary Clear the alerts. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsClear.json + */ +import { + ClearAlertRequest, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsClear() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const request: ClearAlertRequest = { + alerts: [ + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hManagerForSDKTest4/devices/is2-hlmdhdgu1et/alerts/a1f3a945-74dc-4387-bf17-a4f226374833" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.alerts.clear( + resourceGroupName, + managerName, + request + ); + console.log(result); +} + +alertsClear().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsListByManager.ts new file mode 100644 index 000000000000..8ac9dfa9ff87 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the alerts in a manager. + * + * @summary Retrieves all the alerts in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const filter = "status eq 'Active' and severity eq 'Critical'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.alerts.listByManager( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +alertsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsSendTestEmail.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsSendTestEmail.ts new file mode 100644 index 000000000000..67cde92f0297 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/alertsSendTestEmail.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Sends a test alert email. + * + * @summary Sends a test alert email. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/AlertsSendTestEmail.json + */ +import { + SendTestAlertEmailRequest, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsSendTestEmail() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "is2-hlmdhdgu1et"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const request: SendTestAlertEmailRequest = { + emailList: ["testemailid@contoso.com"] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.alerts.sendTestEmail( + deviceName, + resourceGroupName, + managerName, + request + ); + console.log(result); +} + +alertsSendTestEmail().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsCreateOrUpdate.ts new file mode 100644 index 000000000000..6ca96614f23f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsCreateOrUpdate.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or Updates the backup schedule Group. + * + * @summary Creates or Updates the backup schedule Group. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsCreateOrUpdate.json + */ +import { + BackupScheduleGroup, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupScheduleGroupsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const scheduleGroupName = "BackupSchGroupForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const scheduleGroup: BackupScheduleGroup = { + name: "BackupSchGroupForSDKTest", + startTime: { hour: 17, minute: 38 } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backupScheduleGroups.beginCreateOrUpdateAndWait( + deviceName, + scheduleGroupName, + resourceGroupName, + managerName, + scheduleGroup + ); + console.log(result); +} + +backupScheduleGroupsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsDelete.ts new file mode 100644 index 000000000000..dfb3f076555b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsDelete.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup schedule group. + * + * @summary Deletes the backup schedule group. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupScheduleGroupsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const scheduleGroupName = "BackupSchGroupForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backupScheduleGroups.beginDeleteAndWait( + deviceName, + scheduleGroupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupScheduleGroupsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsGet.ts new file mode 100644 index 000000000000..79870db7b8d0 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsGet.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified backup schedule group name. + * + * @summary Returns the properties of the specified backup schedule group name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupScheduleGroupsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const scheduleGroupName = "BackupSchGroupForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backupScheduleGroups.get( + deviceName, + scheduleGroupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupScheduleGroupsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsListByDevice.ts new file mode 100644 index 000000000000..1b27cfe814e1 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupScheduleGroupsListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backup schedule groups in a device. + * + * @summary Retrieves all the backup schedule groups in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupScheduleGroupsListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupScheduleGroupsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backupScheduleGroups.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupScheduleGroupsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsClone.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsClone.ts new file mode 100644 index 000000000000..6e8d446b42fd --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsClone.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clones the given backup element to a new disk or share with given details. + * + * @summary Clones the given backup element to a new disk or share with given details. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsClone.json + */ +import { + CloneRequest, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsClone() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const backupName = "58d33025-e837-41cc-b15f-7c85ced64aab"; + const elementName = "2304968f-91af-4f59-8b79-31e321eee40e"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const cloneRequest: CloneRequest = { + newEndpointName: "ClonedTieredFileShareForSDKTest", + share: { + name: "TieredFileShareForSDKTest", + description: "Restore file Share", + adminUser: "HSDK-4XY4FI2IVGStorSimpleAdmin", + dataPolicy: "Tiered", + monitoringStatus: "Enabled", + provisionedCapacityInBytes: 536870912000, + shareStatus: "Online" + }, + targetAccessPointId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/hsdk-4xy4fi2ivg/fileServers/HSDK-4XY4FI2IVG", + targetDeviceId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/hsdk-4xy4fi2ivg" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backups.beginCloneAndWait( + deviceName, + backupName, + elementName, + resourceGroupName, + managerName, + cloneRequest + ); + console.log(result); +} + +backupsClone().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsDelete.ts new file mode 100644 index 000000000000..a0e5274a2da6 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsDelete.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup. + * + * @summary Deletes the backup. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const backupName = "315c3461-96ad-41bf-af0b-3a8be5113203"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.backups.beginDeleteAndWait( + deviceName, + backupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsListByDevice.ts new file mode 100644 index 000000000000..a7a3660f18c8 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backups in a device. Can be used to get the backups for failover also. + * + * @summary Retrieves all the backups in a device. Can be used to get the backups for failover also. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "initiatedBy eq 'Manual'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsListByManager.ts new file mode 100644 index 000000000000..960b1ce77d5c --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/backupsListByManager.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backups in a manager. + * + * @summary Retrieves all the backups in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/BackupsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "createdTime ge '2018-08-10T17:30:03Z' and createdTime le '2018-08-14T17:30:03Z' and initiatedBy eq 'Manual'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.listByManager( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsCreateOrUpdate.ts new file mode 100644 index 000000000000..a13e65f3ffbf --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsCreateOrUpdate.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the chap setting. + * + * @summary Creates or updates the chap setting. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsCreateOrUpdate.json + */ +import { + ChapSettings, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function chapSettingsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const chapUserName = "ChapSettingForSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const chapSetting: ChapSettings = { + name: "ChapSettingForSDK", + password: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertificateThumbprint: + "D73DB57C4CDD6761E159F8D1E8A7D759424983FD", + value: "" + } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.chapSettingsOperations.beginCreateOrUpdateAndWait( + deviceName, + chapUserName, + resourceGroupName, + managerName, + chapSetting + ); + console.log(result); +} + +chapSettingsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsDelete.ts new file mode 100644 index 000000000000..cbcf0acf5674 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsDelete.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the chap setting. + * + * @summary Deletes the chap setting. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function chapSettingsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const chapUserName = "ChapSettingForSDKForDelete"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.chapSettingsOperations.beginDeleteAndWait( + deviceName, + chapUserName, + resourceGroupName, + managerName + ); + console.log(result); +} + +chapSettingsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsGet.ts new file mode 100644 index 000000000000..a076ceaba575 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsGet.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified chap setting name. + * + * @summary Returns the properties of the specified chap setting name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function chapSettingsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const chapUserName = "ChapSettingForSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.chapSettingsOperations.get( + deviceName, + chapUserName, + resourceGroupName, + managerName + ); + console.log(result); +} + +chapSettingsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsListByDevice.ts new file mode 100644 index 000000000000..247f028b57d5 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/chapSettingsListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the chap settings in a device. + * + * @summary Retrieves all the chap settings in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ChapSettingsListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function chapSettingsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.chapSettingsOperations.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +chapSettingsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesCreateOrUpdateAlertSettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesCreateOrUpdateAlertSettings.ts new file mode 100644 index 000000000000..324a571a3d4a --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesCreateOrUpdateAlertSettings.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the alert settings + * + * @summary Creates or updates the alert settings + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesCreateOrUpdateAlertSettings.json + */ +import { + AlertSettings, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesCreateOrUpdateAlertSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const alertSettings: AlertSettings = { + name: "default", + additionalRecipientEmailList: ["testuser@abc.com"], + alertNotificationCulture: "en-US", + emailNotification: "Enabled", + notificationToServiceOwners: "Disabled" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginCreateOrUpdateAlertSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + alertSettings + ); + console.log(result); +} + +devicesCreateOrUpdateAlertSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesCreateOrUpdateSecuritySettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesCreateOrUpdateSecuritySettings.ts new file mode 100644 index 000000000000..1d7e9c54c0a3 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesCreateOrUpdateSecuritySettings.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the security settings. + * + * @summary Creates or updates the security settings. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesCreateOrUpdateSecuritySettings.json + */ +import { + SecuritySettings, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesCreateOrUpdateSecuritySettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const securitySettings: SecuritySettings = { + deviceAdminPassword: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertificateThumbprint: + "D73DB57C4CDD6761E159F8D1E8A7D759424983FD", + value: "" + } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginCreateOrUpdateSecuritySettingsAndWait( + deviceName, + resourceGroupName, + managerName, + securitySettings + ); + console.log(result); +} + +devicesCreateOrUpdateSecuritySettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDeactivate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDeactivate.ts new file mode 100644 index 000000000000..16882c80637e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDeactivate.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deactivates the device. + * + * @summary Deactivates the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDeactivate.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesDeactivate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "SDK-DELETE"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForDeleteOperation"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginDeactivateAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDeactivate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDelete.ts new file mode 100644 index 000000000000..9b2ac4493d9e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDelete.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the device. + * + * @summary Deletes the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "SDK-DELETE"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForDeleteOperation"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginDeleteAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDownloadUpdates.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDownloadUpdates.ts new file mode 100644 index 000000000000..42d78323bcca --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesDownloadUpdates.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Downloads updates on the device. + * + * @summary Downloads updates on the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesDownloadUpdates.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesDownloadUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginDownloadUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDownloadUpdates().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesFailover.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesFailover.ts new file mode 100644 index 000000000000..a02503ea4aa1 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesFailover.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Fails over the device to another device. + * + * @summary Fails over the device to another device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesFailover.json + */ +import { + FailoverRequest, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesFailover() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const failoverRequest: FailoverRequest = { + accesspointIds: [ + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-0NZI14MDTF/iscsiServers/HSDK-0NZI14MDTF" + ], + keepSourceDevice: true, + skipValidation: true, + targetDeviceId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-UGU4PITWNI" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginFailoverAndWait( + deviceName, + resourceGroupName, + managerName, + failoverRequest + ); + console.log(result); +} + +devicesFailover().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGet.ts new file mode 100644 index 000000000000..457048676f6c --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGet.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified device name. + * + * @summary Returns the properties of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.get( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetAlertSettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetAlertSettings.ts new file mode 100644 index 000000000000..46bf6b76389d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetAlertSettings.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the alert settings of the specified device name. + * + * @summary Returns the alert settings of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetAlertSettings.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGetAlertSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getAlertSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGetAlertSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetNetworkSettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetNetworkSettings.ts new file mode 100644 index 000000000000..9970571428d9 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetNetworkSettings.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the network settings of the specified device name. + * + * @summary Returns the network settings of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetNetworkSettings.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGetNetworkSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getNetworkSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGetNetworkSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetTimeSettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetTimeSettings.ts new file mode 100644 index 000000000000..b44246a597f3 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetTimeSettings.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the time settings of the specified device name. + * + * @summary Returns the time settings of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetTimeSettings.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGetTimeSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-T4ZA3EAJFR"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getTimeSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGetTimeSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetUpdateSummary.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetUpdateSummary.ts new file mode 100644 index 000000000000..4cc8c167a996 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesGetUpdateSummary.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the update summary of the specified device name. + * + * @summary Returns the update summary of the specified device name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesGetUpdateSummary.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGetUpdateSummary() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HBVT-02X525X2W0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.getUpdateSummary( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGetUpdateSummary().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesInstallUpdates.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesInstallUpdates.ts new file mode 100644 index 000000000000..39b6049cd781 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesInstallUpdates.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Installs the updates on the device. + * + * @summary Installs the updates on the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesInstallUpdates.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesInstallUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginInstallUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesInstallUpdates().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListByManager.ts new file mode 100644 index 000000000000..8fb6d2951a8b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the devices in a manager. + * + * @summary Retrieves all the devices in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListFailoverTarget.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListFailoverTarget.ts new file mode 100644 index 000000000000..06befe7b6933 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListFailoverTarget.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the devices which can be used as failover targets for the given device. + * + * @summary Retrieves all the devices which can be used as failover targets for the given device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListFailoverTarget.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListFailoverTarget() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listFailoverTarget( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListFailoverTarget().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListMetricDefinition.ts new file mode 100644 index 000000000000..2519d724bd77 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListMetricDefinition.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definition of all metrics aggregated at device. + * + * @summary Retrieves metric definition of all metrics aggregated at device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listMetricDefinition( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListMetrics.ts new file mode 100644 index 000000000000..1fbcfe8f703f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesListMetrics.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves the device metrics. + * + * @summary Retrieves the device metrics. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listMetrics( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesPatch.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesPatch.ts new file mode 100644 index 000000000000..4d23d81e818d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesPatch.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Patches the device. + * + * @summary Patches the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesPatch.json + */ +import { + DevicePatch, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesPatch() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const devicePatch: DevicePatch = { + deviceDescription: "NewDescription8/14/2018 2:30:34 PM" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginPatchAndWait( + deviceName, + resourceGroupName, + managerName, + devicePatch + ); + console.log(result); +} + +devicesPatch().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesScanForUpdates.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesScanForUpdates.ts new file mode 100644 index 000000000000..0c71aba0683f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/devicesScanForUpdates.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Scans for updates on the device. + * + * @summary Scans for updates on the device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/DevicesScanForUpdates.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesScanForUpdates() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HBVT-02X525X2W0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest4"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.devices.beginScanForUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesScanForUpdates().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersBackupNow.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersBackupNow.ts new file mode 100644 index 000000000000..3abec42d3d72 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersBackupNow.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Backup the file server now. + * + * @summary Backup the file server now. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersBackupNow.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersBackupNow() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.beginBackupNowAndWait( + deviceName, + fileServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileServersBackupNow().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersCreateOrUpdate.ts new file mode 100644 index 000000000000..10a3ec745cac --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersCreateOrUpdate.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the file server. + * + * @summary Creates or updates the file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersCreateOrUpdate.json + */ +import { + FileServer, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const fileServer: FileServer = { + name: "HSDK-4XY4FI2IVG", + description: "Demo FileServer for SDK Test", + backupScheduleGroupId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/hsdk-4xy4fi2ivg/backupScheduleGroups/BackupSchGroupForSDKTest", + domainName: "fareast.corp.microsoft.com", + storageDomainId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/storageDomains/sd-fs-HSDK-4XY4FI2IVG" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.beginCreateOrUpdateAndWait( + deviceName, + fileServerName, + resourceGroupName, + managerName, + fileServer + ); + console.log(result); +} + +fileServersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersDelete.ts new file mode 100644 index 000000000000..6b3b4cc0cb57 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersDelete.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the file server. + * + * @summary Deletes the file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.beginDeleteAndWait( + deviceName, + fileServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileServersDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersGet.ts new file mode 100644 index 000000000000..1c74babe7814 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersGet.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified file server name. + * + * @summary Returns the properties of the specified file server name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileServers.get( + deviceName, + fileServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileServersGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListByDevice.ts new file mode 100644 index 000000000000..2ee06d1febb3 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file servers in a device. + * + * @summary Retrieves all the file servers in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListByManager.ts new file mode 100644 index 000000000000..64c80b2b6542 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file servers in a manager. + * + * @summary Retrieves all the file servers in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListMetricDefinition.ts new file mode 100644 index 000000000000..1bdd6dc7c068 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListMetricDefinition.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions of all metrics aggregated at the file server. + * + * @summary Retrieves metric definitions of all metrics aggregated at the file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listMetricDefinition( + deviceName, + fileServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListMetrics.ts new file mode 100644 index 000000000000..84e461df1004 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileServersListMetrics.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the file server metrics. + * + * @summary Gets the file server metrics. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileServersListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileServersListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileServers.listMetrics( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileServersListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesCreateOrUpdate.ts new file mode 100644 index 000000000000..26d37cccd20d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesCreateOrUpdate.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the file share. + * + * @summary Creates or updates the file share. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesCreateOrUpdate.json + */ +import { + FileShare, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const shareName = "Auto-TestFileShare1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const fileShare: FileShare = { + name: "Auto-TestFileShare1", + description: "Demo FileShare for SDK Test Tiered", + adminUser: "fareastidcdlslb", + dataPolicy: "Tiered", + monitoringStatus: "Enabled", + provisionedCapacityInBytes: 536870912000, + shareStatus: "Online" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileShares.beginCreateOrUpdateAndWait( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + fileShare + ); + console.log(result); +} + +fileSharesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesDelete.ts new file mode 100644 index 000000000000..14502b8c3b4e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesDelete.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the file share. + * + * @summary Deletes the file share. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const shareName = "Auto-TestFileShare2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileShares.beginDeleteAndWait( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileSharesDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesGet.ts new file mode 100644 index 000000000000..57967b479ad9 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesGet.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified file share name. + * + * @summary Returns the properties of the specified file share name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const fileServerName = "HSDK-4XY4FI2IVG"; + const shareName = "Auto-TestFileShare1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.fileShares.get( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName + ); + console.log(result); +} + +fileSharesGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListByDevice.ts new file mode 100644 index 000000000000..ff44d904f698 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file shares in a device. + * + * @summary Retrieves all the file shares in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListByFileServer.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListByFileServer.ts new file mode 100644 index 000000000000..4894f278f690 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListByFileServer.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the file shares in a file server. + * + * @summary Retrieves all the file shares in a file server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListByFileServer.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesListByFileServer() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const fileServerName = "HSDK-ARCSX4MVKZ"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listByFileServer( + deviceName, + fileServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListByFileServer().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListMetricDefinition.ts new file mode 100644 index 000000000000..f4baef7da534 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListMetricDefinition.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions of all metrics aggregated at the file share. + * + * @summary Retrieves metric definitions of all metrics aggregated at the file share. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const shareName = "Auto-TestFileShare2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listMetricDefinition( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListMetrics.ts new file mode 100644 index 000000000000..40fc7b9567eb --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/fileSharesListMetrics.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the file share metrics + * + * @summary Gets the file share metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/FileSharesListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function fileSharesListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-DMNJB2PET0"; + const fileServerName = "HSDK-DMNJB2PET0"; + const shareName = "Auto-TestFileShare2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.fileShares.listMetrics( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +fileSharesListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksCreateOrUpdate.ts new file mode 100644 index 000000000000..cec2a3923f63 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksCreateOrUpdate.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the iSCSI disk. + * + * @summary Creates or updates the iSCSI disk. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksCreateOrUpdate.json + */ +import { + IscsiDisk, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const diskName = "Auto-TestIscsiDisk1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const iscsiDisk: IscsiDisk = { + name: "Auto-TestIscsiDisk1", + description: "Demo IscsiDisk for SDK Test Tiered", + accessControlRecords: [], + dataPolicy: "Tiered", + diskStatus: "Online", + monitoringStatus: "Enabled", + provisionedCapacityInBytes: 536870912000 + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiDisks.beginCreateOrUpdateAndWait( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + iscsiDisk + ); + console.log(result); +} + +iscsiDisksCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksDelete.ts new file mode 100644 index 000000000000..d3826bc2d0bc --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksDelete.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the iSCSI disk. + * + * @summary Deletes the iSCSI disk. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const diskName = "ClonedTieredIscsiDiskForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiDisks.beginDeleteAndWait( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiDisksDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksGet.ts new file mode 100644 index 000000000000..11a539c5f87d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksGet.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified iSCSI disk name. + * + * @summary Returns the properties of the specified iSCSI disk name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const diskName = "Auto-TestIscsiDisk1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiDisks.get( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiDisksGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListByDevice.ts new file mode 100644 index 000000000000..3cf181b35888 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the iSCSI disks in a device. + * + * @summary Retrieves all the iSCSI disks in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListByIscsiServer.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListByIscsiServer.ts new file mode 100644 index 000000000000..ad1042a0b739 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListByIscsiServer.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the disks in a iSCSI server. + * + * @summary Retrieves all the disks in a iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListByIscsiServer.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksListByIscsiServer() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listByIscsiServer( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListByIscsiServer().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListMetricDefinition.ts new file mode 100644 index 000000000000..d2db4add42e7 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListMetricDefinition.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions for all metric aggregated at the iSCSI disk. + * + * @summary Retrieves metric definitions for all metric aggregated at the iSCSI disk. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const diskName = "TieredIscsiDiskForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listMetricDefinition( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListMetrics.ts new file mode 100644 index 000000000000..839d31fa3e8e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiDisksListMetrics.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the iSCSI disk metrics + * + * @summary Gets the iSCSI disk metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiDisksListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiDisksListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const diskName = "TieredIscsiDiskForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiDisks.listMetrics( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiDisksListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersBackupNow.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersBackupNow.ts new file mode 100644 index 000000000000..e2ce4f313618 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersBackupNow.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Backup the iSCSI server now. + * + * @summary Backup the iSCSI server now. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersBackupNow.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersBackupNow() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-0NZI14MDTF"; + const iscsiServerName = "HSDK-0NZI14MDTF"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.beginBackupNowAndWait( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiServersBackupNow().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersCreateOrUpdate.ts new file mode 100644 index 000000000000..eb4b5b047811 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersCreateOrUpdate.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the iSCSI server. + * + * @summary Creates or updates the iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersCreateOrUpdate.json + */ +import { + IscsiServer, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const iscsiServer: IscsiServer = { + name: "HSDK-WSJQERQW3F", + type: "Microsoft.StorSimple/managers/devices/iscsiServers", + backupScheduleGroupId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-WSJQERQW3F/backupScheduleGroups/Default-HSDK-WSJQERQW3F-BackupScheduleGroup", + chapId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-WSJQERQW3F/chapSettings/ChapSettingForSDK", + id: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/devices/HSDK-WSJQERQW3F/iscsiServers/HSDK-WSJQERQW3F", + reverseChapId: "", + storageDomainId: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/storageDomains/Default-HSDK-WSJQERQW3F-StorageDomain" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.beginCreateOrUpdateAndWait( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + iscsiServer + ); + console.log(result); +} + +iscsiServersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersDelete.ts new file mode 100644 index 000000000000..9da36dc4cb58 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersDelete.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the iSCSI server. + * + * @summary Deletes the iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.beginDeleteAndWait( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiServersDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersGet.ts new file mode 100644 index 000000000000..6b2c54f0a100 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersGet.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified iSCSI server name. + * + * @summary Returns the properties of the specified iSCSI server name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-WSJQERQW3F"; + const iscsiServerName = "HSDK-WSJQERQW3F"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.iscsiServers.get( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +iscsiServersGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListByDevice.ts new file mode 100644 index 000000000000..196bfc7fc4c8 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListByDevice.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the iSCSI in a device. + * + * @summary Retrieves all the iSCSI in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListByManager.ts new file mode 100644 index 000000000000..6f4f9044619f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the iSCSI servers in a manager. + * + * @summary Retrieves all the iSCSI servers in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListMetricDefinition.ts new file mode 100644 index 000000000000..6e08d7004d6d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListMetricDefinition.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definitions for all metrics aggregated at iSCSI server. + * + * @summary Retrieves metric definitions for all metrics aggregated at iSCSI server. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listMetricDefinition( + deviceName, + iscsiServerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListMetrics.ts new file mode 100644 index 000000000000..6ae9e71fc05d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/iscsiServersListMetrics.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the iSCSI server metrics + * + * @summary Gets the iSCSI server metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/IscsiServersListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function iscsiServersListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-UGU4PITWNI"; + const iscsiServerName = "HSDK-UGU4PITWNI"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-10T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.iscsiServers.listMetrics( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +iscsiServersListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsGet.ts new file mode 100644 index 000000000000..b1d83983112d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsGet.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified job name. + * + * @summary Returns the properties of the specified job name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const jobName = "06c7ee19-35a2-4248-bf1b-408009b31b63"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.jobs.get( + deviceName, + jobName, + resourceGroupName, + managerName + ); + console.log(result); +} + +jobsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsListByDevice.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsListByDevice.ts new file mode 100644 index 000000000000..94fa931a6215 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the jobs in a device. + * + * @summary Retrieves all the jobs in a device. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsListByDevice.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsListByDevice() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const deviceName = "HSDK-ARCSX4MVKZ"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "jobType eq 'Backup'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.jobs.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByDevice().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsListByManager.ts new file mode 100644 index 000000000000..e2d8c7b21b5a --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/jobsListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the jobs in a manager. + * + * @summary Retrieves all the jobs in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/JobsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = "jobType eq 'Backup'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.jobs.listByManager( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersCreateExtendedInfo.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersCreateExtendedInfo.ts new file mode 100644 index 000000000000..8f82f6702d3f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersCreateExtendedInfo.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates the extended info of the manager. + * + * @summary Creates the extended info of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersCreateExtendedInfo.json + */ +import { + ManagerExtendedInfo, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersCreateExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const managerExtendedInfo: ManagerExtendedInfo = { + name: "vaultExtendedInfo", + type: "Microsoft.StorSimple/Managers/extendedInformation", + algorithm: "SHA256", + etag: "6531d5d7-3ced-4f78-83b6-804368f2ca0c", + id: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/Managers/hManagerForSDKTestextendedInformation/vaultExtendedInfo", + integrityKey: "e6501980-7efe-4602-bb0e-3cb9a08a6003" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.createExtendedInfo( + resourceGroupName, + managerName, + managerExtendedInfo + ); + console.log(result); +} + +managersCreateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersCreateOrUpdate.ts new file mode 100644 index 000000000000..9b9caee7503e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersCreateOrUpdate.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the manager. + * + * @summary Creates or updates the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersCreateOrUpdate.json + */ +import { + Manager, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const manager: Manager = { + name: "hManagerForSDKTest", + cisIntrinsicSettings: { type: "HelsinkiV1" }, + location: "westus", + sku: { name: "Standard" } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.createOrUpdate( + resourceGroupName, + managerName, + manager + ); + console.log(result); +} + +managersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersDelete.ts new file mode 100644 index 000000000000..6b35c38939b1 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersDelete.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the manager. + * + * @summary Deletes the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.delete(resourceGroupName, managerName); + console.log(result); +} + +managersDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersDeleteExtendedInfo.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersDeleteExtendedInfo.ts new file mode 100644 index 000000000000..85f7aac67f14 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersDeleteExtendedInfo.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the extended info of the manager. + * + * @summary Deletes the extended info of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersDeleteExtendedInfo.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersDeleteExtendedInfo() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.deleteExtendedInfo( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersDeleteExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGet.ts new file mode 100644 index 000000000000..52f1776baaa9 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGet.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified manager name. + * + * @summary Returns the properties of the specified manager name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.get(resourceGroupName, managerName); + console.log(result); +} + +managersGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetEncryptionKey.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetEncryptionKey.ts new file mode 100644 index 000000000000..58d26380f5b8 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetEncryptionKey.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the symmetric encryption key of the manager. + * + * @summary Returns the symmetric encryption key of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetEncryptionKey.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetEncryptionKey() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.getEncryptionKey( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetEncryptionKey().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetEncryptionSettings.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetEncryptionSettings.ts new file mode 100644 index 000000000000..1cdf630be1e4 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetEncryptionSettings.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the encryption settings of the manager. + * + * @summary Returns the encryption settings of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetEncryptionSettings.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetEncryptionSettings() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.getEncryptionSettings( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetEncryptionSettings().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetExtendedInfo.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetExtendedInfo.ts new file mode 100644 index 000000000000..04b7457efb93 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersGetExtendedInfo.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the extended information of the specified manager name. + * + * @summary Returns the extended information of the specified manager name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersGetExtendedInfo.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetExtendedInfo() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.getExtendedInfo( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersList.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersList.ts new file mode 100644 index 000000000000..5f76b075763d --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersList.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a subscription. + * + * @summary Retrieves all the managers in a subscription. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersList.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersList() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +managersList().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListByResourceGroup.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListByResourceGroup.ts new file mode 100644 index 000000000000..7ab5e31759ba --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListByResourceGroup.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a resource group. + * + * @summary Retrieves all the managers in a resource group. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListByResourceGroup.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListByResourceGroup() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListByResourceGroup().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListMetricDefinition.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListMetricDefinition.ts new file mode 100644 index 000000000000..0501a6aa56f2 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListMetricDefinition.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves metric definition of all metrics aggregated at manager. + * + * @summary Retrieves metric definition of all metrics aggregated at manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListMetricDefinition.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListMetricDefinition() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listMetricDefinition( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListMetrics.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListMetrics.ts new file mode 100644 index 000000000000..898231c71614 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersListMetrics.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the manager metrics + * + * @summary Gets the manager metrics + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersListMetrics.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListMetrics() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const filter = + "startTime ge '2018-08-04T18:30:00Z' and endTime le '2018-08-11T18:30:00Z'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listMetrics( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetrics().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUpdate.ts new file mode 100644 index 000000000000..54c2fb9814b0 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUpdate.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the StorSimple Manager. + * + * @summary Updates the StorSimple Manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUpdate.json + */ +import { + ManagerPatch, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters: ManagerPatch = { tags: { tagName: "ForSDKTest" } }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.update( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +managersUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUpdateExtendedInfo.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUpdateExtendedInfo.ts new file mode 100644 index 000000000000..81aaa9cf071f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUpdateExtendedInfo.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the extended info of the manager. + * + * @summary Updates the extended info of the manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUpdateExtendedInfo.json + */ +import { + ManagerExtendedInfo, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersUpdateExtendedInfo() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hManagerForSDKTest"; + const ifMatch = "6531d5d7-3ced-4f78-83b6-804368f2ca0c"; + const managerExtendedInfo: ManagerExtendedInfo = { + name: "vaultExtendedInfo", + type: "Microsoft.StorSimple/Managers/extendedInformation", + algorithm: "SHA256", + etag: "6531d5d7-3ced-4f78-83b6-804368f2ca0c", + id: + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/Managers/hManagerForSDKTestextendedInformation/vaultExtendedInfo", + integrityKey: "e6501980-7efe-4602-bb0e-3cb9a08a6003" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.updateExtendedInfo( + resourceGroupName, + managerName, + ifMatch, + managerExtendedInfo + ); + console.log(result); +} + +managersUpdateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUploadRegistrationCertificate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUploadRegistrationCertificate.ts new file mode 100644 index 000000000000..f8934d768ef1 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/managersUploadRegistrationCertificate.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Upload Vault Cred Certificate. +Returns UploadCertificateResponse + * + * @summary Upload Vault Cred Certificate. +Returns UploadCertificateResponse + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/ManagersUploadRegistrationCertificate.json + */ +import { + UploadCertificateRequest, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersUploadRegistrationCertificate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const certificateName = "windows"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const uploadCertificateRequestrequest: UploadCertificateRequest = { + authType: "AzureActiveDirectory", + certificate: + "MIIC3TCCAcWgAwIBAgIQEr0bAWD6wJtA4LIbZ9NtgzANBgkqhkiG9w0BAQUFADAeMRwwGgYDVQQDExNXaW5kb3dzIEF6dXJlIFRvb2xzMB4XDTE4MDkxMDE1MzY0MFoXDTE4MDkxMzE1NDY0MFowHjEcMBoGA1UEAxMTV2luZG93cyBBenVyZSBUb29sczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANUsKkz2Z4fECKMyNeLb9v3pr1XF4dVe+MITDtgphjl81ng190Y0IHgCVnh4YjfplUSpMk/1xii0rI5AAPwoz3ze2qRPtnwCiTaoVLkUe6knNRPzrRvVXHB81J0/14MO0lwdByHhdccRcVJZPLt5724t4aQny82v2AayJdDDkBBWNlpcqPy6n3sygP00THMPP0O3sFqy924eHqoDj3qSw79/meaZBJt9S5odPuFoskxjHuI4lM6BmK1Ql7p8Wo9/GhTOIoMz81orKPHRDleLjutwL4mb6NnhI5rfT/MxnHD6m82c4YYqiZC3XiTyJWVCkWkp7PK92OdRp6FA87rdKDMCAwEAAaMXMBUwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADggEBAIYlezVU68TuEblkn06vM5dfzSmHKJOQgW61nDlLnyKrmSJtzKZLCAswTE2VyJHwKNdZgW15coJFINjWBLWcLr0/GjNV4u3Z+UL3NhBFQd5xuMtKsIhuoscKtyk0JHQXpBvHNmOUCobfQfOBQfTVC7kmyWdtlGztFUVxD28s6S5gMb1FEWWN68NOOJ3/ZhaTbUEM54yw8Hk8/f0L/Zn/7BYHUyWWA3KStAaYn89C/ZFF+952ark2VaKGIjBRQzgrJEIR8dI4r46I3DoEfzGPESKvQPvVLhOX84RG0PLPOtnRbHBVew1Nh3HE9kgCubkPKK+NPWE9IHZPoRmOTWBe+zU=", + contractVersion: "V2012_12" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.managers.uploadRegistrationCertificate( + certificateName, + resourceGroupName, + managerName, + uploadCertificateRequestrequest + ); + console.log(result); +} + +managersUploadRegistrationCertificate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/operationsList.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/operationsList.ts new file mode 100644 index 000000000000..4420c4bc4afa --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/operationsList.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to List of AvailableProviderOperations + * + * @summary List of AvailableProviderOperations + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/OperationsList.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availableProviderOperationsOperations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsCreateOrUpdate.ts new file mode 100644 index 000000000000..9c250aceb1b4 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsCreateOrUpdate.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the storage account credential + * + * @summary Creates or updates the storage account credential + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsCreateOrUpdate.json + */ +import { + StorageAccountCredential, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credentialName = "DummySacForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const storageAccount: StorageAccountCredential = { + name: "DummySacForSDKTest", + accessKey: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertificateThumbprint: + "D73DB57C4CDD6761E159F8D1E8A7D759424983FD", + value: + "Ev1tm0QBmpGGm4a58GkqLqx8veJEEgQtg5K3Jizpmy7JdSv9dlcRwk59THw6KIdMDlEHcS8mPyneBtOEQsh4wkcFB7qrmQz+KsRAyIhEm6bwPEm3qN8+aDDzNcXn/6vu/sqV0AP7zit9/s7SxXGxjKrz4zKnOy16/DbzRRmUHNO+HO6JUM0cUfHXTX0mEecbsXqBq0A8IEG8z+bJgXX1EhoGkzE6yVsObm4S1AcKrLiwWjqmSLji5Q8gGO+y4KTTmC3p45h5GHHXjJyOccHhySWDAffxnTzUD/sOoh+aD2VkAYrL3DdnkVzhAdfcZfVI4soONx7tYMloZIVsfW1M2Q==" + }, + cloudType: "Azure", + enableSSL: "Enabled", + endPoint: "blob.core.windows.net", + location: "West US", + login: "SacForSDKTest" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.beginCreateOrUpdateAndWait( + credentialName, + resourceGroupName, + managerName, + storageAccount + ); + console.log(result); +} + +storageAccountCredentialsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsDelete.ts new file mode 100644 index 000000000000..166fe83f1d12 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsDelete.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the storage account credential + * + * @summary Deletes the storage account credential + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credentialName = "DummySacForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.beginDeleteAndWait( + credentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsGet.ts new file mode 100644 index 000000000000..769e5b493e3f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsGet.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified storage account credential name. + * + * @summary Returns the properties of the specified storage account credential name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const credentialName = "SacForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.get( + credentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsListByManager.ts new file mode 100644 index 000000000000..ffa808d0f60e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageAccountCredentialsListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the storage account credentials in a manager. + * + * @summary Retrieves all the storage account credentials in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageAccountCredentials.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +storageAccountCredentialsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsCreateOrUpdate.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsCreateOrUpdate.ts new file mode 100644 index 000000000000..d293a57d4799 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsCreateOrUpdate.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the storage domain. + * + * @summary Creates or updates the storage domain. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsCreateOrUpdate.json + */ +import { + StorageDomain, + StorSimpleManagementClient +} from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageDomainsCreateOrUpdate() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const storageDomainName = "sd-fs-HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const storageDomain: StorageDomain = { + name: "sd-fs-HSDK-4XY4FI2IVG", + encryptionStatus: "Disabled", + storageAccountCredentialIds: [ + "/subscriptions/9eb689cd-7243-43b4-b6f6-5c65cb296641/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/hAzureSDKOperations/storageAccountCredentials/sacforsdktest" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageDomains.beginCreateOrUpdateAndWait( + storageDomainName, + resourceGroupName, + managerName, + storageDomain + ); + console.log(result); +} + +storageDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsDelete.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsDelete.ts new file mode 100644 index 000000000000..da353a2c16c7 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsDelete.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the storage domain. + * + * @summary Deletes the storage domain. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsDelete.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageDomainsDelete() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const storageDomainName = "sd-fs-HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageDomains.beginDeleteAndWait( + storageDomainName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageDomainsDelete().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsGet.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsGet.ts new file mode 100644 index 000000000000..fc1821aedf56 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsGet.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified storage domain name. + * + * @summary Returns the properties of the specified storage domain name. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsGet.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageDomainsGet() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const storageDomainName = "sd-fs-HSDK-4XY4FI2IVG"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const result = await client.storageDomains.get( + storageDomainName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageDomainsGet().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsListByManager.ts b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsListByManager.ts new file mode 100644 index 000000000000..a08aaa5a83da --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/src/storageDomainsListByManager.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the storage domains in a manager. + * + * @summary Retrieves all the storage domains in a manager. + * x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageDomainsListByManager.json + */ +import { StorSimpleManagementClient } from "@azure/arm-storsimple1200series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageDomainsListByManager() { + const subscriptionId = "9eb689cd-7243-43b4-b6f6-5c65cb296641"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "hAzureSDKOperations"; + const credential = new DefaultAzureCredential(); + const client = new StorSimpleManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageDomains.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +storageDomainsListByManager().catch(console.error); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/tsconfig.json b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/samples/v2/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/index.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/index.ts new file mode 100644 index 000000000000..e5832726091f --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { StorSimpleManagementClient } from "./storSimpleManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/lroImpl.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/accessControlRecordsMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/accessControlRecordsMappers.ts deleted file mode 100644 index d694660e757f..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/accessControlRecordsMappers.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - AccessControlRecordList, - AccessControlRecord, - BaseModel, - ErrorModel, - Message, - Item, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - ChapSettings, - AsymmetricEncryptedSecret, - FileShare, - ISCSIDisk, - Device, - DeviceDetails, - EncryptionSettings, - FileServer, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - StorageDomain, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/alertsMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/alertsMappers.ts deleted file mode 100644 index 33b6f24ba311..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/alertsMappers.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - AlertList, - Alert, - BaseModel, - AlertSource, - AlertErrorDetails, - ErrorModel, - Message, - Item, - ClearAlertRequest, - SendTestAlertEmailRequest, - AccessControlRecord, - AlertSettings, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - ChapSettings, - AsymmetricEncryptedSecret, - FileShare, - ISCSIDisk, - Device, - DeviceDetails, - EncryptionSettings, - FileServer, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - StorageDomain, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/availableProviderOperationsOperationsMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/availableProviderOperationsOperationsMappers.ts deleted file mode 100644 index e02a6f7b8b7f..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/availableProviderOperationsOperationsMappers.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - AvailableProviderOperations, - AvailableProviderOperation, - AvailableProviderOperationDisplay, - ErrorModel, - Message, - Item -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/backupScheduleGroupsMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/backupScheduleGroupsMappers.ts deleted file mode 100644 index 92a814a869d2..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/backupScheduleGroupsMappers.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - BackupScheduleGroupList, - BackupScheduleGroup, - BaseModel, - Time, - ErrorModel, - Message, - Item, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupElement, - Backup, - ChapSettings, - AsymmetricEncryptedSecret, - FileShare, - ISCSIDisk, - Device, - DeviceDetails, - EncryptionSettings, - FileServer, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - StorageDomain, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/backupsMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/backupsMappers.ts deleted file mode 100644 index a2c7ad259bcc..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/backupsMappers.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - BackupList, - Backup, - BaseModel, - BackupElement, - ErrorModel, - Message, - Item, - CloneRequest, - FileShare, - ISCSIDisk, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupScheduleGroup, - Time, - ChapSettings, - AsymmetricEncryptedSecret, - Device, - DeviceDetails, - EncryptionSettings, - FileServer, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - StorageDomain, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/chapSettingsOperationsMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/chapSettingsOperationsMappers.ts deleted file mode 100644 index f05a1cc6fccb..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/chapSettingsOperationsMappers.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - ChapSettingsList, - ChapSettings, - BaseModel, - AsymmetricEncryptedSecret, - ErrorModel, - Message, - Item, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - FileShare, - ISCSIDisk, - Device, - DeviceDetails, - EncryptionSettings, - FileServer, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - StorageDomain, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/devicesMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/devicesMappers.ts deleted file mode 100644 index f40e2b84cf90..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/devicesMappers.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - DeviceList, - Device, - BaseModel, - DeviceDetails, - ErrorModel, - Message, - Item, - DevicePatch, - AlertSettings, - FailoverRequest, - MetricList, - Metrics, - MetricName, - MetricDimension, - MetricData, - MetricDefinitionList, - MetricDefinition, - MetricAvailablity, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - AsymmetricEncryptedSecret, - TimeSettings, - Updates, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - ChapSettings, - FileShare, - ISCSIDisk, - EncryptionSettings, - FileServer, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - StorageAccountCredential, - StorageDomain, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/fileServersMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/fileServersMappers.ts deleted file mode 100644 index 042a85573f46..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/fileServersMappers.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - FileServerList, - FileServer, - BaseModel, - ErrorModel, - Message, - Item, - MetricList, - Metrics, - MetricName, - MetricDimension, - MetricData, - MetricDefinitionList, - MetricDefinition, - MetricAvailablity, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - ChapSettings, - AsymmetricEncryptedSecret, - FileShare, - ISCSIDisk, - Device, - DeviceDetails, - EncryptionSettings, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - StorageDomain, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/fileSharesMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/fileSharesMappers.ts deleted file mode 100644 index af425e83d14f..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/fileSharesMappers.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - FileShareList, - FileShare, - BaseModel, - ErrorModel, - Message, - Item, - MetricList, - Metrics, - MetricName, - MetricDimension, - MetricData, - MetricDefinitionList, - MetricDefinition, - MetricAvailablity, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - ChapSettings, - AsymmetricEncryptedSecret, - ISCSIDisk, - Device, - DeviceDetails, - EncryptionSettings, - FileServer, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - StorageDomain, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/index.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/index.ts index a0b83d1b2fba..ce51325af7d4 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/index.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/models/index.ts @@ -1,4323 +1,2020 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +/** List of StorSimple Managers under a particular resourceGroup */ +export interface ManagerList { + /** List of Managers */ + value: Manager[]; +} +/** Intrinsic settings which refers to the type of the StorSimple manager */ +export interface ManagerIntrinsicSettings { + /** Refers to the type of the StorSimple Manager */ + type: ManagerType; +} -/** - * @interface - * An interface representing BaseModel. - * Base class for models - * - */ -export interface BaseModel { +/** The Sku. */ +export interface ManagerSku { + /** Refers to the sku name which should be "Standard" */ + name: "Standard"; +} + +/** The Azure Resource. */ +export interface Resource { /** - * @member {string} [id] The identifier. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The Resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * @member {string} [name] The name. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The Resource Name + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * @member {string} [type] The type. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The Resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; + /** The Geo location of the Manager */ + location: string; + /** Tags attached to the Manager */ + tags?: { [propertyName: string]: string }; } -/** - * @interface - * An interface representing AccessControlRecord. - * The access control record - * - * @extends BaseModel - */ -export interface AccessControlRecord extends BaseModel { - /** - * @member {string} initiatorName The Iscsi initiator name (IQN) - */ - initiatorName: string; -} - -/** - * @interface - * An interface representing AlertSource. - * source at which the alert can be raised - * - */ -export interface AlertSource { - /** - * @member {string} [name] Name of the source. - */ - name?: string; - /** - * @member {string} [timeZone] The time zone. - */ - timeZone?: string; - /** - * @member {AlertSourceType} [alertSourceType] Source type of the alert. - * Possible values include: 'Resource', 'Device' - */ - alertSourceType?: AlertSourceType; +export interface ErrorModel { + errorCode: string; + message: Message; + values?: Item[]; } -/** - * @interface - * An interface representing AlertErrorDetails. - * Errordetails for the alert - * - */ -export interface AlertErrorDetails { - /** - * @member {string} [errorCode] Error code. - */ - errorCode?: string; - /** - * @member {string} [errorMessage] Error Message - */ - errorMessage?: string; - /** - * @member {number} [occurences] Number of occurences. - */ - occurences?: number; +export interface Message { + language?: string; + value?: string; } -/** - * @interface - * An interface representing Alert. - * Alert class - * - * @extends BaseModel - */ -export interface Alert extends BaseModel { - /** - * @member {string} title Title of the alert - */ - title: string; - /** - * @member {AlertScope} scope Device or Resource alert. Possible values - * include: 'Resource', 'Device' - */ - scope: AlertScope; - /** - * @member {string} alertType Type of the alert - */ - alertType: string; - /** - * @member {Date} appearedAtTime UTC time at which the alert appeared - */ - appearedAtTime: Date; - /** - * @member {Date} appearedAtSourceTime UTC time at which the alert appeared - * on the source - */ - appearedAtSourceTime: Date; - /** - * @member {Date} [clearedAtTime] UTC time at which the alert got cleared - */ - clearedAtTime?: Date; - /** - * @member {Date} [clearedAtSourceTime] UTC time at which the alert was - * cleared on the source - */ - clearedAtSourceTime?: Date; - /** - * @member {AlertSource} source Source at which the alert was cleared - */ - source: AlertSource; - /** - * @member {string} [recommendation] Recommendation for acting on the alert - */ - recommendation?: string; - /** - * @member {string} [resolutionReason] Reason for resolving the alert - */ - resolutionReason?: string; - /** - * @member {AlertSeverity} severity Severity of the alert. Possible values - * include: 'Informational', 'Warning', 'Critical' - */ - severity: AlertSeverity; - /** - * @member {AlertStatus} status Current status of the alert. Possible values - * include: 'Active', 'Cleared' - */ - status: AlertStatus; - /** - * @member {AlertErrorDetails} [errorDetails] ErrorDetails of the alert - */ - errorDetails?: AlertErrorDetails; - /** - * @member {{ [propertyName: string]: string }} [detailedInformation] Other - * information about the alert - */ - detailedInformation?: { [propertyName: string]: string }; +export interface Item { + key: string; + value: string; } -/** - * @interface - * An interface representing AlertFilter. - * Filters that can be specified on the alert - * - */ -export interface AlertFilter { - /** - * @member {AlertStatus} [status] Status of the alert. Possible values - * include: 'Active', 'Cleared' - */ - status?: AlertStatus; - /** - * @member {AlertSeverity} [severity] Severity of the alert. Possible values - * include: 'Informational', 'Warning', 'Critical' - */ - severity?: AlertSeverity; - /** - * @member {AlertSourceType} [sourceType] Source of the alert. Possible - * values include: 'Resource', 'Device' - */ - sourceType?: AlertSourceType; - /** - * @member {string} [sourceName] Source name of the alert - */ - sourceName?: string; - /** - * @member {Date} [appearedOnTime] UTC time on which the alert appeared - */ - appearedOnTime?: Date; +/** Class for set of operations used for discovery of available provider operations. */ +export interface AvailableProviderOperations { + /** The value. */ + value: AvailableProviderOperation[]; + /** The NextLink. */ + nextLink?: string; } -/** - * @interface - * An interface representing AlertSettings. - * AlertSettings on the device which represents how alerts will be processed - * - * @extends BaseModel - */ -export interface AlertSettings extends BaseModel { - /** - * @member {AlertEmailNotificationStatus} emailNotification Value indicating - * whether user/admins will receive emails when an alert condition occurs on - * the system. Possible values include: 'Enabled', 'Disabled' - */ - emailNotification: AlertEmailNotificationStatus; - /** - * @member {ServiceOwnersAlertNotificationStatus} notificationToServiceOwners - * Value indicating whether service owners will receive emails when an alert - * condition occurs on the system. Applicable only if emailNotification flag - * is Enabled. Possible values include: 'Enabled', 'Disabled' - */ - notificationToServiceOwners: ServiceOwnersAlertNotificationStatus; - /** - * @member {string} alertNotificationCulture Culture setting to be used while - * building alert emails. For eg: "en-US" - */ - alertNotificationCulture: string; +/** Class represents provider operation */ +export interface AvailableProviderOperation { /** - * @member {string[]} [additionalRecipientEmailList] List of email addresses - * (apart from admin/coadmin of subscription) to whom the alert emails need - * to be sent + * Gets or sets the name of the operation being performed on this particular object + * Return value format: "{resourceProviderNamespace}/{resourceType}/{read|write|deletion|action}" + * Eg: Microsoft.StorSimple/managers/devices/fileServers/read + * Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action */ - additionalRecipientEmailList?: string[]; -} - -/** - * @interface - * An interface representing AsymmetricEncryptedSecret. - * This class can be used as the Type for any secret entity represented as - * Password, CertThumbprint, Algorithm. This class is intended to be used when - * the secret is encrypted with an asymmetric key pair. The encryptionAlgorithm - * field is mainly for future usage to potentially allow different entities - * encrypted using different algorithms. - * - */ -export interface AsymmetricEncryptedSecret { + name?: string; /** - * @member {string} value The value of the secret itself. If the secret is in - * plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. + * Gets or sets Display information + * Contains the localized display information for this particular operation/action */ - value: string; + display?: AvailableProviderOperationDisplay; /** - * @member {string} [encryptionCertificateThumbprint] Thumbprint certificate - * that was used to encrypt "Value" + * Gets or sets Origin + * The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + * Default value is “user,system” */ - encryptionCertificateThumbprint?: string; + origin?: string; /** - * @member {EncryptionAlgorithm} encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' + * Gets or sets Properties + * Reserved for future use */ - encryptionAlgorithm: EncryptionAlgorithm; + properties?: Record; } /** - * @interface - * An interface representing AvailableProviderOperationDisplay. - * Contains the localized display information for this particular operation / - * action. + * Contains the localized display information for this particular operation / action. * These value will be used by several clients for * (1) custom role definitions for RBAC; - * (2) complex query filters for the event service; and (3) audit history / - * records for management operations. - * + * (2) complex query filters for the event service; and (3) audit history / records for management operations. */ export interface AvailableProviderOperationDisplay { /** - * @member {string} [provider] Gets or sets Provider - * The localized friendly form of the resource provider name – it is expected - * to also include the publisher/company responsible. - * It should use Title Casing and begin with “Microsoft” for 1st party - * services. + * Gets or sets Provider + * The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. + * It should use Title Casing and begin with “Microsoft” for 1st party services. */ provider?: string; /** - * @member {string} [resource] Gets or sets Resource - * The localized friendly form of the resource type related to this - * action/operation – it should match the public documentation for the - * resource provider. - * It should use Title Casing – for examples, please refer to the “name” - * section. + * Gets or sets Resource + * The localized friendly form of the resource type related to this action/operation – it should match the public documentation for the resource provider. + * It should use Title Casing – for examples, please refer to the “name” section. */ resource?: string; /** - * @member {string} [operation] Gets or sets Operation - * The localized friendly name for the operation, as it should be shown to - * the user. - * It should be concise (to fit in drop downs) but clear (i.e. - * self-documenting). It should use Title Casing and include the - * entity/resource to which it applies. + * Gets or sets Operation + * The localized friendly name for the operation, as it should be shown to the user. + * It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing and include the entity/resource to which it applies. */ operation?: string; /** - * @member {string} [description] Gets or sets Description - * The localized friendly description for the operation, as it should be - * shown to the user. - * It should be thorough, yet concise – it will be used in tool tips and - * detailed views. + * Gets or sets Description + * The localized friendly description for the operation, as it should be shown to the user. + * It should be thorough, yet concise – it will be used in tool tips and detailed views. */ description?: string; } -/** - * @interface - * An interface representing AvailableProviderOperation. - * Class represents provider operation - * - */ -export interface AvailableProviderOperation { - /** - * @member {string} [name] Gets or sets the name of the operation being - * performed on this particular object - * Return value format: - * "{resourceProviderNamespace}/{resourceType}/{read|write|deletion|action}" - * Eg: Microsoft.StorSimple/managers/devices/fileServers/read - * Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action - */ - name?: string; - /** - * @member {AvailableProviderOperationDisplay} [display] Gets or sets Display - * information - * Contains the localized display information for this particular - * operation/action - */ - display?: AvailableProviderOperationDisplay; - /** - * @member {string} [origin] Gets or sets Origin - * The intended executor of the operation; governs the display of the - * operation in the RBAC UX and the audit logs UX. - * Default value is “user,system” - */ - origin?: string; - /** - * @member {any} [properties] Gets or sets Properties - * Reserved for future use - */ - properties?: any; +/** The StorSimple Manager patch. */ +export interface ManagerPatch { + /** The tags attached to the StorSimple Manager. */ + tags?: { [propertyName: string]: string }; } -/** - * @interface - * An interface representing BackupElement. - * Class represents BackupElement - * - * @extends BaseModel - */ -export interface BackupElement extends BaseModel { - /** - * @member {number} sizeInBytes The size in bytes. - */ - sizeInBytes: number; - /** - * @member {string} endpointName The name of the endpoint. - */ - endpointName: string; - /** - * @member {DataPolicy} dataPolicy The data policy of backed up endpoint. - * Possible values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - */ - dataPolicy: DataPolicy; +/** Collection of AccessControlRecords */ +export interface AccessControlRecordList { + /** The value. */ + value: AccessControlRecord[]; } -/** - * @interface - * An interface representing Backup. - * The backup. - * - * @extends BaseModel - */ -export interface Backup extends BaseModel { - /** - * @member {string} [targetId] The path id of the target FileServer or - * IscsiServer for which the backup was taken. - */ - targetId?: string; - /** - * @member {string} [targetType] Type of target, FileServer or IscsiServer - */ - targetType?: string; - /** - * @member {number} sizeInBytes The backup size in bytes. - */ - sizeInBytes: number; - /** - * @member {Date} [createdTime] The time when the backup was created. - */ - createdTime?: Date; - /** - * @member {Date} [expirationTime] The time when the backup will expire. - */ - expirationTime?: Date; +/** Base class for models */ +export interface BaseModel { /** - * @member {InitiatedBy} initiatedBy Indicates how the backup was initiated - * "Manual | Scheduled". Possible values include: 'Manual', 'Scheduled' + * The identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - initiatedBy: InitiatedBy; + readonly id?: string; /** - * @member {string} deviceId The Device Identifier. + * The name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - deviceId: string; + readonly name?: string; /** - * @member {BackupElement[]} elements The backup elements. + * The type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - elements: BackupElement[]; + readonly type?: string; } -/** - * @interface - * An interface representing BackupFilter. - * Backup OData filter class - * - */ -export interface BackupFilter { - /** - * @member {InitiatedBy} [initiatedBy] Gets or sets InitiatedBy. Possible - * values include: 'Manual', 'Scheduled' - */ - initiatedBy?: InitiatedBy; - /** - * @member {Date} [createdTime] Gets or sets CreatedTime - */ - createdTime?: Date; +/** Collection of Alerts */ +export interface AlertList { + /** The value. */ + value: Alert[]; + /** Id of the next page of alerts */ + nextLink?: string; } -/** - * @interface - * An interface representing Time. - * The Time. - * - */ -export interface Time { - /** - * @member {number} hour The hour. - */ - hour: number; - /** - * @member {number} minute The minute. - */ - minute: number; +/** source at which the alert can be raised */ +export interface AlertSource { + /** Name of the source. */ + name?: string; + /** The time zone. */ + timeZone?: string; + /** Source type of the alert. */ + alertSourceType?: AlertSourceType; } -/** - * @interface - * An interface representing BackupScheduleGroup. - * The Backup Schedule Group - * - * @extends BaseModel - */ -export interface BackupScheduleGroup extends BaseModel { - /** - * @member {Time} startTime The start time. When this field is specified we - * will generate Default GrandFather Father Son Backup Schedules. - */ - startTime: Time; +/** Error details for the alert */ +export interface AlertErrorDetails { + /** Error code. */ + errorCode?: string; + /** Error Message */ + errorMessage?: string; + /** Number of occurrences. */ + occurences?: number; } -/** - * @interface - * An interface representing ChapSettings. - * Challenge-Handshake Authentical Protocol (CHAP) setting - * - * @extends BaseModel - */ -export interface ChapSettings extends BaseModel { - /** - * @member {AsymmetricEncryptedSecret} password The chap password. - */ - password: AsymmetricEncryptedSecret; +/** Collection of backups */ +export interface BackupList { + /** The value. */ + value: Backup[]; + /** The NextLink. */ + nextLink?: string; } -/** - * @interface - * An interface representing ClearAlertRequest. - * Request for clearing the alert - * - */ -export interface ClearAlertRequest { +/** Upload Certificate Request to IDM */ +export interface UploadCertificateRequest { /** - * @member {string} [resolutionMessage] Resolution message while clearing the - * request + * Gets ContractVersion + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resolutionMessage?: string; - /** - * @member {string[]} alerts List of alert Ids to be cleared - */ - alerts: string[]; -} - -/** - * @interface - * An interface representing FileShare. - * The File Share. - * - * @extends BaseModel - */ -export interface FileShare extends BaseModel { - /** - * @member {string} [description] Description for file share - */ - description?: string; - /** - * @member {ShareStatus} shareStatus The Share Status. Possible values - * include: 'Online', 'Offline' - */ - shareStatus: ShareStatus; - /** - * @member {DataPolicy} dataPolicy The data policy. Possible values include: - * 'Invalid', 'Local', 'Tiered', 'Cloud' - */ - dataPolicy: DataPolicy; - /** - * @member {string} adminUser The user/group who will have full permission in - * this share. Active directory email address. Example: xyz@contoso.com or - * Contoso\xyz. - */ - adminUser: string; - /** - * @member {number} provisionedCapacityInBytes The total provisioned capacity - * in Bytes - */ - provisionedCapacityInBytes: number; - /** - * @member {number} [usedCapacityInBytes] The used capacity in Bytes. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly usedCapacityInBytes?: number; - /** - * @member {number} [localUsedCapacityInBytes] The local used capacity in - * Bytes. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly localUsedCapacityInBytes?: number; - /** - * @member {MonitoringStatus} monitoringStatus The monitoring status. - * Possible values include: 'Enabled', 'Disabled' - */ - monitoringStatus: MonitoringStatus; + readonly contractVersion?: ContractVersions; + /** Specify the Authentication type */ + authType?: AuthType; + /** Gets or sets the base64 encoded certificate raw data string */ + certificate: string; } -/** - * @interface - * An interface representing ISCSIDisk. - * The iscsi disk. - * - * @extends BaseModel - */ -export interface ISCSIDisk extends BaseModel { - /** - * @member {string} [description] The description. - */ - description?: string; - /** - * @member {DiskStatus} diskStatus The disk status. Possible values include: - * 'Online', 'Offline' - */ - diskStatus: DiskStatus; - /** - * @member {string[]} accessControlRecords The access control records. - */ - accessControlRecords: string[]; - /** - * @member {DataPolicy} dataPolicy The data policy. Possible values include: - * 'Invalid', 'Local', 'Tiered', 'Cloud' - */ - dataPolicy: DataPolicy; - /** - * @member {number} provisionedCapacityInBytes The provisioned capacity in - * bytes. - */ - provisionedCapacityInBytes: number; - /** - * @member {number} [usedCapacityInBytes] The used capacity in bytes. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly usedCapacityInBytes?: number; - /** - * @member {number} [localUsedCapacityInBytes] The local used capacity in - * bytes. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly localUsedCapacityInBytes?: number; - /** - * @member {MonitoringStatus} monitoringStatus The monitoring. Possible - * values include: 'Enabled', 'Disabled' - */ - monitoringStatus: MonitoringStatus; +/** Request for clearing the alert */ +export interface ClearAlertRequest { + /** Resolution message while clearing the request */ + resolutionMessage?: string; + /** List of alert Ids to be cleared */ + alerts: string[]; } -/** - * @interface - * An interface representing CloneRequest. - * Clone Job Request Model. - * - */ -export interface CloneRequest { - /** - * @member {string} targetDeviceId DeviceId of the device which will act as - * the Clone target - */ - targetDeviceId: string; - /** - * @member {string} targetAccessPointId Accesspoint Id on which clone job - * will performed. - */ - targetAccessPointId: string; - /** - * @member {string} newEndpointName Name of new endpoint which will created - * as part of clone job. - */ - newEndpointName: string; - /** - * @member {FileShare} [share] Share Object. - */ - share?: FileShare; - /** - * @member {ISCSIDisk} [disk] Disk Object - */ - disk?: ISCSIDisk; +/** Collection of Devices */ +export interface DeviceList { + /** The value. */ + value: Device[]; } -/** - * @interface - * An interface representing DeviceDetails. - * Class containing more granular details about the device - * - */ +/** Class containing more granular details about the device */ export interface DeviceDetails { - /** - * @member {number} [endpointCount] Total number of endpoints that are - * currently on the device ( i.e. number of shares on FileServer or number of - * volumes on IscsiServer) - */ + /** Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes on IscsiServer) */ endpointCount?: number; - /** - * @member {number} [totalStorageInBytes] Total storage available on the - * device in bytes. - */ + /** Total storage available on the device in bytes. */ totalStorageInBytes?: number; - /** - * @member {number} [totalLocalStorageInBytes] Total local storage capacity - * in device in bytes. - */ + /** Total local storage capacity in device in bytes. */ totalLocalStorageInBytes?: number; - /** - * @member {number} [provisionedStorageInBytes] Storage in bytes that has - * been provisioned on the device including both local and cloud - */ + /** Storage in bytes that has been provisioned on the device including both local and cloud */ provisionedStorageInBytes?: number; - /** - * @member {number} [provisionedLocalStorageInBytes] Storage in bytes that - * has been provisioned locally on the device - */ + /** Storage in bytes that has been provisioned locally on the device */ provisionedLocalStorageInBytes?: number; - /** - * @member {number} [usingStorageInBytes] Storage that is being currently - * used in bytes including both local and cloud - */ + /** Storage that is being currently used in bytes including both local and cloud */ usingStorageInBytes?: number; - /** - * @member {number} [usingLocalStorageInBytes] Local Storage that is being - * currently used in bytes - */ + /** Local Storage that is being currently used in bytes */ usingLocalStorageInBytes?: number; - /** - * @member {number} [totalBackupSizeInBytes] Total size taken up by backups - * in bytes - */ + /** Total size taken up by backups in bytes */ totalBackupSizeInBytes?: number; - /** - * @member {number} [availableStorageInBytes] Total pending available storage - * on the device in bytes - */ + /** Total pending available storage on the device in bytes */ availableStorageInBytes?: number; - /** - * @member {number} [availableLocalStorageInBytes] Local pending storage - * available on the device in bytes - */ + /** Local pending storage available on the device in bytes */ availableLocalStorageInBytes?: number; } -/** - * @interface - * An interface representing Device. - * Represents a StorSimple device object along with its properties - * - * @extends BaseModel - */ -export interface Device extends BaseModel { - /** - * @member {Date} [activationTime] The UTC time at which the device was - * activated - */ - activationTime?: Date; - /** - * @member {DeviceOperation[]} [allowedDeviceOperations] Operations that are - * allowed on the device based on its current state - */ - allowedDeviceOperations?: DeviceOperation[]; - /** - * @member {string} [culture] Language culture setting on the device. For eg: - * "en-US" - */ - culture?: string; - /** - * @member {SupportedDeviceCapabilities[]} [deviceCapabilities] Device can be - * configured either as FileServer or IscsiServer - */ - deviceCapabilities?: SupportedDeviceCapabilities[]; - /** - * @member {string} [deviceDescription] Short description given for the - * device - */ +/** Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" */ +export interface DevicePatch { + /** Short description given for the device */ deviceDescription?: string; - /** - * @member {string} [domainName] Fully qualified name of the domain to which - * the device is attached - */ - domainName?: string; - /** - * @member {string} [deviceSoftwareVersion] Version number of the software - * running on the device - */ - deviceSoftwareVersion?: string; - /** - * @member {string} [friendlySoftwareName] Friendly name for the software - * version - */ - friendlySoftwareName?: string; - /** - * @member {DeviceConfigurationStatus} [deviceConfigurationStatus] "Complete" - * if the device has been successfully registered as File/IscsiServer and the - * creation of share/volume is complete, "Pending" if the device is only - * registered but the creation of share/volume is complete is still pending. - * Possible values include: 'Complete', 'Pending' - */ - deviceConfigurationStatus?: DeviceConfigurationStatus; - /** - * @member {string} [modelDescription] Name of the device model - */ - modelDescription?: string; - /** - * @member {DeviceStatus} [status] Current status of the device. Possible - * values include: 'Unknown', 'Online', 'Offline', 'RequiresAttention', - * 'MaintenanceMode', 'Creating', 'Provisioning', 'Deleted', 'ReadyToSetup', - * 'Deactivated', 'Deactivating' - */ - status?: DeviceStatus; - /** - * @member {DeviceType} [deviceType] Type of the device. Possible values - * include: 'Invalid', 'Appliance', 'VirtualAppliance', - * 'Series9000OnPremVirtualAppliance', 'Series9000VirtualAppliance', - * 'Series9000PhysicalAppliance' - */ - deviceType?: DeviceType; - /** - * @member {DeviceDetails} [details] subclass containing more storage-related - * information about the device. This field will be populated only if the get - * call is made with $expand = details. - */ - details?: DeviceDetails; } -/** - * @interface - * An interface representing DevicePatch. - * Class that represents the Input for the PATCH call on Device. Currently the - * only patchable property on device is "DeviceDescription" - * - */ -export interface DevicePatch { - /** - * @member {string} [deviceDescription] Short description given for the - * device - */ - deviceDescription?: string; +/** Clone Job Request Model. */ +export interface CloneRequest { + /** DeviceId of the device which will act as the Clone target */ + targetDeviceId: string; + /** Access point Id on which clone job will performed. */ + targetAccessPointId: string; + /** Name of new endpoint which will created as part of clone job. */ + newEndpointName: string; + /** Share Object. */ + share?: FileShare; + /** Disk Object */ + disk?: IscsiDisk; } -/** - * @interface - * An interface representing EncryptionSettings. - * The EncryptionSettings - * - * @extends BaseModel - */ -export interface EncryptionSettings extends BaseModel { - /** - * @member {EncryptionStatus} encryptionStatus The encryption status which - * indicates if encryption is enabled or not. Possible values include: - * 'Enabled', 'Disabled' - */ - encryptionStatus: EncryptionStatus; - /** - * @member {KeyRolloverStatus} keyRolloverStatus The key rollover status - * which indicates if key rollover is required or not. If secrets encryption - * has been upgraded, then it requires key rollover. Possible values include: - * 'Required', 'NotRequired' - */ - keyRolloverStatus: KeyRolloverStatus; +/** The list response of backup schedule groups */ +export interface BackupScheduleGroupList { + /** The value. */ + value: BackupScheduleGroup[]; } -/** - * @interface - * An interface representing Message. - */ -export interface Message { - /** - * @member {string} [language] - */ - language?: string; - /** - * @member {string} [value] - */ - value?: string; +/** The Time. */ +export interface Time { + /** The hour. */ + hour: number; + /** The minute. */ + minute: number; } -/** - * @interface - * An interface representing Item. - */ -export interface Item { - /** - * @member {string} key - */ - key: string; - /** - * @member {string} value - */ +/** Collection of Chap setting entities */ +export interface ChapSettingsList { + /** The chap settings entity collection */ + value: ChapSettings[]; +} + +/** This class can be used as the Type for any secret entity represented as Password, CertThumbprint, Algorithm. This class is intended to be used when the secret is encrypted with an asymmetric key pair. The encryptionAlgorithm field is mainly for future usage to potentially allow different entities encrypted using different algorithms. */ +export interface AsymmetricEncryptedSecret { + /** The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. */ value: string; + /** Thumbprint certificate that was used to encrypt "Value" */ + encryptionCertificateThumbprint?: string; + /** Algorithm used to encrypt "Value" */ + encryptionAlgorithm: EncryptionAlgorithm; } -/** - * @interface - * An interface representing ErrorModel. - */ -export interface ErrorModel { - /** - * @member {string} errorCode - */ - errorCode: string; - /** - * @member {Message} message - */ - message: Message; - /** - * @member {Item[]} [values] - */ - values?: Item[]; +/** Collection of Iscsi disk */ +export interface IscsiDiskList { + /** The value. */ + value: IscsiDisk[]; } -/** - * @interface - * An interface representing FailoverRequest. - * The Failover request object. - * - */ +/** The Failover request object. */ export interface FailoverRequest { - /** - * @member {string[]} [accesspointIds] - */ accesspointIds?: string[]; - /** - * @member {string} [targetDeviceId] - */ targetDeviceId?: string; - /** - * @member {boolean} [skipValidation] - */ skipValidation?: boolean; - /** - * @member {boolean} [keepSourceDevice] - */ keepSourceDevice?: boolean; } -/** - * @interface - * An interface representing FileServer. - * The file server. - * - * @extends BaseModel - */ -export interface FileServer extends BaseModel { - /** - * @member {string} domainName Domain of the file server - */ - domainName: string; - /** - * @member {string} storageDomainId The storage domain id. - */ - storageDomainId: string; - /** - * @member {string} backupScheduleGroupId The backup policy id. - */ - backupScheduleGroupId: string; - /** - * @member {string} [description] The description of the file server - */ - description?: string; +/** Collection of file servers */ +export interface FileServerList { + /** The value. */ + value: FileServer[]; } -/** - * @interface - * An interface representing IPConfig. - * Details related to the IP address configuration - * - */ -export interface IPConfig { - /** - * @member {string} ipAddress The ipaddress of the network adapter, either - * ipv4 or ipv6. - */ - ipAddress: string; - /** - * @member {number} [prefixLength] The prefix length of the network adapter. - */ - prefixLength?: number; - /** - * @member {string} gateway The gateway of the network adapter. - */ - gateway: string; +/** Collection of metrics */ +export interface MetricList { + /** The value. */ + value: Metrics[]; } -/** - * @interface - * An interface representing ISCSIServer. - * The iscsi server. - * - * @extends BaseModel - */ -export interface ISCSIServer extends BaseModel { - /** - * @member {string} storageDomainId The storage domain id. - */ - storageDomainId: string; - /** - * @member {string} backupScheduleGroupId The backup policy id. - */ - backupScheduleGroupId: string; - /** - * @member {string} [description] The description. - */ - description?: string; - /** - * @member {string} [chapId] The chap id. - */ - chapId?: string; - /** - * @member {string} [reverseChapId] The reverse chap id. - */ - reverseChapId?: string; +/** Monitoring metric */ +export interface Metrics { + /** The id of metric source */ + resourceId: string; + /** The metric start time */ + startTime: Date; + /** The metric end time */ + endTime: Date; + /** The time grain, time grain indicates frequency of the metric data */ + timeGrain: string; + /** The metric aggregation type */ + primaryAggregation: MetricAggregationType; + /** The name of the metrics */ + name: MetricName; + /** The Metric dimension which indicates the source of the metric */ + dimensions: MetricDimension[]; + /** The unit of the metric data */ + unit: MetricUnit; + /** The Type of the metric data */ + type: string; + /** The metric data */ + values: MetricData[]; } -/** - * @interface - * An interface representing JobErrorItem. - * The job error items. - * - */ -export interface JobErrorItem { - /** - * @member {string[]} [recommendations] The recommended actions. - */ - recommendations?: string[]; - /** - * @member {string} code The code intended for programmatic access - */ - code: string; - /** - * @member {string} message The message intended to describe the error in - * detail - */ - message: string; +/** The name of the metric */ +export interface MetricName { + /** Name of the metric */ + value: string; + /** Localized name of the metric */ + localizedValue: string; } -/** - * @interface - * An interface representing JobErrorDetails. - * The job error information containing List of JobErrorItem. - * - */ +/** Metric dimension */ +export interface MetricDimension { + /** Metric dimension name */ + name: string; + /** Metric dimension values */ + value: string; +} + +/** The metric data. */ +export interface MetricData { + /** The time when the metric data is fetched */ + timeStamp: Date; + /** The sum of all the samples available in the given instance of time for the specific metric data */ + sum: number; + /** The count of samples of the metric data available for the given instance */ + count: number; + /** The average of all sample for the given instance */ + average: number; + /** The minimum of all samples available */ + minimum: number; + /** The maximum of all samples available */ + maximum: number; +} + +/** List of metric definition */ +export interface MetricDefinitionList { + /** The list of metric definition */ + value: MetricDefinition[]; +} + +/** Monitoring metric definition represents the metadata of the metrics. */ +export interface MetricDefinition { + /** The metric name */ + name: MetricName; + /** The metric unit */ + unit: MetricUnit; + /** The metric aggregation type */ + primaryAggregationType: MetricAggregationType; + /** The metric source id */ + resourceId: string; + /** The available metric granularities */ + metricAvailabilities: MetricAvailablity[]; + /** The supported dimensions */ + dimensions: MetricDimension[]; + /** The metric definition type */ + type: string; +} + +/** Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time grain */ +export interface MetricAvailablity { + /** The time grain, specifies the aggregation interval for the metric. */ + timeGrain: string; + /** The retention period for the metric at the specified timegrain */ + retention: string; +} + +/** Collection of file shares */ +export interface FileShareList { + /** The value. */ + value: FileShare[]; +} + +/** Collection of Iscsi servers */ +export interface IscsiServerList { + /** The value. */ + value: IscsiServer[]; +} + +/** Collection of jobs */ +export interface JobList { + /** The value. */ + value: Job[]; + /** The NextLink. */ + nextLink?: string; +} + +/** The job error information containing List of JobErrorItem. */ export interface JobErrorDetails { - /** - * @member {JobErrorItem[]} [errorDetails] The error details. - */ + /** The error details. */ errorDetails?: JobErrorItem[]; - /** - * @member {string} code The code intended for programmatic access - */ + /** The code intended for programmatic access */ code: string; - /** - * @member {string} message The message intended to describe the error in - * detail - */ + /** The message intended to describe the error in detail */ message: string; } -/** - * @interface - * An interface representing JobStage. - * Contains details about the multiple job stages of a job - * - */ +/** The job error items. */ +export interface JobErrorItem { + /** The recommended actions. */ + recommendations?: string[]; + /** The code intended for programmatic access */ + code: string; + /** The message intended to describe the error in detail */ + message: string; +} + +/** Contains details about the multiple job stages of a job */ export interface JobStage { - /** - * @member {string} [message] The message of the job stage. - */ + /** The message of the job stage. */ message?: string; - /** - * @member {JobStatus} stageStatus The stage status. Possible values include: - * 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', - * 'Scheduled' - */ + /** The stage status. */ stageStatus: JobStatus; - /** - * @member {string} [detail] The details of the stage. - */ + /** The details of the stage. */ detail?: string; - /** - * @member {string} [errorCode] The error code of the stage if any. - */ + /** The error code of the stage if any. */ errorCode?: string; } -/** - * @interface - * An interface representing JobStats. - * Stats that are available for all jobs in common - * - */ +/** Stats that are available for all jobs in common */ export interface JobStats { - /** - * @member {number} [completedWorkItemCount] Completed work item count. - */ + /** Completed work item count. */ completedWorkItemCount?: number; - /** - * @member {number} [totalWorkItemCount] Total work item count. - */ + /** Total work item count. */ totalWorkItemCount?: number; - /** - * @member {number} [estimatedTimeRemaining] The estimated time remaining. - */ + /** The estimated time remaining. */ estimatedTimeRemaining?: number; } -/** - * @interface - * An interface representing UpdateDownloadProgress. - * details available during the download - * - */ +/** details available during the download */ export interface UpdateDownloadProgress { - /** - * @member {DownloadPhase} [downloadPhase] The download phase. Possible - * values include: 'Unknown', 'Initializing', 'Downloading', 'Verifying' - */ + /** The download phase. */ downloadPhase?: DownloadPhase; - /** - * @member {number} [percentComplete] Percentage of completion. - */ + /** Percentage of completion. */ percentComplete?: number; - /** - * @member {number} [totalBytesToDownload] Total bytes to download. - */ + /** Total bytes to download. */ totalBytesToDownload?: number; - /** - * @member {number} [totalBytesDownloaded] Total bytes downloaded. - */ + /** Total bytes downloaded. */ totalBytesDownloaded?: number; - /** - * @member {number} [numberOfUpdatesToDownload] Number of updates to - * download. - */ + /** Number of updates to download. */ numberOfUpdatesToDownload?: number; - /** - * @member {number} [numberOfUpdatesDownloaded] Number of updates downloaded. - */ + /** Number of updates downloaded. */ numberOfUpdatesDownloaded?: number; } -/** - * @interface - * An interface representing UpdateInstallProgress. - * Class representing the progress during installation of updates - * - */ +/** Class representing the progress during installation of updates */ export interface UpdateInstallProgress { - /** - * @member {number} [percentComplete] Percentage of completion. - */ + /** Percentage of completion. */ percentComplete?: number; - /** - * @member {number} [numberOfUpdatesToInstall] Number of updates to install. - */ + /** Number of updates to install. */ numberOfUpdatesToInstall?: number; - /** - * @member {number} [numberOfUpdatesInstalled] Number of updates installed. - */ + /** Number of updates installed. */ numberOfUpdatesInstalled?: number; } -/** - * @interface - * An interface representing Job. - * The Job. - * - * @extends BaseModel - */ -export interface Job extends BaseModel { - /** - * @member {JobStatus} status Current status of the job. Possible values - * include: 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', - * 'Paused', 'Scheduled' - */ - status: JobStatus; - /** - * @member {Date} [startTime] The UTC time at which the job was started - */ - startTime?: Date; - /** - * @member {Date} [endTime] The UTC time at which the job completed - */ - endTime?: Date; - /** - * @member {number} percentComplete The percentage of the job that is already - * complete - */ - percentComplete: number; - /** - * @member {JobErrorDetails} [error] The Error details. - */ - error?: JobErrorDetails; - /** - * @member {JobType} jobType Type of the job. Possible values include: - * 'Backup', 'Clone', 'Failover', 'DownloadUpdates', 'InstallUpdates' - */ - jobType: JobType; - /** - * @member {string} [targetId] Id of the object that is created by the job - */ - targetId?: string; - /** - * @member {string} [entityId] The entity identifier for which the job ran. - */ - entityId?: string; - /** - * @member {string} [entityType] The entity type for which the job ran. - */ - entityType?: string; - /** - * @member {JobStage[]} [jobStages] The job stages. - */ - jobStages?: JobStage[]; - /** - * @member {string} [deviceId] The device id in which the job is currently - * running - */ - deviceId?: string; - /** - * @member {boolean} [isCancellable] Represents whether the job is - * cancellable or not - */ - isCancellable?: boolean; - /** - * @member {JobStats} [stats] stats properties for the job - */ - stats?: JobStats; - /** - * @member {TargetType} [targetType] The target type of the backup. Possible - * values include: 'FileServer', 'DiskServer' - */ - targetType?: TargetType; - /** - * @member {string} [sourceDeviceId] The source device identifier of the - * failover job. - */ - sourceDeviceId?: string; - /** - * @member {Date} [backupPointInTime] The time of the backup used for the - * failover. - */ - backupPointInTime?: Date; - /** - * @member {UpdateDownloadProgress} [downloadProgress] The download progress. - */ - downloadProgress?: UpdateDownloadProgress; - /** - * @member {UpdateInstallProgress} [installProgress] The install progress. - */ - installProgress?: UpdateInstallProgress; +/** Represents a single node in a device. */ +export interface NodeNetwork { + /** The array of network adapters in the node. */ + networkAdapters: NetworkAdapter[]; } -/** - * @interface - * An interface representing JobFilter. - * Filters that can be specified for the job - * - */ -export interface JobFilter { - /** - * @member {JobType} jobType The job type. Possible values include: 'Backup', - * 'Clone', 'Failover', 'DownloadUpdates', 'InstallUpdates' - */ - jobType: JobType; - /** - * @member {JobStatus} status The job status. Possible values include: - * 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', - * 'Scheduled' - */ - status: JobStatus; - /** - * @member {Date} [startTime] The start time of the job. - */ - startTime?: Date; +/** Represents a networkAdapter in a particular node. */ +export interface NetworkAdapter { + /** The name of the network adapter. */ + networkAdapterName: string; + /** The ipv4 configuration of the network adapter. */ + iPv4Info?: IPConfig; + /** The ipv6 configuration of the network adapter. */ + iPv6Info?: IPConfig; + /** Represents state of DHCP. */ + dhcpStatus: DhcpStatus; + /** The speed of the network adapter. */ + linkSpeed?: number; } -/** - * @interface - * An interface representing ManagerIntrinsicSettings. - * Intrinsic settings which refers to the type of the Storsimple manager - * - */ -export interface ManagerIntrinsicSettings { - /** - * @member {ManagerType} type Refers to the type of the StorSimple Manager. - * Possible values include: 'GardaV1', 'HelsinkiV1' - */ - type: ManagerType; +/** Details related to the IP address configuration */ +export interface IPConfig { + /** The IP address of the network adapter, either ipv4 or ipv6. */ + ipAddress: string; + /** The prefix length of the network adapter. */ + prefixLength?: number; + /** The gateway of the network adapter. */ + gateway: string; } -/** - * @interface - * An interface representing ManagerSku. - * The Sku. - * - */ -export interface ManagerSku { +/** Request for sending test alert email */ +export interface SendTestAlertEmailRequest { + /** List of emails to send the test alerts */ + emailList: string[]; } -/** - * @interface - * An interface representing Resource. - * The Azure Resource. - * - * @extends BaseResource - */ -export interface Resource extends BaseResource { - /** - * @member {string} [id] The Resource Id - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly id?: string; - /** - * @member {string} [name] The Resource Name - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly name?: string; - /** - * @member {string} [type] The Resource type - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly type?: string; - /** - * @member {string} location The Geo location of the Manager - */ - location: string; - /** - * @member {{ [propertyName: string]: string }} [tags] Tags attached to the - * Manager - */ - tags?: { [propertyName: string]: string }; +/** This class can be used as the Type for any secret entity represented as Value, ValueCertificateThumbprint, EncryptionAlgorithm. In this case, "Value" is a secret and the "valueThumbprint" represents the certificate thumbprint of the value. The algorithm field is mainly for future usage to potentially allow different entities encrypted using different algorithms. */ +export interface SymmetricEncryptedSecret { + /** The value of the secret itself. If the secret is in plaintext or null then EncryptionAlgorithm will be none */ + value: string; + /** Thumbprint cert that was used to encrypt "Value" */ + valueCertificateThumbprint?: string; + /** Algorithm used to encrypt "Value" */ + encryptionAlgorithm: EncryptionAlgorithm; } -/** - * @interface - * An interface representing Manager. - * The StorSimple Manager - * - * @extends Resource - */ -export interface Manager extends Resource { - /** - * @member {ManagerIntrinsicSettings} [cisIntrinsicSettings] Specifies if the - * Manager is Garda or Helsinki - */ - cisIntrinsicSettings?: ManagerIntrinsicSettings; - /** - * @member {string} [provisioningState] Specifies the state of the resource - * as it is getting provisioned. Value of "Succeeded" means the Manager was - * successfully created - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly provisioningState?: string; - /** - * @member {string} [etag] ETag of the Manager - */ - etag?: string; -} - -/** - * @interface - * An interface representing ManagerExtendedInfo. - * The extended info of the manager. - * - * @extends BaseModel - */ -export interface ManagerExtendedInfo extends BaseModel { - /** - * @member {string} [version] Represents the version of the ExtendedInfo - * object being persisted - */ - version?: string; - /** - * @member {string} integrityKey Represents the CIK of the resource - */ - integrityKey: string; - /** - * @member {string} [encryptionKey] Represents the CEK of the resource - */ - encryptionKey?: string; - /** - * @member {string} [encryptionKeyThumbprint] Represents the Cert thumbprint - * that was used to encrypt the CEK - */ - encryptionKeyThumbprint?: string; - /** - * @member {string} [portalCertificateThumbprint] Represents the portal - * thumbprint which can be used optionally to encrypt the entire data before - * storing it. - */ - portalCertificateThumbprint?: string; - /** - * @member {string} algorithm Represents the encryption algorithm used to - * encrypt the other keys. None - if EncryptionKey is saved in plain text - * format. AlgorithmName - if encryption is used - */ - algorithm: string; - /** - * @member {string} [etag] ETag of the Resource - */ - etag?: string; -} - -/** - * @interface - * An interface representing ManagerPatch. - * The StorSimple Manager patch. - * - */ -export interface ManagerPatch { - /** - * @member {{ [propertyName: string]: string }} [tags] The tags attached to - * the StorSimple Manager. - */ - tags?: { [propertyName: string]: string }; -} - -/** - * @interface - * An interface representing MetricAvailablity. - * Metric availability specifies the time grain (aggregation interval or - * frequency) and the retention period for that time grain - * - */ -export interface MetricAvailablity { - /** - * @member {string} timeGrain The time grain, specifies the aggregation - * interval for the metric. - */ - timeGrain: string; - /** - * @member {string} retention The retention period for the metric at the - * specified timegrain - */ - retention: string; -} - -/** - * @interface - * An interface representing MetricData. - * The metric data. - * - */ -export interface MetricData { - /** - * @member {Date} timeStamp The time when the metric data is fetched - */ - timeStamp: Date; - /** - * @member {number} sum The sum of all the samples available in the given - * instance of time for the specific metric data - */ - sum: number; - /** - * @member {number} count The count of samples of the metric data available - * for the given instance - */ - count: number; - /** - * @member {number} average The average of all sample for the given instance - */ - average: number; - /** - * @member {number} minimum The minimum of all samples available - */ - minimum: number; - /** - * @member {number} maximum The maximum of all samples available - */ - maximum: number; -} - -/** - * @interface - * An interface representing MetricName. - * The name of the metric - * - */ -export interface MetricName { - /** - * @member {string} value Name of the metric - */ - value: string; - /** - * @member {string} localizedValue Localized name of the metric - */ - localizedValue: string; -} - -/** - * @interface - * An interface representing MetricDimension. - * Metric dimension - * - */ -export interface MetricDimension { - /** - * @member {string} name Metric dimension name - */ - name: string; - /** - * @member {string} value Metric dimension values - */ - value: string; -} - -/** - * @interface - * An interface representing MetricDefinition. - * Monitoring metric definition represents the metadata of the metrics. - * - */ -export interface MetricDefinition { - /** - * @member {MetricName} name The metric name - */ - name: MetricName; - /** - * @member {MetricUnit} unit The metric unit. Possible values include: - * 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds' - */ - unit: MetricUnit; - /** - * @member {MetricAggregationType} primaryAggregationType The metric - * aggregation type. Possible values include: 'Average', 'Last', 'Maximum', - * 'Minimum', 'None', 'Total' - */ - primaryAggregationType: MetricAggregationType; - /** - * @member {string} resourceId The metric source id - */ - resourceId: string; - /** - * @member {MetricAvailablity[]} metricAvailabilities The available metric - * granularities - */ - metricAvailabilities: MetricAvailablity[]; - /** - * @member {MetricDimension[]} dimensions The supported dimensions - */ - dimensions: MetricDimension[]; - /** - * @member {string} type The metric definition type - */ - type: string; -} - -/** - * @interface - * An interface representing MetricNameFilter. - * Class representing the name filter to be passed while fetching metrics - * - */ -export interface MetricNameFilter { - /** - * @member {string} [value] The value. - */ - value?: string; -} - -/** - * @interface - * An interface representing MetricFilter. - * class representing the filters to be passed while fetching metrics - * - */ -export interface MetricFilter { - /** - * @member {MetricNameFilter} [name] filter for name property - */ - name?: MetricNameFilter; - /** - * @member {Date} [startTime] starttime for fetching metrics - */ - startTime?: Date; - /** - * @member {Date} [endTime] endtime for fetching metrics - */ - endTime?: Date; - /** - * @member {string} [timeGrain] timegrain of the metrics - */ - timeGrain?: string; -} - -/** - * @interface - * An interface representing Metrics. - * Monitoring metric - * - */ -export interface Metrics { - /** - * @member {string} resourceId The id of metric source - */ - resourceId: string; - /** - * @member {Date} startTime The metric start time - */ - startTime: Date; - /** - * @member {Date} endTime The metric end time - */ - endTime: Date; - /** - * @member {string} timeGrain The time grain, time grain indicates frequency - * of the metric data - */ - timeGrain: string; - /** - * @member {MetricAggregationType} primaryAggregation The metric aggregation - * type. Possible values include: 'Average', 'Last', 'Maximum', 'Minimum', - * 'None', 'Total' - */ - primaryAggregation: MetricAggregationType; - /** - * @member {MetricName} name The name of the metrics - */ - name: MetricName; - /** - * @member {MetricDimension[]} dimensions The Metric dimension which - * indicates the source of the metric - */ - dimensions: MetricDimension[]; - /** - * @member {MetricUnit} unit The unit of the metric data. Possible values - * include: 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', - * 'Seconds' - */ - unit: MetricUnit; - /** - * @member {string} type The Type of the metric data - */ - type: string; - /** - * @member {MetricData[]} values The metric data - */ - values: MetricData[]; -} - -/** - * @interface - * An interface representing NetworkAdapter. - * Represents a networkAdapter in a particular node. - * - */ -export interface NetworkAdapter { - /** - * @member {string} networkAdapterName The name of the network adapter. - */ - networkAdapterName: string; - /** - * @member {IPConfig} [iPv4Info] The ipv4 configuration of the network - * adapter. - */ - iPv4Info?: IPConfig; - /** - * @member {IPConfig} [iPv6Info] The ipv6 configuration of the network - * adapter. - */ - iPv6Info?: IPConfig; - /** - * @member {DhcpStatus} dhcpStatus Represents state of DHCP. Possible values - * include: 'Enabled', 'Disabled' - */ - dhcpStatus: DhcpStatus; - /** - * @member {number} [linkSpeed] The speed of the network adapter. - */ - linkSpeed?: number; -} - -/** - * @interface - * An interface representing NodeNetwork. - * Represents a single node in a device. - * - */ -export interface NodeNetwork { - /** - * @member {NetworkAdapter[]} networkAdapters The array of network adapters - * in the node. - */ - networkAdapters: NetworkAdapter[]; -} - -/** - * @interface - * An interface representing NetworkSettings. - * The NetworkSettings of a device - * - * @extends BaseModel - */ -export interface NetworkSettings extends BaseModel { - /** - * @member {string} primaryDnsServer The Primary DNS server for the device - */ - primaryDnsServer: string; - /** - * @member {string} [secondaryDnsServer] The secondary DNS server for the - * device - */ - secondaryDnsServer?: string; - /** - * @member {NodeNetwork[]} nodeNetworks The NetworkAdapters under each node - * of the device. - */ - nodeNetworks: NodeNetwork[]; -} - -/** - * @interface - * An interface representing SecuritySettings. - * The SecuritySettings of a device - * - * @extends BaseModel - */ -export interface SecuritySettings extends BaseModel { - /** - * @member {AsymmetricEncryptedSecret} deviceAdminPassword Device - * administrator password as an encrypted string (encrypted using RSA PKCS - * #1) is used to log into the local web UI of the device. Actual password - * could have at least 8 characters that are a combination of uppercase, - * lowercase, numeric, and special characters - */ - deviceAdminPassword: AsymmetricEncryptedSecret; -} - -/** - * @interface - * An interface representing SendTestAlertEmailRequest. - * Request for sending test alert email - * - */ -export interface SendTestAlertEmailRequest { - /** - * @member {string[]} emailList List of emails to send the test alerts - */ - emailList: string[]; -} - -/** - * @interface - * An interface representing StorageAccountCredential. - * The storage account credential - * - * @extends BaseModel - */ -export interface StorageAccountCredential extends BaseModel { - /** - * @member {CloudType} cloudType The cloud service provider. Possible values - * include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - */ - cloudType: CloudType; - /** - * @member {string} endPoint The storage endpoint - */ - endPoint: string; - /** - * @member {string} login The storage account login - */ - login: string; - /** - * @member {string} [location] The storage account's geo location - */ - location?: string; - /** - * @member {SslStatus} enableSSL SSL needs to be enabled or not. Possible - * values include: 'Enabled', 'Disabled' - */ - enableSSL: SslStatus; - /** - * @member {AsymmetricEncryptedSecret} [accessKey] The details of the storage - * account password - */ - accessKey?: AsymmetricEncryptedSecret; +/** Collection of Storage account credential entities */ +export interface StorageAccountCredentialList { + /** The value. */ + value: StorageAccountCredential[]; } -/** - * @interface - * An interface representing StorageDomain. - * The storage domain. - * - * @extends BaseModel - */ -export interface StorageDomain extends BaseModel { - /** - * @member {string[]} storageAccountCredentialIds The storage account - * credentials. - */ - storageAccountCredentialIds: string[]; - /** - * @member {AsymmetricEncryptedSecret} [encryptionKey] The encryption key - * used to encrypt the data. This is a user secret. - */ - encryptionKey?: AsymmetricEncryptedSecret; - /** - * @member {EncryptionStatus} encryptionStatus The encryption status "Enabled - * | Disabled". Possible values include: 'Enabled', 'Disabled' - */ - encryptionStatus: EncryptionStatus; +/** Collection of storage domains */ +export interface StorageDomainList { + /** The value. */ + value: StorageDomain[]; } -/** - * @interface - * An interface representing SymmetricEncryptedSecret. - * This class can be used as the Type for any secret entity represented as - * Value, ValueCertificateThumbprint, EncryptionAlgorithm. In this case, - * "Value" is a secret and the "valueThumbprint" represents the certificate - * thumbprint of the value. The algorithm field is mainly for future usage to - * potentially allow different entities encrypted using different algorithms. - * - */ -export interface SymmetricEncryptedSecret { - /** - * @member {string} value The value of the secret itself. If the secret is in - * plaintext or null then EncryptionAlgorithm will be none - */ - value: string; - /** - * @member {string} [valueCertificateThumbprint] Thumbprint cert that was - * used to encrypt "Value" - */ - valueCertificateThumbprint?: string; - /** - * @member {EncryptionAlgorithm} encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - */ - encryptionAlgorithm: EncryptionAlgorithm; +/** Filters that can be specified on the alert */ +export interface AlertFilter { + /** Status of the alert */ + status?: AlertStatus; + /** Severity of the alert */ + severity?: AlertSeverity; + /** Source of the alert */ + sourceType?: AlertSourceType; + /** Source name of the alert */ + sourceName?: string; + /** UTC time on which the alert appeared */ + appearedOnTime?: Date; } -/** - * @interface - * An interface representing TimeSettings. - * The TimeSettings of a device - * - * @extends BaseModel - */ -export interface TimeSettings extends BaseModel { - /** - * @member {string} timeZone The timezone of device, like '(UTC -06:00) - * Central America' - */ - timeZone: string; - /** - * @member {string} primaryTimeServer The primary Network Time Protocol (NTP) - * server name, like 'time.windows.com'. - */ - primaryTimeServer: string; - /** - * @member {string} [secondaryTimeServer] The secondary Network Time Protocol - * (NTP) server name, like 'time.contoso.com'. It's optional. - */ - secondaryTimeServer?: string; +/** Backup OData filter class */ +export interface BackupFilter { + /** Gets or sets InitiatedBy */ + initiatedBy?: InitiatedBy; + /** Gets or sets CreatedTime */ + createdTime?: Date; } -/** - * @interface - * An interface representing Updates. - * The updates profile - * - * @extends BaseModel - */ -export interface Updates extends BaseModel { - /** - * @member {string} [deviceVersion] The current Device version. - */ - deviceVersion?: string; - /** - * @member {Date} [deviceLastScannedTime] The last time when the device did - * an update scan. - */ - deviceLastScannedTime?: Date; - /** - * @member {boolean} [regularUpdatesAvailable] Set to true if regular updates - * were detected for the current version of the device. - */ - regularUpdatesAvailable?: boolean; - /** - * @member {boolean} [rebootRequiredForInstall] Set to true if - * RegularUpdatesAvailable is true and if atleast one of the updateItems - * detected has needs a reboot to install. - */ - rebootRequiredForInstall?: boolean; - /** - * @member {number} [totalItemsPendingForDownload] The total number of items - * pending for download. - */ - totalItemsPendingForDownload?: number; - /** - * @member {number} [totalItemsPendingForInstall] The total number of items - * pending for install. - */ - totalItemsPendingForInstall?: number; - /** - * @member {UpdateOperation} [status] The current update operation. Possible - * values include: 'Idle', 'Scanning', 'Downloading', 'Installing' - */ - status?: UpdateOperation; - /** - * @member {Date} [lastCompletedScanTime] The time when the last scan job was - * completed (success|cancelled|failed) on the device. - */ - lastCompletedScanTime?: Date; - /** - * @member {Date} [lastCompletedDownloadJobTime] The time when the last - * Download job was completed (success|cancelled|failed) on the device. - */ - lastCompletedDownloadJobTime?: Date; - /** - * @member {Date} [lastCompletedInstallJobTime] The time when the last - * Install job was completed (success|cancelled|failed) on the device. - */ - lastCompletedInstallJobTime?: Date; - /** - * @member {string} [inProgressDownloadJobId] If a download is in progress, - * this field contains the JobId of that particular download job - */ - inProgressDownloadJobId?: string; - /** - * @member {string} [inProgressInstallJobId] If an install is in progress, - * this field contains the JobId of that particular install job - */ - inProgressInstallJobId?: string; - /** - * @member {Date} [inProgressScanStartedTime] The time when the currently - * running scan (if any) started - */ - inProgressScanStartedTime?: Date; - /** - * @member {Date} [inProgressDownloadJobStartedTime] The time when the - * currently running download (if any) started - */ - inProgressDownloadJobStartedTime?: Date; - /** - * @member {Date} [inProgressInstallJobStartedTime] The time when the - * currently running install (if any) started - */ - inProgressInstallJobStartedTime?: Date; +/** Filters that can be specified for the job */ +export interface JobFilter { + /** The job type. */ + jobType: JobType; + /** The job status. */ + status: JobStatus; + /** The start time of the job. */ + startTime?: Date; } -/** - * @interface - * An interface representing UploadCertificateRequest. - * Upload Certificate Request to IDM - * - */ -export interface UploadCertificateRequest { - /** - * @member {AuthType} [authType] Specify the Authentication type. Possible - * values include: 'Invalid', 'AccessControlService', 'AzureActiveDirectory' - */ - authType?: AuthType; - /** - * @member {string} certificate Gets or sets the base64 encoded certificate - * raw data string - */ - certificate: string; - /** - * @member {ContractVersions} [contractVersion] Gets ContractVersion. - * Possible values include: 'InvalidVersion', 'V2011_09', 'V2012_02', - * 'V2012_05', 'V2012_12', 'V2013_04', 'V2013_10', 'V2013_11', 'V2014_04', - * 'V2014_06', 'V2014_07', 'V2014_09', 'V2014_10', 'V2014_12', 'V2015_01', - * 'V2015_02', 'V2015_04', 'V2015_05', 'V2015_06', 'V2015_07', 'V2015_08', - * 'V2015_10', 'V2015_12', 'V2016_01', 'V2016_02', 'V2016_04', 'V2016_05', - * 'V2016_07', 'V2016_08' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly contractVersion?: ContractVersions; +/** class representing the filters to be passed while fetching metrics */ +export interface MetricFilter { + /** filter for name property */ + name?: MetricNameFilter; + /** starttime for fetching metrics */ + startTime?: Date; + /** endtime for fetching metrics */ + endTime?: Date; + /** timegrain of the metrics */ + timeGrain?: string; } -/** - * @interface - * An interface representing UploadCertificateResponse. - * Upload Certificate Response from IDM - * - * @extends BaseModel - */ -export interface UploadCertificateResponse extends BaseModel { +/** Class representing the name filter to be passed while fetching metrics */ +export interface MetricNameFilter { + /** The value. */ + value?: string; +} + +/** The StorSimple Manager */ +export type Manager = Resource & { + /** ETag of the Manager */ + etag?: string; + /** Specifies if the Manager is Garda or Helsinki */ + cisIntrinsicSettings?: ManagerIntrinsicSettings; + /** Specifies the Sku */ + sku?: ManagerSku; /** - * @member {AuthType} [authType] Specify the Authentication type. Possible - * values include: 'Invalid', 'AccessControlService', 'AzureActiveDirectory' + * Specifies the state of the resource as it is getting provisioned. Value of "Succeeded" means the Manager was successfully created + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: string; +}; + +/** The access control record */ +export type AccessControlRecord = BaseModel & { + /** The Iscsi initiator name (IQN) */ + initiatorName: string; +}; + +/** Alert class */ +export type Alert = BaseModel & { + /** Title of the alert */ + title: string; + /** Device or Resource alert */ + scope: AlertScope; + /** Type of the alert */ + alertType: string; + /** UTC time at which the alert appeared */ + appearedAtTime: Date; + /** UTC time at which the alert appeared on the source */ + appearedAtSourceTime: Date; + /** UTC time at which the alert got cleared */ + clearedAtTime?: Date; + /** UTC time at which the alert was cleared on the source */ + clearedAtSourceTime?: Date; + /** Source at which the alert was cleared */ + source: AlertSource; + /** Recommendation for acting on the alert */ + recommendation?: string; + /** Reason for resolving the alert */ + resolutionReason?: string; + /** Severity of the alert */ + severity: AlertSeverity; + /** Current status of the alert */ + status: AlertStatus; + /** ErrorDetails of the alert */ + errorDetails?: AlertErrorDetails; + /** Other information about the alert */ + detailedInformation?: { [propertyName: string]: string }; +}; + +/** Class represents BackupElement */ +export type BackupElement = BaseModel & { + /** The size in bytes. */ + sizeInBytes: number; + /** The name of the endpoint. */ + endpointName: string; + /** The data policy of backed up endpoint. */ + dataPolicy: DataPolicy; +}; + +/** The backup. */ +export type Backup = BaseModel & { + /** The path id of the target FileServer or IscsiServer for which the backup was taken. */ + targetId?: string; + /** Type of target, FileServer or IscsiServer */ + targetType?: string; + /** The backup size in bytes. */ + sizeInBytes: number; + /** The time when the backup was created. */ + createdTime?: Date; + /** The time when the backup will expire. */ + expirationTime?: Date; + /** Indicates how the backup was initiated "Manual | Scheduled". */ + initiatedBy: InitiatedBy; + /** The Device Identifier. */ + deviceId: string; + /** The backup elements. */ + elements: BackupElement[]; +}; + +/** Upload Certificate Response from IDM */ +export type UploadCertificateResponse = BaseModel & { + /** Specify the Authentication type */ authType?: AuthType; - /** - * @member {string} certificate Gets or sets the base64 encoded certificate - * raw data string - */ + /** Gets or sets the base64 encoded certificate raw data string */ certificate: string; - /** - * @member {number} resourceId Gets or Sets the ResourceId - */ + /** Gets or Sets the ResourceId */ resourceId: number; - /** - * @member {string} aadAuthority AAD tenant authority - */ + /** AAD tenant authority */ aadAuthority: string; - /** - * @member {string} aadTenantId AAD tenant Id - */ + /** AAD tenant Id */ aadTenantId: string; - /** - * @member {string} servicePrincipalClientId AAD service principal clientId - */ + /** AAD service principal clientId */ servicePrincipalClientId: string; - /** - * @member {string} servicePrincipalObjectId AAD service principal ObjectId - */ + /** AAD service principal ObjectId */ servicePrincipalObjectId: string; - /** - * @member {string} azureManagementEndpointAudience Azure Management Endpoint - * Audience - */ + /** Azure Management Endpoint Audience */ azureManagementEndpointAudience: string; - /** - * @member {string} subject Certificate Subject Name - */ + /** Certificate Subject Name */ subject: string; - /** - * @member {Date} validFrom Certificate Validity start Date time - */ + /** Certificate Validity start Date time */ validFrom: Date; + /** Certificate Validity End Date time */ + validTo: Date; + /** Certificate thumbprint */ + thumbprint: string; + /** Certificate friendly name */ + friendlyName: string; + /** Certificate issuer */ + issuer: string; +}; + +/** Represents a StorSimple device object along with its properties */ +export type Device = BaseModel & { + /** The UTC time at which the device was activated */ + activationTime?: Date; + /** Operations that are allowed on the device based on its current state */ + allowedDeviceOperations?: DeviceOperation[]; + /** Language culture setting on the device. For eg: "en-US" */ + culture?: string; + /** Device can be configured either as FileServer or IscsiServer */ + deviceCapabilities?: SupportedDeviceCapabilities[]; + /** Short description given for the device */ + deviceDescription?: string; + /** Fully qualified name of the domain to which the device is attached */ + domainName?: string; + /** Version number of the software running on the device */ + deviceSoftwareVersion?: string; + /** Friendly name for the software version */ + friendlySoftwareName?: string; + /** "Complete" if the device has been successfully registered as File/IscsiServer and the creation of share/volume is complete, "Pending" if the device is only registered but the creation of share/volume is complete is still pending */ + deviceConfigurationStatus?: DeviceConfigurationStatus; + /** Name of the device model */ + modelDescription?: string; + /** Current status of the device */ + status?: DeviceStatus; + /** Type of the device */ + typePropertiesType?: DeviceType; + /** subclass containing more storage-related information about the device. This field will be populated only if the get call is made with $expand = details. */ + details?: DeviceDetails; +}; + +/** AlertSettings on the device which represents how alerts will be processed */ +export type AlertSettings = BaseModel & { + /** Value indicating whether user/admins will receive emails when an alert condition occurs on the system */ + emailNotification: AlertEmailNotificationStatus; + /** Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only if emailNotification flag is Enabled. */ + notificationToServiceOwners: ServiceOwnersAlertNotificationStatus; + /** Culture setting to be used while building alert emails. For eg: "en-US" */ + alertNotificationCulture: string; + /** List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent */ + additionalRecipientEmailList?: string[]; +}; + +/** The File Share. */ +export type FileShare = BaseModel & { + /** Description for file share */ + description?: string; + /** The Share Status */ + shareStatus: ShareStatus; + /** The data policy */ + dataPolicy: DataPolicy; + /** The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz. */ + adminUser: string; + /** The total provisioned capacity in Bytes */ + provisionedCapacityInBytes: number; /** - * @member {Date} validTo Certificate Validity End Date time + * The used capacity in Bytes. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - validTo: Date; + readonly usedCapacityInBytes?: number; /** - * @member {string} thumbprint Certificate thumbrprint + * The local used capacity in Bytes. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - thumbprint: string; + readonly localUsedCapacityInBytes?: number; + /** The monitoring status */ + monitoringStatus: MonitoringStatus; +}; + +/** The iSCSI disk. */ +export type IscsiDisk = BaseModel & { + /** The description. */ + description?: string; + /** The disk status. */ + diskStatus: DiskStatus; + /** The access control records. */ + accessControlRecords: string[]; + /** The data policy. */ + dataPolicy: DataPolicy; + /** The provisioned capacity in bytes. */ + provisionedCapacityInBytes: number; /** - * @member {string} friendlyName Certificate friendlyname + * The used capacity in bytes. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - friendlyName: string; + readonly usedCapacityInBytes?: number; /** - * @member {string} issuer Certificate issuer + * The local used capacity in bytes. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - issuer: string; -} + readonly localUsedCapacityInBytes?: number; + /** The monitoring. */ + monitoringStatus: MonitoringStatus; +}; + +/** The Backup Schedule Group */ +export type BackupScheduleGroup = BaseModel & { + /** The start time. When this field is specified we will generate Default GrandFather Father Son Backup Schedules. */ + startTime: Time; +}; + +/** Challenge-Handshake Authentication Protocol (CHAP) setting */ +export type ChapSettings = BaseModel & { + /** The chap password. */ + password: AsymmetricEncryptedSecret; +}; + +/** The file server. */ +export type FileServer = BaseModel & { + /** Domain of the file server */ + domainName: string; + /** The storage domain id. */ + storageDomainId: string; + /** The backup policy id. */ + backupScheduleGroupId: string; + /** The description of the file server */ + description?: string; +}; + +/** The iSCSI server. */ +export type IscsiServer = BaseModel & { + /** The storage domain id. */ + storageDomainId: string; + /** The backup policy id. */ + backupScheduleGroupId: string; + /** The description. */ + description?: string; + /** The chap id. */ + chapId?: string; + /** The reverse chap id. */ + reverseChapId?: string; +}; + +/** The Job. */ +export type Job = BaseModel & { + /** Current status of the job */ + status: JobStatus; + /** The UTC time at which the job was started */ + startTime?: Date; + /** The UTC time at which the job completed */ + endTime?: Date; + /** The percentage of the job that is already complete */ + percentComplete: number; + /** The Error details. */ + error?: JobErrorDetails; + /** Type of the job */ + jobType?: JobType; + /** Id of the object that is created by the job */ + targetId?: string; + /** The entity identifier for which the job ran. */ + entityId?: string; + /** The entity type for which the job ran. */ + entityType?: string; + /** The job stages. */ + jobStages?: JobStage[]; + /** The device id in which the job is currently running */ + deviceId?: string; + /** Represents whether the job is cancellable or not */ + isCancellable?: boolean; + /** stats properties for the job */ + stats?: JobStats; + /** The target type of the backup. */ + targetType?: TargetType; + /** The source device identifier of the failover job. */ + sourceDeviceId?: string; + /** The time of the backup used for the failover. */ + backupPointInTime?: Date; + /** The download progress. */ + downloadProgress?: UpdateDownloadProgress; + /** The install progress. */ + installProgress?: UpdateInstallProgress; +}; + +/** The NetworkSettings of a device */ +export type NetworkSettings = BaseModel & { + /** The Primary DNS server for the device */ + primaryDnsServer: string; + /** The secondary DNS server for the device */ + secondaryDnsServer?: string; + /** The NetworkAdapters under each node of the device. */ + nodeNetworks: NodeNetwork[]; +}; + +/** The SecuritySettings of a device */ +export type SecuritySettings = BaseModel & { + /** Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to log into the local web UI of the device. Actual password could have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters */ + deviceAdminPassword: AsymmetricEncryptedSecret; +}; + +/** The TimeSettings of a device */ +export type TimeSettings = BaseModel & { + /** The timezone of device, like '(UTC -06:00) Central America' */ + timeZone: string; + /** The primary Network Time Protocol (NTP) server name, like 'time.windows.com'. */ + primaryTimeServer: string; + /** The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional. */ + secondaryTimeServer?: string; +}; + +/** The updates profile */ +export type Updates = BaseModel & { + /** The current Device version. */ + deviceVersion?: string; + /** The last time when the device did an update scan. */ + deviceLastScannedTime?: Date; + /** Set to true if regular updates were detected for the current version of the device. */ + regularUpdatesAvailable?: boolean; + /** Set to true if RegularUpdatesAvailable is true and if at least one of the updateItems detected has needs a reboot to install. */ + rebootRequiredForInstall?: boolean; + /** The total number of items pending for download. */ + totalItemsPendingForDownload?: number; + /** The total number of items pending for install. */ + totalItemsPendingForInstall?: number; + /** The current update operation. */ + status?: UpdateOperation; + /** The time when the last scan job was completed (success|cancelled|failed) on the device. */ + lastCompletedScanTime?: Date; + /** The time when the last Download job was completed (success|cancelled|failed) on the device. */ + lastCompletedDownloadJobTime?: Date; + /** The time when the last Install job was completed (success|cancelled|failed) on the device. */ + lastCompletedInstallJobTime?: Date; + /** If a download is in progress, this field contains the JobId of that particular download job */ + inProgressDownloadJobId?: string; + /** If an install is in progress, this field contains the JobId of that particular install job */ + inProgressInstallJobId?: string; + /** The time when the currently running scan (if any) started */ + inProgressScanStartedTime?: Date; + /** The time when the currently running download (if any) started */ + inProgressDownloadJobStartedTime?: Date; + /** The time when the currently running install (if any) started */ + inProgressInstallJobStartedTime?: Date; +}; -/** - * @interface - * An interface representing ManagersListMetricsOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface ManagersListMetricsOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** The EncryptionSettings */ +export type EncryptionSettings = BaseModel & { + /** The encryption status which indicates if encryption is enabled or not. */ + encryptionStatus: EncryptionStatus; + /** The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then it requires key rollover. */ + keyRolloverStatus: KeyRolloverStatus; +}; -/** - * @interface - * An interface representing AlertsListByManagerOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface AlertsListByManagerOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** The extended info of the manager. */ +export type ManagerExtendedInfo = BaseModel & { + /** ETag of the Resource */ + etag?: string; + /** Represents the version of the ExtendedInfo object being persisted */ + version?: string; + /** Represents the CIK of the resource */ + integrityKey: string; + /** Represents the CEK of the resource */ + encryptionKey?: string; + /** Represents the Cert thumbprint that was used to encrypt the CEK */ + encryptionKeyThumbprint?: string; + /** Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. */ + portalCertificateThumbprint?: string; + /** Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. AlgorithmName - if encryption is used */ + algorithm: string; +}; -/** - * @interface - * An interface representing BackupsListByManagerOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface BackupsListByManagerOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** The storage account credential */ +export type StorageAccountCredential = BaseModel & { + /** The cloud service provider */ + cloudType: CloudType; + /** The storage endpoint */ + endPoint: string; + /** The storage account login */ + login: string; + /** The storage account's geo location */ + location?: string; + /** SSL needs to be enabled or not */ + enableSSL: SslStatus; + /** The details of the storage account password */ + accessKey?: AsymmetricEncryptedSecret; +}; -/** - * @interface - * An interface representing BackupsListByDeviceOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface BackupsListByDeviceOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {boolean} [forFailover] Set to true if you need backups which can - * be used for failover. - */ - forFailover?: boolean; - /** - * @member {string} [filter] OData Filter options - */ +/** The storage domain. */ +export type StorageDomain = BaseModel & { + /** The storage account credentials. */ + storageAccountCredentialIds: string[]; + /** The encryption key used to encrypt the data. This is a user secret. */ + encryptionKey?: AsymmetricEncryptedSecret; + /** The encryption status "Enabled | Disabled". */ + encryptionStatus: EncryptionStatus; +}; +/** Defines values for ManagerType. */ +export type ManagerType = "GardaV1" | "HelsinkiV1"; +/** Defines values for AlertScope. */ +export type AlertScope = "Resource" | "Device"; +/** Defines values for AlertSourceType. */ +export type AlertSourceType = "Resource" | "Device"; +/** Defines values for AlertSeverity. */ +export type AlertSeverity = "Informational" | "Warning" | "Critical"; +/** Defines values for AlertStatus. */ +export type AlertStatus = "Active" | "Cleared"; +/** Defines values for InitiatedBy. */ +export type InitiatedBy = "Manual" | "Scheduled"; +/** Defines values for DataPolicy. */ +export type DataPolicy = "Invalid" | "Local" | "Tiered" | "Cloud"; +/** Defines values for AuthType. */ +export type AuthType = + | "Invalid" + | "AccessControlService" + | "AzureActiveDirectory"; +/** Defines values for ContractVersions. */ +export type ContractVersions = + | "InvalidVersion" + | "V2011_09" + | "V2012_02" + | "V2012_05" + | "V2012_12" + | "V2013_04" + | "V2013_10" + | "V2013_11" + | "V2014_04" + | "V2014_06" + | "V2014_07" + | "V2014_09" + | "V2014_10" + | "V2014_12" + | "V2015_01" + | "V2015_02" + | "V2015_04" + | "V2015_05" + | "V2015_06" + | "V2015_07" + | "V2015_08" + | "V2015_10" + | "V2015_12" + | "V2016_01" + | "V2016_02" + | "V2016_04" + | "V2016_05" + | "V2016_07" + | "V2016_08"; +/** Defines values for DeviceOperation. */ +export type DeviceOperation = + | "None" + | "Delete" + | "DeleteWithWarning" + | "DRSource" + | "DRTarget" + | "Browsable" + | "ReadOnlyForDR" + | "Deactivate"; +/** Defines values for SupportedDeviceCapabilities. */ +export type SupportedDeviceCapabilities = + | "Invalid" + | "FileServer" + | "IscsiServer"; +/** Defines values for DeviceConfigurationStatus. */ +export type DeviceConfigurationStatus = "Complete" | "Pending"; +/** Defines values for DeviceStatus. */ +export type DeviceStatus = + | "Unknown" + | "Online" + | "Offline" + | "RequiresAttention" + | "MaintenanceMode" + | "Creating" + | "Provisioning" + | "Deleted" + | "ReadyToSetup" + | "Deactivated" + | "Deactivating"; +/** Defines values for DeviceType. */ +export type DeviceType = + | "Invalid" + | "Appliance" + | "VirtualAppliance" + | "Series9000OnPremVirtualAppliance" + | "Series9000VirtualAppliance" + | "Series9000PhysicalAppliance"; +/** Defines values for AlertEmailNotificationStatus. */ +export type AlertEmailNotificationStatus = "Enabled" | "Disabled"; +/** Defines values for ServiceOwnersAlertNotificationStatus. */ +export type ServiceOwnersAlertNotificationStatus = "Enabled" | "Disabled"; +/** Defines values for ShareStatus. */ +export type ShareStatus = "Online" | "Offline"; +/** Defines values for MonitoringStatus. */ +export type MonitoringStatus = "Enabled" | "Disabled"; +/** Defines values for DiskStatus. */ +export type DiskStatus = "Online" | "Offline"; +/** Defines values for EncryptionAlgorithm. */ +export type EncryptionAlgorithm = "None" | "AES256" | "RSAES_PKCS1_v_1_5"; +/** Defines values for MetricAggregationType. */ +export type MetricAggregationType = + | "Average" + | "Last" + | "Maximum" + | "Minimum" + | "None" + | "Total"; +/** Defines values for MetricUnit. */ +export type MetricUnit = + | "Bytes" + | "BytesPerSecond" + | "Count" + | "CountPerSecond" + | "Percent" + | "Seconds"; +/** Defines values for JobStatus. */ +export type JobStatus = + | "Invalid" + | "Running" + | "Succeeded" + | "Failed" + | "Canceled" + | "Paused" + | "Scheduled"; +/** Defines values for JobType. */ +export type JobType = + | "Backup" + | "Clone" + | "Failover" + | "DownloadUpdates" + | "InstallUpdates"; +/** Defines values for TargetType. */ +export type TargetType = "FileServer" | "DiskServer"; +/** Defines values for DownloadPhase. */ +export type DownloadPhase = + | "Unknown" + | "Initializing" + | "Downloading" + | "Verifying"; +/** Defines values for DhcpStatus. */ +export type DhcpStatus = "Enabled" | "Disabled"; +/** Defines values for UpdateOperation. */ +export type UpdateOperation = + | "Idle" + | "Scanning" + | "Downloading" + | "Installing"; +/** Defines values for EncryptionStatus. */ +export type EncryptionStatus = "Enabled" | "Disabled"; +/** Defines values for KeyRolloverStatus. */ +export type KeyRolloverStatus = "Required" | "NotRequired"; +/** Defines values for CloudType. */ +export type CloudType = "Azure" | "S3" | "S3_RRS" | "OpenStack" | "HP"; +/** Defines values for SslStatus. */ +export type SslStatus = "Enabled" | "Disabled"; + +/** Optional parameters. */ +export interface ManagersListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ManagersListResponse = ManagerList; + +/** Optional parameters. */ +export interface ManagersListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ManagersListByResourceGroupResponse = ManagerList; + +/** Optional parameters. */ +export interface ManagersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ManagersGetResponse = Manager; + +/** Optional parameters. */ +export interface ManagersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ManagersCreateOrUpdateResponse = Manager; + +/** Optional parameters. */ +export interface ManagersDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ManagersUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ManagersUpdateResponse = Manager; + +/** Optional parameters. */ +export interface ManagersUploadRegistrationCertificateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the uploadRegistrationCertificate operation. */ +export type ManagersUploadRegistrationCertificateResponse = UploadCertificateResponse; + +/** Optional parameters. */ +export interface ManagersGetEncryptionSettingsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getEncryptionSettings operation. */ +export type ManagersGetEncryptionSettingsResponse = EncryptionSettings; + +/** Optional parameters. */ +export interface ManagersGetExtendedInfoOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getExtendedInfo operation. */ +export type ManagersGetExtendedInfoResponse = ManagerExtendedInfo; + +/** Optional parameters. */ +export interface ManagersCreateExtendedInfoOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createExtendedInfo operation. */ +export type ManagersCreateExtendedInfoResponse = ManagerExtendedInfo; + +/** Optional parameters. */ +export interface ManagersDeleteExtendedInfoOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ManagersUpdateExtendedInfoOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the updateExtendedInfo operation. */ +export type ManagersUpdateExtendedInfoResponse = ManagerExtendedInfo; + +/** Optional parameters. */ +export interface ManagersGetEncryptionKeyOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getEncryptionKey operation. */ +export type ManagersGetEncryptionKeyResponse = SymmetricEncryptedSecret; + +/** Optional parameters. */ +export interface ManagersListMetricsOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ filter?: string; } -/** - * @interface - * An interface representing DevicesListByManagerOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface DevicesListByManagerOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [expand] Specify $expand=details to populate additional - * fields related to the device. - */ - expand?: string; -} +/** Contains response data for the listMetrics operation. */ +export type ManagersListMetricsResponse = MetricList; -/** - * @interface - * An interface representing DevicesGetOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface DevicesGetOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [expand] Specify $expand=details to populate additional - * fields related to the device. - */ - expand?: string; -} +/** Optional parameters. */ +export interface ManagersListMetricDefinitionOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing DevicesListFailoverTargetOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface DevicesListFailoverTargetOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [expand] Specify $expand=details to populate additional - * fields related to the device. - */ - expand?: string; -} +/** Contains response data for the listMetricDefinition operation. */ +export type ManagersListMetricDefinitionResponse = MetricDefinitionList; -/** - * @interface - * An interface representing DevicesListMetricsOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface DevicesListMetricsOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** Optional parameters. */ +export interface AvailableProviderOperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing IscsiDisksListMetricsOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface IscsiDisksListMetricsOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** Contains response data for the list operation. */ +export type AvailableProviderOperationsListResponse = AvailableProviderOperations; -/** - * @interface - * An interface representing FileServersListMetricsOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface FileServersListMetricsOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** Optional parameters. */ +export interface AvailableProviderOperationsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing FileSharesListMetricsOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface FileSharesListMetricsOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** Contains response data for the listNext operation. */ +export type AvailableProviderOperationsListNextResponse = AvailableProviderOperations; -/** - * @interface - * An interface representing IscsiServersListMetricsOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface IscsiServersListMetricsOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** Optional parameters. */ +export interface AccessControlRecordsListByManagerOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing JobsListByDeviceOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface JobsListByDeviceOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** Contains response data for the listByManager operation. */ +export type AccessControlRecordsListByManagerResponse = AccessControlRecordList; -/** - * @interface - * An interface representing JobsListByManagerOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface JobsListByManagerOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** Optional parameters. */ +export interface AccessControlRecordsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing StorSimpleManagementClientOptions. - * @extends AzureServiceClientOptions - */ -export interface StorSimpleManagementClientOptions extends AzureServiceClientOptions { - /** - * @member {string} [baseUri] - */ - baseUri?: string; +/** Contains response data for the get operation. */ +export type AccessControlRecordsGetResponse = AccessControlRecord; + +/** Optional parameters. */ +export interface AccessControlRecordsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } +/** Contains response data for the createOrUpdate operation. */ +export type AccessControlRecordsCreateOrUpdateResponse = AccessControlRecord; -/** - * @interface - * An interface representing the ManagerList. - * List of storsimple Managers under a particular resourceGroup - * - * @extends Array - */ -export interface ManagerList extends Array { +/** Optional parameters. */ +export interface AccessControlRecordsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * An interface representing the MetricList. - * Collection of metrics - * - * @extends Array - */ -export interface MetricList extends Array { +/** Optional parameters. */ +export interface AlertsListByManagerOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; } -/** - * @interface - * An interface representing the MetricDefinitionList. - * List of metric definition - * - * @extends Array - */ -export interface MetricDefinitionList extends Array { -} +/** Contains response data for the listByManager operation. */ +export type AlertsListByManagerResponse = AlertList; -/** - * @interface - * An interface representing the AvailableProviderOperations. - * Class for set of operations used for discovery of available provider - * operations. - * - * @extends Array - */ -export interface AvailableProviderOperations extends Array { - /** - * @member {string} [nextLink] The NextLink. - */ - nextLink?: string; -} +/** Optional parameters. */ +export interface AlertsClearOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the AccessControlRecordList. - * Collection of AccessControlRecords - * - * @extends Array - */ -export interface AccessControlRecordList extends Array { -} +/** Optional parameters. */ +export interface AlertsSendTestEmailOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the AlertList. - * Collection of Alerts - * - * @extends Array - */ -export interface AlertList extends Array { - /** - * @member {string} [nextLink] Id of the next page of alerts - */ - nextLink?: string; +/** Optional parameters. */ +export interface AlertsListByManagerNextOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; } -/** - * @interface - * An interface representing the BackupList. - * Collection of backups - * - * @extends Array - */ -export interface BackupList extends Array { - /** - * @member {string} [nextLink] The NextLink. - */ - nextLink?: string; -} +/** Contains response data for the listByManagerNext operation. */ +export type AlertsListByManagerNextResponse = AlertList; -/** - * @interface - * An interface representing the DeviceList. - * Collection of Devices - * - * @extends Array - */ -export interface DeviceList extends Array { +/** Optional parameters. */ +export interface BackupsListByManagerOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; } -/** - * @interface - * An interface representing the BackupScheduleGroupList. - * The list response of backup schedule groups - * - * @extends Array - */ -export interface BackupScheduleGroupList extends Array { -} +/** Contains response data for the listByManager operation. */ +export type BackupsListByManagerResponse = BackupList; -/** - * @interface - * An interface representing the ChapSettingsList. - * Collection of Chap setting entities - * - * @extends Array - */ -export interface ChapSettingsList extends Array { +/** Optional parameters. */ +export interface BackupsListByDeviceOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; + /** Set to true if you need backups which can be used for failover. */ + forFailover?: boolean; } -/** - * @interface - * An interface representing the ISCSIDiskList. - * Collection of Iscsi disk - * - * @extends Array - */ -export interface ISCSIDiskList extends Array { -} +/** Contains response data for the listByDevice operation. */ +export type BackupsListByDeviceResponse = BackupList; -/** - * @interface - * An interface representing the FileServerList. - * Collection of file servers - * - * @extends Array - */ -export interface FileServerList extends Array { +/** Optional parameters. */ +export interface BackupsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * An interface representing the FileShareList. - * Collection of file shares - * - * @extends Array - */ -export interface FileShareList extends Array { +/** Optional parameters. */ +export interface BackupsCloneOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * An interface representing the ISCSIServerList. - * Collection of Iscsi servers - * - * @extends Array - */ -export interface ISCSIServerList extends Array { +/** Optional parameters. */ +export interface BackupsListByManagerNextOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; } -/** - * @interface - * An interface representing the JobList. - * Collection of jobs - * - * @extends Array - */ -export interface JobList extends Array { - /** - * @member {string} [nextLink] The NextLink. - */ - nextLink?: string; -} +/** Contains response data for the listByManagerNext operation. */ +export type BackupsListByManagerNextResponse = BackupList; -/** - * @interface - * An interface representing the StorageAccountCredentialList. - * Collection of Storage account credential entities - * - * @extends Array - */ -export interface StorageAccountCredentialList extends Array { +/** Optional parameters. */ +export interface BackupsListByDeviceNextOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; + /** Set to true if you need backups which can be used for failover. */ + forFailover?: boolean; } -/** - * @interface - * An interface representing the StorageDomainList. - * Collection of storage domains - * - * @extends Array - */ -export interface StorageDomainList extends Array { +/** Contains response data for the listByDeviceNext operation. */ +export type BackupsListByDeviceNextResponse = BackupList; + +/** Optional parameters. */ +export interface DevicesListByManagerOptionalParams + extends coreClient.OperationOptions { + /** Specify $expand=details to populate additional fields related to the device. */ + expand?: string; } -/** - * Defines values for AlertScope. - * Possible values include: 'Resource', 'Device' - * @readonly - * @enum {string} - */ -export type AlertScope = 'Resource' | 'Device'; +/** Contains response data for the listByManager operation. */ +export type DevicesListByManagerResponse = DeviceList; -/** - * Defines values for AlertSourceType. - * Possible values include: 'Resource', 'Device' - * @readonly - * @enum {string} - */ -export type AlertSourceType = 'Resource' | 'Device'; +/** Optional parameters. */ +export interface DevicesGetOptionalParams extends coreClient.OperationOptions { + /** Specify $expand=details to populate additional fields related to the device. */ + expand?: string; +} -/** - * Defines values for AlertSeverity. - * Possible values include: 'Informational', 'Warning', 'Critical' - * @readonly - * @enum {string} - */ -export type AlertSeverity = 'Informational' | 'Warning' | 'Critical'; +/** Contains response data for the get operation. */ +export type DevicesGetResponse = Device; -/** - * Defines values for AlertStatus. - * Possible values include: 'Active', 'Cleared' - * @readonly - * @enum {string} - */ -export type AlertStatus = 'Active' | 'Cleared'; +/** Optional parameters. */ +export interface DevicesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for AlertEmailNotificationStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type AlertEmailNotificationStatus = 'Enabled' | 'Disabled'; +/** Optional parameters. */ +export interface DevicesPatchOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for ServiceOwnersAlertNotificationStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type ServiceOwnersAlertNotificationStatus = 'Enabled' | 'Disabled'; +/** Contains response data for the patch operation. */ +export type DevicesPatchResponse = Device; -/** - * Defines values for EncryptionAlgorithm. - * Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' - * @readonly - * @enum {string} - */ -export type EncryptionAlgorithm = 'None' | 'AES256' | 'RSAES_PKCS1_v_1_5'; +/** Optional parameters. */ +export interface DevicesGetAlertSettingsOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for InitiatedBy. - * Possible values include: 'Manual', 'Scheduled' - * @readonly - * @enum {string} - */ -export type InitiatedBy = 'Manual' | 'Scheduled'; +/** Contains response data for the getAlertSettings operation. */ +export type DevicesGetAlertSettingsResponse = AlertSettings; -/** - * Defines values for DataPolicy. - * Possible values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * @readonly - * @enum {string} - */ -export type DataPolicy = 'Invalid' | 'Local' | 'Tiered' | 'Cloud'; +/** Optional parameters. */ +export interface DevicesCreateOrUpdateAlertSettingsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for ShareStatus. - * Possible values include: 'Online', 'Offline' - * @readonly - * @enum {string} - */ -export type ShareStatus = 'Online' | 'Offline'; +/** Contains response data for the createOrUpdateAlertSettings operation. */ +export type DevicesCreateOrUpdateAlertSettingsResponse = AlertSettings; -/** - * Defines values for MonitoringStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type MonitoringStatus = 'Enabled' | 'Disabled'; +/** Optional parameters. */ +export interface DevicesDeactivateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for DiskStatus. - * Possible values include: 'Online', 'Offline' - * @readonly - * @enum {string} - */ -export type DiskStatus = 'Online' | 'Offline'; +/** Optional parameters. */ +export interface DevicesDownloadUpdatesOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for DeviceOperation. - * Possible values include: 'None', 'Delete', 'DeleteWithWarning', 'DRSource', 'DRTarget', - * 'Browsable', 'ReadOnlyForDR', 'Deactivate' - * @readonly - * @enum {string} - */ -export type DeviceOperation = 'None' | 'Delete' | 'DeleteWithWarning' | 'DRSource' | 'DRTarget' | 'Browsable' | 'ReadOnlyForDR' | 'Deactivate'; +/** Optional parameters. */ +export interface DevicesFailoverOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for SupportedDeviceCapabilities. - * Possible values include: 'Invalid', 'FileServer', 'IscsiServer' - * @readonly - * @enum {string} - */ -export type SupportedDeviceCapabilities = 'Invalid' | 'FileServer' | 'IscsiServer'; +/** Optional parameters. */ +export interface DevicesListFailoverTargetOptionalParams + extends coreClient.OperationOptions { + /** Specify $expand=details to populate additional fields related to the device. */ + expand?: string; +} + +/** Contains response data for the listFailoverTarget operation. */ +export type DevicesListFailoverTargetResponse = DeviceList; -/** - * Defines values for DeviceConfigurationStatus. - * Possible values include: 'Complete', 'Pending' - * @readonly - * @enum {string} - */ -export type DeviceConfigurationStatus = 'Complete' | 'Pending'; +/** Optional parameters. */ +export interface DevicesInstallUpdatesOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for DeviceStatus. - * Possible values include: 'Unknown', 'Online', 'Offline', 'RequiresAttention', 'MaintenanceMode', - * 'Creating', 'Provisioning', 'Deleted', 'ReadyToSetup', 'Deactivated', 'Deactivating' - * @readonly - * @enum {string} - */ -export type DeviceStatus = 'Unknown' | 'Online' | 'Offline' | 'RequiresAttention' | 'MaintenanceMode' | 'Creating' | 'Provisioning' | 'Deleted' | 'ReadyToSetup' | 'Deactivated' | 'Deactivating'; +/** Optional parameters. */ +export interface DevicesListMetricsOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Defines values for DeviceType. - * Possible values include: 'Invalid', 'Appliance', 'VirtualAppliance', - * 'Series9000OnPremVirtualAppliance', 'Series9000VirtualAppliance', 'Series9000PhysicalAppliance' - * @readonly - * @enum {string} - */ -export type DeviceType = 'Invalid' | 'Appliance' | 'VirtualAppliance' | 'Series9000OnPremVirtualAppliance' | 'Series9000VirtualAppliance' | 'Series9000PhysicalAppliance'; +/** Contains response data for the listMetrics operation. */ +export type DevicesListMetricsResponse = MetricList; -/** - * Defines values for EncryptionStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type EncryptionStatus = 'Enabled' | 'Disabled'; +/** Optional parameters. */ +export interface DevicesListMetricDefinitionOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for KeyRolloverStatus. - * Possible values include: 'Required', 'NotRequired' - * @readonly - * @enum {string} - */ -export type KeyRolloverStatus = 'Required' | 'NotRequired'; +/** Contains response data for the listMetricDefinition operation. */ +export type DevicesListMetricDefinitionResponse = MetricDefinitionList; -/** - * Defines values for JobStatus. - * Possible values include: 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', - * 'Scheduled' - * @readonly - * @enum {string} - */ -export type JobStatus = 'Invalid' | 'Running' | 'Succeeded' | 'Failed' | 'Canceled' | 'Paused' | 'Scheduled'; +/** Optional parameters. */ +export interface DevicesGetNetworkSettingsOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for JobType. - * Possible values include: 'Backup', 'Clone', 'Failover', 'DownloadUpdates', 'InstallUpdates' - * @readonly - * @enum {string} - */ -export type JobType = 'Backup' | 'Clone' | 'Failover' | 'DownloadUpdates' | 'InstallUpdates'; +/** Contains response data for the getNetworkSettings operation. */ +export type DevicesGetNetworkSettingsResponse = NetworkSettings; -/** - * Defines values for TargetType. - * Possible values include: 'FileServer', 'DiskServer' - * @readonly - * @enum {string} - */ -export type TargetType = 'FileServer' | 'DiskServer'; +/** Optional parameters. */ +export interface DevicesScanForUpdatesOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for DownloadPhase. - * Possible values include: 'Unknown', 'Initializing', 'Downloading', 'Verifying' - * @readonly - * @enum {string} - */ -export type DownloadPhase = 'Unknown' | 'Initializing' | 'Downloading' | 'Verifying'; +/** Optional parameters. */ +export interface DevicesCreateOrUpdateSecuritySettingsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for ManagerType. - * Possible values include: 'GardaV1', 'HelsinkiV1' - * @readonly - * @enum {string} - */ -export type ManagerType = 'GardaV1' | 'HelsinkiV1'; +/** Optional parameters. */ +export interface DevicesGetTimeSettingsOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for MetricUnit. - * Possible values include: 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', - * 'Seconds' - * @readonly - * @enum {string} - */ -export type MetricUnit = 'Bytes' | 'BytesPerSecond' | 'Count' | 'CountPerSecond' | 'Percent' | 'Seconds'; +/** Contains response data for the getTimeSettings operation. */ +export type DevicesGetTimeSettingsResponse = TimeSettings; -/** - * Defines values for MetricAggregationType. - * Possible values include: 'Average', 'Last', 'Maximum', 'Minimum', 'None', 'Total' - * @readonly - * @enum {string} - */ -export type MetricAggregationType = 'Average' | 'Last' | 'Maximum' | 'Minimum' | 'None' | 'Total'; +/** Optional parameters. */ +export interface DevicesGetUpdateSummaryOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for DhcpStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type DhcpStatus = 'Enabled' | 'Disabled'; +/** Contains response data for the getUpdateSummary operation. */ +export type DevicesGetUpdateSummaryResponse = Updates; -/** - * Defines values for AuthType. - * Possible values include: 'Invalid', 'AccessControlService', 'AzureActiveDirectory' - * @readonly - * @enum {string} - */ -export type AuthType = 'Invalid' | 'AccessControlService' | 'AzureActiveDirectory'; +/** Optional parameters. */ +export interface BackupScheduleGroupsListByDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for CloudType. - * Possible values include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * @readonly - * @enum {string} - */ -export type CloudType = 'Azure' | 'S3' | 'S3_RRS' | 'OpenStack' | 'HP'; +/** Contains response data for the listByDevice operation. */ +export type BackupScheduleGroupsListByDeviceResponse = BackupScheduleGroupList; -/** - * Defines values for SslStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type SslStatus = 'Enabled' | 'Disabled'; +/** Optional parameters. */ +export interface BackupScheduleGroupsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for UpdateOperation. - * Possible values include: 'Idle', 'Scanning', 'Downloading', 'Installing' - * @readonly - * @enum {string} - */ -export type UpdateOperation = 'Idle' | 'Scanning' | 'Downloading' | 'Installing'; +/** Contains response data for the get operation. */ +export type BackupScheduleGroupsGetResponse = BackupScheduleGroup; -/** - * Defines values for ContractVersions. - * Possible values include: 'InvalidVersion', 'V2011_09', 'V2012_02', 'V2012_05', 'V2012_12', - * 'V2013_04', 'V2013_10', 'V2013_11', 'V2014_04', 'V2014_06', 'V2014_07', 'V2014_09', 'V2014_10', - * 'V2014_12', 'V2015_01', 'V2015_02', 'V2015_04', 'V2015_05', 'V2015_06', 'V2015_07', 'V2015_08', - * 'V2015_10', 'V2015_12', 'V2016_01', 'V2016_02', 'V2016_04', 'V2016_05', 'V2016_07', 'V2016_08' - * @readonly - * @enum {string} - */ -export type ContractVersions = 'InvalidVersion' | 'V2011_09' | 'V2012_02' | 'V2012_05' | 'V2012_12' | 'V2013_04' | 'V2013_10' | 'V2013_11' | 'V2014_04' | 'V2014_06' | 'V2014_07' | 'V2014_09' | 'V2014_10' | 'V2014_12' | 'V2015_01' | 'V2015_02' | 'V2015_04' | 'V2015_05' | 'V2015_06' | 'V2015_07' | 'V2015_08' | 'V2015_10' | 'V2015_12' | 'V2016_01' | 'V2016_02' | 'V2016_04' | 'V2016_05' | 'V2016_07' | 'V2016_08'; +/** Optional parameters. */ +export interface BackupScheduleGroupsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the list operation. - */ -export type ManagersListResponse = ManagerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagerList; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type BackupScheduleGroupsCreateOrUpdateResponse = BackupScheduleGroup; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ManagersListByResourceGroupResponse = ManagerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagerList; - }; -}; +/** Optional parameters. */ +export interface BackupScheduleGroupsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the get operation. - */ -export type ManagersGetResponse = Manager & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Manager; - }; -}; +/** Optional parameters. */ +export interface ChapSettingsListByDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ManagersCreateOrUpdateResponse = Manager & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Manager; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type ChapSettingsListByDeviceResponse = ChapSettingsList; -/** - * Contains response data for the update operation. - */ -export type ManagersUpdateResponse = Manager & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Manager; - }; -}; +/** Optional parameters. */ +export interface ChapSettingsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the uploadRegistrationCertificate operation. - */ -export type ManagersUploadRegistrationCertificateResponse = UploadCertificateResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: UploadCertificateResponse; - }; -}; +/** Contains response data for the get operation. */ +export type ChapSettingsGetResponse = ChapSettings; -/** - * Contains response data for the getEncryptionSettings operation. - */ -export type ManagersGetEncryptionSettingsResponse = EncryptionSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: EncryptionSettings; - }; -}; +/** Optional parameters. */ +export interface ChapSettingsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the getExtendedInfo operation. - */ -export type ManagersGetExtendedInfoResponse = ManagerExtendedInfo & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagerExtendedInfo; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type ChapSettingsCreateOrUpdateResponse = ChapSettings; -/** - * Contains response data for the createExtendedInfo operation. - */ -export type ManagersCreateExtendedInfoResponse = ManagerExtendedInfo & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagerExtendedInfo; - }; -}; +/** Optional parameters. */ +export interface ChapSettingsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the updateExtendedInfo operation. - */ -export type ManagersUpdateExtendedInfoResponse = ManagerExtendedInfo & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagerExtendedInfo; - }; -}; +/** Optional parameters. */ +export interface IscsiDisksListByDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getEncryptionKey operation. - */ -export type ManagersGetEncryptionKeyResponse = SymmetricEncryptedSecret & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SymmetricEncryptedSecret; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type IscsiDisksListByDeviceResponse = IscsiDiskList; -/** - * Contains response data for the listMetrics operation. - */ -export type ManagersListMetricsResponse = MetricList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricList; - }; -}; +/** Optional parameters. */ +export interface IscsiDisksListByIscsiServerOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listMetricDefinition operation. - */ -export type ManagersListMetricDefinitionResponse = MetricDefinitionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricDefinitionList; - }; -}; +/** Contains response data for the listByIscsiServer operation. */ +export type IscsiDisksListByIscsiServerResponse = IscsiDiskList; -/** - * Contains response data for the list operation. - */ -export type AvailableProviderOperationsListResponse = AvailableProviderOperations & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AvailableProviderOperations; - }; -}; +/** Optional parameters. */ +export interface IscsiDisksGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type AvailableProviderOperationsListNextResponse = AvailableProviderOperations & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AvailableProviderOperations; - }; -}; +/** Contains response data for the get operation. */ +export type IscsiDisksGetResponse = IscsiDisk; -/** - * Contains response data for the listByManager operation. - */ -export type AccessControlRecordsListByManagerResponse = AccessControlRecordList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessControlRecordList; - }; -}; +/** Optional parameters. */ +export interface IscsiDisksCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the get operation. - */ -export type AccessControlRecordsGetResponse = AccessControlRecord & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessControlRecord; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type IscsiDisksCreateOrUpdateResponse = IscsiDisk; -/** - * Contains response data for the createOrUpdate operation. - */ -export type AccessControlRecordsCreateOrUpdateResponse = AccessControlRecord & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessControlRecord; - }; -}; +/** Optional parameters. */ +export interface IscsiDisksDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type AccessControlRecordsBeginCreateOrUpdateResponse = AccessControlRecord & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessControlRecord; - }; -}; +/** Optional parameters. */ +export interface IscsiDisksListMetricsOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the listByManager operation. - */ -export type AlertsListByManagerResponse = AlertList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertList; - }; -}; +/** Contains response data for the listMetrics operation. */ +export type IscsiDisksListMetricsResponse = MetricList; -/** - * Contains response data for the listByManagerNext operation. - */ -export type AlertsListByManagerNextResponse = AlertList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertList; - }; -}; +/** Optional parameters. */ +export interface IscsiDisksListMetricDefinitionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByManager operation. - */ -export type BackupsListByManagerResponse = BackupList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupList; - }; -}; +/** Contains response data for the listMetricDefinition operation. */ +export type IscsiDisksListMetricDefinitionResponse = MetricDefinitionList; -/** - * Contains response data for the listByDevice operation. - */ -export type BackupsListByDeviceResponse = BackupList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupList; - }; -}; +/** Optional parameters. */ +export interface FileServersListByDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByManagerNext operation. - */ -export type BackupsListByManagerNextResponse = BackupList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupList; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type FileServersListByDeviceResponse = FileServerList; -/** - * Contains response data for the listByDeviceNext operation. - */ -export type BackupsListByDeviceNextResponse = BackupList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupList; - }; -}; +/** Optional parameters. */ +export interface FileServersGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByManager operation. - */ -export type DevicesListByManagerResponse = DeviceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: DeviceList; - }; -}; +/** Contains response data for the get operation. */ +export type FileServersGetResponse = FileServer; -/** - * Contains response data for the get operation. - */ -export type DevicesGetResponse = Device & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Device; - }; -}; +/** Optional parameters. */ +export interface FileServersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the patch operation. - */ -export type DevicesPatchResponse = Device & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Device; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type FileServersCreateOrUpdateResponse = FileServer; -/** - * Contains response data for the getAlertSettings operation. - */ -export type DevicesGetAlertSettingsResponse = AlertSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertSettings; - }; -}; +/** Optional parameters. */ +export interface FileServersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the createOrUpdateAlertSettings operation. - */ -export type DevicesCreateOrUpdateAlertSettingsResponse = AlertSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertSettings; - }; -}; +/** Optional parameters. */ +export interface FileServersBackupNowOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listFailoverTarget operation. - */ -export type DevicesListFailoverTargetResponse = DeviceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: DeviceList; - }; -}; +/** Optional parameters. */ +export interface FileServersListMetricsOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the listMetrics operation. - */ -export type DevicesListMetricsResponse = MetricList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricList; - }; -}; +/** Contains response data for the listMetrics operation. */ +export type FileServersListMetricsResponse = MetricList; -/** - * Contains response data for the listMetricDefinition operation. - */ -export type DevicesListMetricDefinitionResponse = MetricDefinitionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricDefinitionList; - }; -}; +/** Optional parameters. */ +export interface FileServersListMetricDefinitionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getNetworkSettings operation. - */ -export type DevicesGetNetworkSettingsResponse = NetworkSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: NetworkSettings; - }; -}; +/** Contains response data for the listMetricDefinition operation. */ +export type FileServersListMetricDefinitionResponse = MetricDefinitionList; -/** - * Contains response data for the getTimeSettings operation. - */ -export type DevicesGetTimeSettingsResponse = TimeSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TimeSettings; - }; -}; +/** Optional parameters. */ +export interface FileServersListByManagerOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getUpdateSummary operation. - */ -export type DevicesGetUpdateSummaryResponse = Updates & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Updates; - }; -}; +/** Contains response data for the listByManager operation. */ +export type FileServersListByManagerResponse = FileServerList; -/** - * Contains response data for the beginPatch operation. - */ -export type DevicesBeginPatchResponse = Device & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Device; - }; -}; +/** Optional parameters. */ +export interface FileSharesListByFileServerOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdateAlertSettings operation. - */ -export type DevicesBeginCreateOrUpdateAlertSettingsResponse = AlertSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertSettings; - }; -}; +/** Contains response data for the listByFileServer operation. */ +export type FileSharesListByFileServerResponse = FileShareList; -/** - * Contains response data for the listByDevice operation. - */ -export type BackupScheduleGroupsListByDeviceResponse = BackupScheduleGroupList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupScheduleGroupList; - }; -}; +/** Optional parameters. */ +export interface FileSharesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type BackupScheduleGroupsGetResponse = BackupScheduleGroup & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupScheduleGroup; - }; -}; +/** Contains response data for the get operation. */ +export type FileSharesGetResponse = FileShare; + +/** Optional parameters. */ +export interface FileSharesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type BackupScheduleGroupsCreateOrUpdateResponse = BackupScheduleGroup & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupScheduleGroup; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type FileSharesCreateOrUpdateResponse = FileShare; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type BackupScheduleGroupsBeginCreateOrUpdateResponse = BackupScheduleGroup & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupScheduleGroup; - }; -}; +/** Optional parameters. */ +export interface FileSharesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByDevice operation. - */ -export type ChapSettingsListByDeviceResponse = ChapSettingsList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChapSettingsList; - }; -}; +/** Optional parameters. */ +export interface FileSharesListMetricsOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the get operation. - */ -export type ChapSettingsGetResponse = ChapSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChapSettings; - }; -}; +/** Contains response data for the listMetrics operation. */ +export type FileSharesListMetricsResponse = MetricList; -/** - * Contains response data for the createOrUpdate operation. - */ -export type ChapSettingsCreateOrUpdateResponse = ChapSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChapSettings; - }; -}; +/** Optional parameters. */ +export interface FileSharesListMetricDefinitionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type ChapSettingsBeginCreateOrUpdateResponse = ChapSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ChapSettings; - }; -}; +/** Contains response data for the listMetricDefinition operation. */ +export type FileSharesListMetricDefinitionResponse = MetricDefinitionList; -/** - * Contains response data for the listByDevice operation. - */ -export type IscsiDisksListByDeviceResponse = ISCSIDiskList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ISCSIDiskList; - }; -}; +/** Optional parameters. */ +export interface FileSharesListByDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByIscsiServer operation. - */ -export type IscsiDisksListByIscsiServerResponse = ISCSIDiskList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ISCSIDiskList; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type FileSharesListByDeviceResponse = FileShareList; -/** - * Contains response data for the get operation. - */ -export type IscsiDisksGetResponse = ISCSIDisk & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ISCSIDisk; - }; -}; +/** Optional parameters. */ +export interface IscsiServersListByDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type IscsiDisksCreateOrUpdateResponse = ISCSIDisk & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ISCSIDisk; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type IscsiServersListByDeviceResponse = IscsiServerList; -/** - * Contains response data for the listMetrics operation. - */ -export type IscsiDisksListMetricsResponse = MetricList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricList; - }; -}; +/** Optional parameters. */ +export interface IscsiServersGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listMetricDefinition operation. - */ -export type IscsiDisksListMetricDefinitionResponse = MetricDefinitionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricDefinitionList; - }; -}; +/** Contains response data for the get operation. */ +export type IscsiServersGetResponse = IscsiServer; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type IscsiDisksBeginCreateOrUpdateResponse = ISCSIDisk & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ISCSIDisk; - }; -}; +/** Optional parameters. */ +export interface IscsiServersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByDevice operation. - */ -export type FileServersListByDeviceResponse = FileServerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FileServerList; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type IscsiServersCreateOrUpdateResponse = IscsiServer; -/** - * Contains response data for the get operation. - */ -export type FileServersGetResponse = FileServer & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FileServer; - }; -}; +/** Optional parameters. */ +export interface IscsiServersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type FileServersCreateOrUpdateResponse = FileServer & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FileServer; - }; -}; +/** Optional parameters. */ +export interface IscsiServersBackupNowOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listMetrics operation. - */ -export type FileServersListMetricsResponse = MetricList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricList; - }; -}; +/** Optional parameters. */ +export interface IscsiServersListMetricsOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the listMetricDefinition operation. - */ -export type FileServersListMetricDefinitionResponse = MetricDefinitionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricDefinitionList; - }; -}; +/** Contains response data for the listMetrics operation. */ +export type IscsiServersListMetricsResponse = MetricList; -/** - * Contains response data for the listByManager operation. - */ -export type FileServersListByManagerResponse = FileServerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FileServerList; - }; -}; +/** Optional parameters. */ +export interface IscsiServersListMetricDefinitionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type FileServersBeginCreateOrUpdateResponse = FileServer & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FileServer; - }; -}; +/** Contains response data for the listMetricDefinition operation. */ +export type IscsiServersListMetricDefinitionResponse = MetricDefinitionList; -/** - * Contains response data for the listByFileServer operation. - */ -export type FileSharesListByFileServerResponse = FileShareList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FileShareList; - }; -}; +/** Optional parameters. */ +export interface IscsiServersListByManagerOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type FileSharesGetResponse = FileShare & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FileShare; - }; -}; +/** Contains response data for the listByManager operation. */ +export type IscsiServersListByManagerResponse = IscsiServerList; -/** - * Contains response data for the createOrUpdate operation. - */ -export type FileSharesCreateOrUpdateResponse = FileShare & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FileShare; - }; -}; +/** Optional parameters. */ +export interface JobsListByDeviceOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the listMetrics operation. - */ -export type FileSharesListMetricsResponse = MetricList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricList; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type JobsListByDeviceResponse = JobList; -/** - * Contains response data for the listMetricDefinition operation. - */ -export type FileSharesListMetricDefinitionResponse = MetricDefinitionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricDefinitionList; - }; -}; +/** Optional parameters. */ +export interface JobsGetOptionalParams extends coreClient.OperationOptions {} -/** - * Contains response data for the listByDevice operation. - */ -export type FileSharesListByDeviceResponse = FileShareList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FileShareList; - }; -}; +/** Contains response data for the get operation. */ +export type JobsGetResponse = Job; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type FileSharesBeginCreateOrUpdateResponse = FileShare & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FileShare; - }; -}; +/** Optional parameters. */ +export interface JobsListByManagerOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the listByDevice operation. - */ -export type IscsiServersListByDeviceResponse = ISCSIServerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ISCSIServerList; - }; -}; +/** Contains response data for the listByManager operation. */ +export type JobsListByManagerResponse = JobList; -/** - * Contains response data for the get operation. - */ -export type IscsiServersGetResponse = ISCSIServer & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ISCSIServer; - }; -}; +/** Optional parameters. */ +export interface JobsListByDeviceNextOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type IscsiServersCreateOrUpdateResponse = ISCSIServer & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ISCSIServer; - }; -}; +/** Contains response data for the listByDeviceNext operation. */ +export type JobsListByDeviceNextResponse = JobList; -/** - * Contains response data for the listMetrics operation. - */ -export type IscsiServersListMetricsResponse = MetricList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricList; - }; -}; +/** Optional parameters. */ +export interface JobsListByManagerNextOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the listMetricDefinition operation. - */ -export type IscsiServersListMetricDefinitionResponse = MetricDefinitionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricDefinitionList; - }; -}; +/** Contains response data for the listByManagerNext operation. */ +export type JobsListByManagerNextResponse = JobList; -/** - * Contains response data for the listByManager operation. - */ -export type IscsiServersListByManagerResponse = ISCSIServerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ISCSIServerList; - }; -}; +/** Optional parameters. */ +export interface StorageAccountCredentialsListByManagerOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type IscsiServersBeginCreateOrUpdateResponse = ISCSIServer & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ISCSIServer; - }; -}; +/** Contains response data for the listByManager operation. */ +export type StorageAccountCredentialsListByManagerResponse = StorageAccountCredentialList; -/** - * Contains response data for the listByDevice operation. - */ -export type JobsListByDeviceResponse = JobList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobList; - }; -}; +/** Optional parameters. */ +export interface StorageAccountCredentialsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type JobsGetResponse = Job & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Job; - }; -}; +/** Contains response data for the get operation. */ +export type StorageAccountCredentialsGetResponse = StorageAccountCredential; -/** - * Contains response data for the listByManager operation. - */ -export type JobsListByManagerResponse = JobList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobList; - }; -}; +/** Optional parameters. */ +export interface StorageAccountCredentialsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByDeviceNext operation. - */ -export type JobsListByDeviceNextResponse = JobList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobList; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type StorageAccountCredentialsCreateOrUpdateResponse = StorageAccountCredential; -/** - * Contains response data for the listByManagerNext operation. - */ -export type JobsListByManagerNextResponse = JobList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobList; - }; -}; +/** Optional parameters. */ +export interface StorageAccountCredentialsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByManager operation. - */ -export type StorageAccountCredentialsListByManagerResponse = StorageAccountCredentialList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredentialList; - }; -}; +/** Optional parameters. */ +export interface StorageDomainsListByManagerOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type StorageAccountCredentialsGetResponse = StorageAccountCredential & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredential; - }; -}; +/** Contains response data for the listByManager operation. */ +export type StorageDomainsListByManagerResponse = StorageDomainList; -/** - * Contains response data for the createOrUpdate operation. - */ -export type StorageAccountCredentialsCreateOrUpdateResponse = StorageAccountCredential & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredential; - }; -}; +/** Optional parameters. */ +export interface StorageDomainsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type StorageAccountCredentialsBeginCreateOrUpdateResponse = StorageAccountCredential & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredential; - }; -}; +/** Contains response data for the get operation. */ +export type StorageDomainsGetResponse = StorageDomain; -/** - * Contains response data for the listByManager operation. - */ -export type StorageDomainsListByManagerResponse = StorageDomainList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageDomainList; - }; -}; +/** Optional parameters. */ +export interface StorageDomainsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the get operation. - */ -export type StorageDomainsGetResponse = StorageDomain & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageDomain; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type StorageDomainsCreateOrUpdateResponse = StorageDomain; -/** - * Contains response data for the createOrUpdate operation. - */ -export type StorageDomainsCreateOrUpdateResponse = StorageDomain & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageDomain; - }; -}; +/** Optional parameters. */ +export interface StorageDomainsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type StorageDomainsBeginCreateOrUpdateResponse = StorageDomain & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageDomain; - }; -}; +/** Optional parameters. */ +export interface StorSimpleManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/iscsiDisksMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/iscsiDisksMappers.ts deleted file mode 100644 index f665444c0e5c..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/iscsiDisksMappers.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - ISCSIDiskList, - ISCSIDisk, - BaseModel, - ErrorModel, - Message, - Item, - MetricList, - Metrics, - MetricName, - MetricDimension, - MetricData, - MetricDefinitionList, - MetricDefinition, - MetricAvailablity, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - ChapSettings, - AsymmetricEncryptedSecret, - FileShare, - Device, - DeviceDetails, - EncryptionSettings, - FileServer, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - StorageDomain, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/iscsiServersMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/iscsiServersMappers.ts deleted file mode 100644 index b0ffc82479c9..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/iscsiServersMappers.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - ISCSIServerList, - ISCSIServer, - BaseModel, - ErrorModel, - Message, - Item, - MetricList, - Metrics, - MetricName, - MetricDimension, - MetricData, - MetricDefinitionList, - MetricDefinition, - MetricAvailablity, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - ChapSettings, - AsymmetricEncryptedSecret, - FileShare, - ISCSIDisk, - Device, - DeviceDetails, - EncryptionSettings, - FileServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - StorageDomain, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/jobsMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/jobsMappers.ts deleted file mode 100644 index 11cd5eb55c18..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/jobsMappers.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - JobList, - Job, - BaseModel, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ErrorModel, - Message, - Item, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - ChapSettings, - AsymmetricEncryptedSecret, - FileShare, - ISCSIDisk, - Device, - DeviceDetails, - EncryptionSettings, - FileServer, - ISCSIServer, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - StorageDomain, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/managersMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/managersMappers.ts deleted file mode 100644 index 8daac8a07f18..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/managersMappers.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - ManagerList, - Manager, - Resource, - BaseResource, - ManagerIntrinsicSettings, - ManagerSku, - ErrorModel, - Message, - Item, - ManagerPatch, - UploadCertificateRequest, - UploadCertificateResponse, - BaseModel, - EncryptionSettings, - ManagerExtendedInfo, - SymmetricEncryptedSecret, - MetricList, - Metrics, - MetricName, - MetricDimension, - MetricData, - MetricDefinitionList, - MetricDefinition, - MetricAvailablity, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - ChapSettings, - AsymmetricEncryptedSecret, - FileShare, - ISCSIDisk, - Device, - DeviceDetails, - FileServer, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - StorageDomain, - TimeSettings, - Updates -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/mappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/mappers.ts index e61e73cfe057..7b4402b5ca58 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/mappers.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/models/mappers.ts @@ -1,60 +1,61 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const BaseModel: msRest.CompositeMapper = { - serializedName: "BaseModel", +export const ManagerList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BaseModel", + className: "ManagerList", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", + value: { + serializedName: "value", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Manager" + } + } } - }, + } + } + } +}; + +export const ManagerIntrinsicSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagerIntrinsicSettings", + modelProperties: { type: { - readOnly: true, serializedName: "type", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["GardaV1", "HelsinkiV1"] } } } } }; -export const AccessControlRecord: msRest.CompositeMapper = { - serializedName: "AccessControlRecord", +export const ManagerSku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessControlRecord", + className: "ManagerSku", modelProperties: { - ...BaseModel.type.modelProperties, - initiatorName: { - required: true, - serializedName: "properties.initiatorName", + name: { + defaultValue: "Standard", + isConstant: true, + serializedName: "name", type: { name: "String" } @@ -63,285 +64,255 @@ export const AccessControlRecord: msRest.CompositeMapper = { } }; -export const AlertSource: msRest.CompositeMapper = { - serializedName: "AlertSource", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertSource", + className: "Resource", modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, name: { serializedName: "name", + readOnly: true, type: { name: "String" } }, - timeZone: { - serializedName: "timeZone", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - alertSourceType: { - serializedName: "alertSourceType", + location: { + serializedName: "location", + required: true, type: { - name: "Enum", - allowedValues: [ - "Resource", - "Device" - ] + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const AlertErrorDetails: msRest.CompositeMapper = { - serializedName: "AlertErrorDetails", +export const ErrorModel: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertErrorDetails", + className: "ErrorModel", modelProperties: { errorCode: { serializedName: "errorCode", + required: true, type: { name: "String" } }, - errorMessage: { - serializedName: "errorMessage", + message: { + serializedName: "message", type: { - name: "String" + name: "Composite", + className: "Message" } }, - occurences: { - serializedName: "occurences", + values: { + serializedName: "values", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Item" + } + } } } } } }; -export const Alert: msRest.CompositeMapper = { - serializedName: "Alert", +export const Message: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Alert", + className: "Message", modelProperties: { - ...BaseModel.type.modelProperties, - title: { - required: true, - serializedName: "properties.title", + language: { + serializedName: "language", type: { name: "String" } }, - scope: { - required: true, - serializedName: "properties.scope", + value: { + serializedName: "value", type: { - name: "Enum", - allowedValues: [ - "Resource", - "Device" - ] + name: "String" } - }, - alertType: { + } + } + } +}; + +export const Item: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Item", + modelProperties: { + key: { + serializedName: "key", required: true, - serializedName: "properties.alertType", type: { name: "String" } }, - appearedAtTime: { + value: { + serializedName: "value", required: true, - serializedName: "properties.appearedAtTime", type: { - name: "DateTime" + name: "String" } - }, - appearedAtSourceTime: { + } + } + } +}; + +export const AvailableProviderOperations: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableProviderOperations", + modelProperties: { + value: { + serializedName: "value", required: true, - serializedName: "properties.appearedAtSourceTime", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AvailableProviderOperation" + } + } } }, - clearedAtTime: { - serializedName: "properties.clearedAtTime", + nextLink: { + serializedName: "nextLink", type: { - name: "DateTime" + name: "String" } - }, - clearedAtSourceTime: { - serializedName: "properties.clearedAtSourceTime", + } + } + } +}; + +export const AvailableProviderOperation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableProviderOperation", + modelProperties: { + name: { + serializedName: "name", type: { - name: "DateTime" + name: "String" } }, - source: { - required: true, - serializedName: "properties.source", + display: { + serializedName: "display", type: { name: "Composite", - className: "AlertSource" + className: "AvailableProviderOperationDisplay" } }, - recommendation: { - serializedName: "properties.recommendation", + origin: { + serializedName: "origin", type: { name: "String" } }, - resolutionReason: { - serializedName: "properties.resolutionReason", + properties: { + serializedName: "properties", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } - }, - severity: { - required: true, - serializedName: "properties.severity", + } + } + } +}; + +export const AvailableProviderOperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableProviderOperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", type: { - name: "Enum", - allowedValues: [ - "Informational", - "Warning", - "Critical" - ] + name: "String" } }, - status: { - required: true, - serializedName: "properties.status", + resource: { + serializedName: "resource", type: { - name: "Enum", - allowedValues: [ - "Active", - "Cleared" - ] + name: "String" } }, - errorDetails: { - serializedName: "properties.errorDetails", + operation: { + serializedName: "operation", type: { - name: "Composite", - className: "AlertErrorDetails" + name: "String" } }, - detailedInformation: { - serializedName: "properties.detailedInformation", + description: { + serializedName: "description", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } } } } }; -export const AlertFilter: msRest.CompositeMapper = { - serializedName: "AlertFilter", +export const ManagerPatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertFilter", + className: "ManagerPatch", modelProperties: { - status: { - serializedName: "status", + tags: { + serializedName: "tags", type: { - name: "Enum", - allowedValues: [ - "Active", - "Cleared" - ] - } - }, - severity: { - serializedName: "severity", - type: { - name: "Enum", - allowedValues: [ - "Informational", - "Warning", - "Critical" - ] - } - }, - sourceType: { - serializedName: "sourceType", - type: { - name: "Enum", - allowedValues: [ - "Resource", - "Device" - ] - } - }, - sourceName: { - serializedName: "sourceName", - type: { - name: "String" - } - }, - appearedOnTime: { - serializedName: "appearedOnTime", - type: { - name: "DateTime" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const AlertSettings: msRest.CompositeMapper = { - serializedName: "AlertSettings", +export const AccessControlRecordList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertSettings", + className: "AccessControlRecordList", modelProperties: { - ...BaseModel.type.modelProperties, - emailNotification: { - required: true, - serializedName: "properties.emailNotification", - type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] - } - }, - notificationToServiceOwners: { - required: true, - serializedName: "properties.notificationToServiceOwners", - type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] - } - }, - alertNotificationCulture: { + value: { + serializedName: "value", required: true, - serializedName: "properties.alertNotificationCulture", - type: { - name: "String" - } - }, - additionalRecipientEmailList: { - serializedName: "properties.additionalRecipientEmailList", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "AccessControlRecord" } } } @@ -350,67 +321,56 @@ export const AlertSettings: msRest.CompositeMapper = { } }; -export const AsymmetricEncryptedSecret: msRest.CompositeMapper = { - serializedName: "AsymmetricEncryptedSecret", +export const BaseModel: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AsymmetricEncryptedSecret", + className: "BaseModel", modelProperties: { - value: { - required: true, - serializedName: "value", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - encryptionCertificateThumbprint: { - serializedName: "encryptionCertificateThumbprint", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - encryptionAlgorithm: { - required: true, - serializedName: "encryptionAlgorithm", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Enum", - allowedValues: [ - "None", - "AES256", - "RSAES_PKCS1_v_1_5" - ] + name: "String" } } } } }; -export const AvailableProviderOperationDisplay: msRest.CompositeMapper = { - serializedName: "AvailableProviderOperationDisplay", +export const AlertList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailableProviderOperationDisplay", + className: "AlertList", modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", + value: { + serializedName: "value", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Alert" + } + } } }, - description: { - serializedName: "description", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -419,11 +379,10 @@ export const AvailableProviderOperationDisplay: msRest.CompositeMapper = { } }; -export const AvailableProviderOperation: msRest.CompositeMapper = { - serializedName: "AvailableProviderOperation", +export const AlertSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailableProviderOperation", + className: "AlertSource", modelProperties: { name: { serializedName: "name", @@ -431,256 +390,184 @@ export const AvailableProviderOperation: msRest.CompositeMapper = { name: "String" } }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "AvailableProviderOperationDisplay" - } - }, - origin: { - serializedName: "origin", + timeZone: { + serializedName: "timeZone", type: { name: "String" } }, - properties: { - serializedName: "properties", + alertSourceType: { + serializedName: "alertSourceType", type: { - name: "Object" + name: "Enum", + allowedValues: ["Resource", "Device"] } } } } }; -export const BackupElement: msRest.CompositeMapper = { - serializedName: "BackupElement", +export const AlertErrorDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BackupElement", + className: "AlertErrorDetails", modelProperties: { - ...BaseModel.type.modelProperties, - sizeInBytes: { - required: true, - serializedName: "properties.sizeInBytes", + errorCode: { + serializedName: "errorCode", type: { - name: "Number" + name: "String" } }, - endpointName: { - required: true, - serializedName: "properties.endpointName", + errorMessage: { + serializedName: "errorMessage", type: { name: "String" } }, - dataPolicy: { - required: true, - serializedName: "properties.dataPolicy", + occurences: { + serializedName: "occurences", type: { - name: "Enum", - allowedValues: [ - "Invalid", - "Local", - "Tiered", - "Cloud" - ] + name: "Number" } } } } }; -export const Backup: msRest.CompositeMapper = { - serializedName: "Backup", +export const BackupList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Backup", + className: "BackupList", modelProperties: { - ...BaseModel.type.modelProperties, - targetId: { - serializedName: "properties.targetId", - type: { - name: "String" - } - }, - targetType: { - serializedName: "properties.targetType", - type: { - name: "String" - } - }, - sizeInBytes: { - required: true, - serializedName: "properties.sizeInBytes", - type: { - name: "Number" - } - }, - createdTime: { - serializedName: "properties.createdTime", - type: { - name: "DateTime" - } - }, - expirationTime: { - serializedName: "properties.expirationTime", - type: { - name: "DateTime" - } - }, - initiatedBy: { - required: true, - serializedName: "properties.initiatedBy", - type: { - name: "Enum", - allowedValues: [ - "Manual", - "Scheduled" - ] - } - }, - deviceId: { - required: true, - serializedName: "properties.deviceId", - type: { - name: "String" - } - }, - elements: { + value: { + serializedName: "value", required: true, - serializedName: "properties.elements", type: { name: "Sequence", element: { type: { name: "Composite", - className: "BackupElement" + className: "Backup" } } } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } } } } }; -export const BackupFilter: msRest.CompositeMapper = { - serializedName: "BackupFilter", +export const UploadCertificateRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BackupFilter", + className: "UploadCertificateRequest", modelProperties: { - initiatedBy: { - serializedName: "initiatedBy", + contractVersion: { + serializedName: "contractVersion", + readOnly: true, type: { name: "Enum", allowedValues: [ - "Manual", - "Scheduled" + "InvalidVersion", + "V2011_09", + "V2012_02", + "V2012_05", + "V2012_12", + "V2013_04", + "V2013_10", + "V2013_11", + "V2014_04", + "V2014_06", + "V2014_07", + "V2014_09", + "V2014_10", + "V2014_12", + "V2015_01", + "V2015_02", + "V2015_04", + "V2015_05", + "V2015_06", + "V2015_07", + "V2015_08", + "V2015_10", + "V2015_12", + "V2016_01", + "V2016_02", + "V2016_04", + "V2016_05", + "V2016_07", + "V2016_08" ] } }, - createdTime: { - serializedName: "createdTime", - type: { - name: "DateTime" - } - } - } - } -}; - -export const Time: msRest.CompositeMapper = { - serializedName: "Time", - type: { - name: "Composite", - className: "Time", - modelProperties: { - hour: { - required: true, - serializedName: "hour", - constraints: { - InclusiveMaximum: 23, - InclusiveMinimum: 0 - }, + authType: { + serializedName: "properties.authType", type: { - name: "Number" + name: "Enum", + allowedValues: [ + "Invalid", + "AccessControlService", + "AzureActiveDirectory" + ] } }, - minute: { + certificate: { + serializedName: "properties.certificate", required: true, - serializedName: "minute", - constraints: { - InclusiveMaximum: 59, - InclusiveMinimum: 0 - }, type: { - name: "Number" + name: "String" } } } } }; -export const BackupScheduleGroup: msRest.CompositeMapper = { - serializedName: "BackupScheduleGroup", +export const ClearAlertRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BackupScheduleGroup", + className: "ClearAlertRequest", modelProperties: { - ...BaseModel.type.modelProperties, - startTime: { - required: true, - serializedName: "properties.startTime", + resolutionMessage: { + serializedName: "resolutionMessage", type: { - name: "Composite", - className: "Time" + name: "String" } - } - } - } -}; - -export const ChapSettings: msRest.CompositeMapper = { - serializedName: "ChapSettings", - type: { - name: "Composite", - className: "ChapSettings", - modelProperties: { - ...BaseModel.type.modelProperties, - password: { + }, + alerts: { + serializedName: "alerts", required: true, - serializedName: "properties.password", type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const ClearAlertRequest: msRest.CompositeMapper = { - serializedName: "ClearAlertRequest", +export const DeviceList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClearAlertRequest", + className: "DeviceList", modelProperties: { - resolutionMessage: { - serializedName: "resolutionMessage", - type: { - name: "String" - } - }, - alerts: { + value: { + serializedName: "value", required: true, - serializedName: "alerts", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "Device" } } } @@ -689,194 +576,112 @@ export const ClearAlertRequest: msRest.CompositeMapper = { } }; -export const FileShare: msRest.CompositeMapper = { - serializedName: "FileShare", +export const DeviceDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "FileShare", + className: "DeviceDetails", modelProperties: { - ...BaseModel.type.modelProperties, - description: { - serializedName: "properties.description", - type: { - name: "String" - } - }, - shareStatus: { - required: true, - serializedName: "properties.shareStatus", - type: { - name: "Enum", - allowedValues: [ - "Online", - "Offline" - ] - } - }, - dataPolicy: { - required: true, - serializedName: "properties.dataPolicy", - type: { - name: "Enum", - allowedValues: [ - "Invalid", - "Local", - "Tiered", - "Cloud" - ] - } - }, - adminUser: { - required: true, - serializedName: "properties.adminUser", - type: { - name: "String" - } - }, - provisionedCapacityInBytes: { - required: true, - serializedName: "properties.provisionedCapacityInBytes", + endpointCount: { + serializedName: "endpointCount", type: { name: "Number" } }, - usedCapacityInBytes: { - readOnly: true, - serializedName: "properties.usedCapacityInBytes", + totalStorageInBytes: { + serializedName: "totalStorageInBytes", type: { name: "Number" } }, - localUsedCapacityInBytes: { - readOnly: true, - serializedName: "properties.localUsedCapacityInBytes", + totalLocalStorageInBytes: { + serializedName: "totalLocalStorageInBytes", type: { name: "Number" } }, - monitoringStatus: { - required: true, - serializedName: "properties.monitoringStatus", - type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] - } - } - } - } -}; - -export const ISCSIDisk: msRest.CompositeMapper = { - serializedName: "ISCSIDisk", - type: { - name: "Composite", - className: "ISCSIDisk", - modelProperties: { - ...BaseModel.type.modelProperties, - description: { - serializedName: "properties.description", + provisionedStorageInBytes: { + serializedName: "provisionedStorageInBytes", type: { - name: "String" + name: "Number" } }, - diskStatus: { - required: true, - serializedName: "properties.diskStatus", + provisionedLocalStorageInBytes: { + serializedName: "provisionedLocalStorageInBytes", type: { - name: "Enum", - allowedValues: [ - "Online", - "Offline" - ] + name: "Number" } }, - accessControlRecords: { - required: true, - serializedName: "properties.accessControlRecords", + usingStorageInBytes: { + serializedName: "usingStorageInBytes", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Number" } }, - dataPolicy: { - required: true, - serializedName: "properties.dataPolicy", + usingLocalStorageInBytes: { + serializedName: "usingLocalStorageInBytes", type: { - name: "Enum", - allowedValues: [ - "Invalid", - "Local", - "Tiered", - "Cloud" - ] + name: "Number" } }, - provisionedCapacityInBytes: { - required: true, - serializedName: "properties.provisionedCapacityInBytes", + totalBackupSizeInBytes: { + serializedName: "totalBackupSizeInBytes", type: { name: "Number" } }, - usedCapacityInBytes: { - readOnly: true, - serializedName: "properties.usedCapacityInBytes", + availableStorageInBytes: { + serializedName: "availableStorageInBytes", type: { name: "Number" } }, - localUsedCapacityInBytes: { - readOnly: true, - serializedName: "properties.localUsedCapacityInBytes", + availableLocalStorageInBytes: { + serializedName: "availableLocalStorageInBytes", type: { name: "Number" } - }, - monitoringStatus: { - required: true, - serializedName: "properties.monitoringStatus", + } + } + } +}; + +export const DevicePatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DevicePatch", + modelProperties: { + deviceDescription: { + serializedName: "deviceDescription", type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] + name: "String" } } } } }; -export const CloneRequest: msRest.CompositeMapper = { - serializedName: "CloneRequest", +export const CloneRequest: coreClient.CompositeMapper = { type: { name: "Composite", className: "CloneRequest", modelProperties: { targetDeviceId: { - required: true, serializedName: "properties.targetDeviceId", + required: true, type: { name: "String" } }, targetAccessPointId: { - required: true, serializedName: "properties.targetAccessPointId", + required: true, type: { name: "String" } }, newEndpointName: { - required: true, serializedName: "properties.newEndpointName", + required: true, type: { name: "String" } @@ -892,286 +697,367 @@ export const CloneRequest: msRest.CompositeMapper = { serializedName: "properties.disk", type: { name: "Composite", - className: "ISCSIDisk" + className: "IscsiDisk" } } } } }; -export const DeviceDetails: msRest.CompositeMapper = { - serializedName: "DeviceDetails", +export const BackupScheduleGroupList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeviceDetails", + className: "BackupScheduleGroupList", modelProperties: { - endpointCount: { - serializedName: "endpointCount", - type: { - name: "Number" - } - }, - totalStorageInBytes: { - serializedName: "totalStorageInBytes", + value: { + serializedName: "value", + required: true, type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BackupScheduleGroup" + } + } } - }, - totalLocalStorageInBytes: { - serializedName: "totalLocalStorageInBytes", - type: { - name: "Number" - } - }, - provisionedStorageInBytes: { - serializedName: "provisionedStorageInBytes", - type: { - name: "Number" - } - }, - provisionedLocalStorageInBytes: { - serializedName: "provisionedLocalStorageInBytes", + } + } + } +}; + +export const Time: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Time", + modelProperties: { + hour: { + constraints: { + InclusiveMaximum: 23, + InclusiveMinimum: 0 + }, + serializedName: "hour", + required: true, type: { name: "Number" } }, - usingStorageInBytes: { - serializedName: "usingStorageInBytes", + minute: { + constraints: { + InclusiveMaximum: 59, + InclusiveMinimum: 0 + }, + serializedName: "minute", + required: true, type: { name: "Number" } - }, - usingLocalStorageInBytes: { - serializedName: "usingLocalStorageInBytes", + } + } + } +}; + +export const ChapSettingsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChapSettingsList", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ChapSettings" + } + } } - }, - totalBackupSizeInBytes: { - serializedName: "totalBackupSizeInBytes", + } + } + } +}; + +export const AsymmetricEncryptedSecret: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AsymmetricEncryptedSecret", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { - name: "Number" + name: "String" } }, - availableStorageInBytes: { - serializedName: "availableStorageInBytes", + encryptionCertificateThumbprint: { + serializedName: "encryptionCertificateThumbprint", type: { - name: "Number" + name: "String" } }, - availableLocalStorageInBytes: { - serializedName: "availableLocalStorageInBytes", + encryptionAlgorithm: { + serializedName: "encryptionAlgorithm", + required: true, type: { - name: "Number" + name: "Enum", + allowedValues: ["None", "AES256", "RSAES_PKCS1_v_1_5"] } } } } }; -export const Device: msRest.CompositeMapper = { - serializedName: "Device", +export const IscsiDiskList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Device", + className: "IscsiDiskList", modelProperties: { - ...BaseModel.type.modelProperties, - activationTime: { - serializedName: "properties.activationTime", + value: { + serializedName: "value", + required: true, type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IscsiDisk" + } + } } - }, - allowedDeviceOperations: { - serializedName: "properties.allowedDeviceOperations", + } + } + } +}; + +export const FailoverRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FailoverRequest", + modelProperties: { + accesspointIds: { + serializedName: "accesspointIds", type: { name: "Sequence", element: { type: { - name: "Enum", - allowedValues: [ - "None", - "Delete", - "DeleteWithWarning", - "DRSource", - "DRTarget", - "Browsable", - "ReadOnlyForDR", - "Deactivate" - ] + name: "String" } } } }, - culture: { - serializedName: "properties.culture", + targetDeviceId: { + serializedName: "targetDeviceId", type: { name: "String" } }, - deviceCapabilities: { - serializedName: "properties.deviceCapabilities", + skipValidation: { + serializedName: "skipValidation", + type: { + name: "Boolean" + } + }, + keepSourceDevice: { + serializedName: "keepSourceDevice", + type: { + name: "Boolean" + } + } + } + } +}; + +export const FileServerList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileServerList", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { - name: "Enum", - allowedValues: [ - "Invalid", - "FileServer", - "IscsiServer" - ] + name: "Composite", + className: "FileServer" } } } - }, - deviceDescription: { - serializedName: "properties.deviceDescription", + } + } + } +}; + +export const MetricList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Metrics" + } + } + } + } + } + } +}; + +export const Metrics: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Metrics", + modelProperties: { + resourceId: { + serializedName: "resourceId", + required: true, type: { name: "String" } }, - domainName: { - serializedName: "properties.domainName", + startTime: { + serializedName: "startTime", + required: true, type: { - name: "String" + name: "DateTime" } }, - deviceSoftwareVersion: { - serializedName: "properties.deviceSoftwareVersion", + endTime: { + serializedName: "endTime", + required: true, type: { - name: "String" + name: "DateTime" } }, - friendlySoftwareName: { - serializedName: "properties.friendlySoftwareName", + timeGrain: { + serializedName: "timeGrain", + required: true, type: { name: "String" } }, - deviceConfigurationStatus: { - serializedName: "properties.deviceConfigurationStatus", + primaryAggregation: { + serializedName: "primaryAggregation", + required: true, type: { name: "Enum", allowedValues: [ - "Complete", - "Pending" + "Average", + "Last", + "Maximum", + "Minimum", + "None", + "Total" ] } }, - modelDescription: { - serializedName: "properties.modelDescription", + name: { + serializedName: "name", type: { - name: "String" + name: "Composite", + className: "MetricName" } }, - status: { - serializedName: "properties.status", + dimensions: { + serializedName: "dimensions", + required: true, type: { - name: "Enum", - allowedValues: [ - "Unknown", - "Online", - "Offline", - "RequiresAttention", - "MaintenanceMode", - "Creating", - "Provisioning", - "Deleted", - "ReadyToSetup", - "Deactivated", - "Deactivating" - ] + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricDimension" + } + } } }, - deviceType: { - serializedName: "properties.type", + unit: { + serializedName: "unit", + required: true, type: { name: "Enum", - allowedValues: [ - "Invalid", - "Appliance", - "VirtualAppliance", - "Series9000OnPremVirtualAppliance", - "Series9000VirtualAppliance", - "Series9000PhysicalAppliance" + allowedValues: [ + "Bytes", + "BytesPerSecond", + "Count", + "CountPerSecond", + "Percent", + "Seconds" ] } }, - details: { - serializedName: "properties.details", + type: { + serializedName: "type", + required: true, type: { - name: "Composite", - className: "DeviceDetails" + name: "String" } - } - } - } -}; - -export const DevicePatch: msRest.CompositeMapper = { - serializedName: "DevicePatch", - type: { - name: "Composite", - className: "DevicePatch", - modelProperties: { - deviceDescription: { - serializedName: "deviceDescription", + }, + values: { + serializedName: "values", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricData" + } + } } } } } }; -export const EncryptionSettings: msRest.CompositeMapper = { - serializedName: "EncryptionSettings", +export const MetricName: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EncryptionSettings", + className: "MetricName", modelProperties: { - ...BaseModel.type.modelProperties, - encryptionStatus: { + value: { + serializedName: "value", required: true, - serializedName: "properties.encryptionStatus", type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] + name: "String" } }, - keyRolloverStatus: { + localizedValue: { + serializedName: "localizedValue", required: true, - serializedName: "properties.keyRolloverStatus", type: { - name: "Enum", - allowedValues: [ - "Required", - "NotRequired" - ] + name: "String" } } } } }; -export const Message: msRest.CompositeMapper = { - serializedName: "Message", +export const MetricDimension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Message", + className: "MetricDimension", modelProperties: { - language: { - serializedName: "language", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, value: { serializedName: "value", + required: true, type: { name: "String" } @@ -1180,59 +1066,71 @@ export const Message: msRest.CompositeMapper = { } }; -export const Item: msRest.CompositeMapper = { - serializedName: "Item", +export const MetricData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Item", + className: "MetricData", modelProperties: { - key: { + timeStamp: { + serializedName: "timeStamp", required: true, - serializedName: "key", type: { - name: "String" + name: "DateTime" } }, - value: { + sum: { + serializedName: "sum", required: true, - serializedName: "value", type: { - name: "String" + name: "Number" + } + }, + count: { + serializedName: "count", + required: true, + type: { + name: "Number" + } + }, + average: { + serializedName: "average", + required: true, + type: { + name: "Number" + } + }, + minimum: { + serializedName: "minimum", + required: true, + type: { + name: "Number" + } + }, + maximum: { + serializedName: "maximum", + required: true, + type: { + name: "Number" } } } } }; -export const ErrorModel: msRest.CompositeMapper = { - serializedName: "Error", +export const MetricDefinitionList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorModel", + className: "MetricDefinitionList", modelProperties: { - errorCode: { - required: true, - serializedName: "errorCode", - type: { - name: "String" - } - }, - message: { + value: { + serializedName: "value", required: true, - serializedName: "message", - type: { - name: "Composite", - className: "Message" - } - }, - values: { - serializedName: "values", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Item" + className: "MetricDefinition" } } } @@ -1241,75 +1139,84 @@ export const ErrorModel: msRest.CompositeMapper = { } }; -export const FailoverRequest: msRest.CompositeMapper = { - serializedName: "FailoverRequest", +export const MetricDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "FailoverRequest", + className: "MetricDefinition", modelProperties: { - accesspointIds: { - serializedName: "accesspointIds", + name: { + serializedName: "name", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Composite", + className: "MetricName" } }, - targetDeviceId: { - serializedName: "targetDeviceId", + unit: { + serializedName: "unit", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: [ + "Bytes", + "BytesPerSecond", + "Count", + "CountPerSecond", + "Percent", + "Seconds" + ] } }, - skipValidation: { - serializedName: "skipValidation", + primaryAggregationType: { + serializedName: "primaryAggregationType", + required: true, type: { - name: "Boolean" + name: "Enum", + allowedValues: [ + "Average", + "Last", + "Maximum", + "Minimum", + "None", + "Total" + ] } }, - keepSourceDevice: { - serializedName: "keepSourceDevice", - type: { - name: "Boolean" - } - } - } - } -}; - -export const FileServer: msRest.CompositeMapper = { - serializedName: "FileServer", - type: { - name: "Composite", - className: "FileServer", - modelProperties: { - ...BaseModel.type.modelProperties, - domainName: { + resourceId: { + serializedName: "resourceId", required: true, - serializedName: "properties.domainName", type: { name: "String" } }, - storageDomainId: { + metricAvailabilities: { + serializedName: "metricAvailabilities", required: true, - serializedName: "properties.storageDomainId", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricAvailablity" + } + } } }, - backupScheduleGroupId: { + dimensions: { + serializedName: "dimensions", required: true, - serializedName: "properties.backupScheduleGroupId", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricDimension" + } + } } }, - description: { - serializedName: "properties.description", + type: { + serializedName: "type", + required: true, type: { name: "String" } @@ -1318,71 +1225,93 @@ export const FileServer: msRest.CompositeMapper = { } }; -export const IPConfig: msRest.CompositeMapper = { - serializedName: "IPConfig", +export const MetricAvailablity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IPConfig", + className: "MetricAvailablity", modelProperties: { - ipAddress: { + timeGrain: { + serializedName: "timeGrain", required: true, - serializedName: "ipAddress", type: { name: "String" } }, - prefixLength: { - serializedName: "prefixLength", + retention: { + serializedName: "retention", + required: true, type: { - name: "Number" + name: "String" } - }, - gateway: { + } + } + } +}; + +export const FileShareList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileShareList", + modelProperties: { + value: { + serializedName: "value", required: true, - serializedName: "gateway", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FileShare" + } + } } } } } }; -export const ISCSIServer: msRest.CompositeMapper = { - serializedName: "ISCSIServer", +export const IscsiServerList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ISCSIServer", + className: "IscsiServerList", modelProperties: { - ...BaseModel.type.modelProperties, - storageDomainId: { + value: { + serializedName: "value", required: true, - serializedName: "properties.storageDomainId", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IscsiServer" + } + } } - }, - backupScheduleGroupId: { + } + } + } +}; + +export const JobList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "JobList", + modelProperties: { + value: { + serializedName: "value", required: true, - serializedName: "properties.backupScheduleGroupId", - type: { - name: "String" - } - }, - description: { - serializedName: "properties.description", type: { - name: "String" - } - }, - chapId: { - serializedName: "properties.chapId", - type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Job" + } + } } }, - reverseChapId: { - serializedName: "properties.reverseChapId", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -1391,33 +1320,33 @@ export const ISCSIServer: msRest.CompositeMapper = { } }; -export const JobErrorItem: msRest.CompositeMapper = { - serializedName: "JobErrorItem", +export const JobErrorDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobErrorItem", + className: "JobErrorDetails", modelProperties: { - recommendations: { - serializedName: "recommendations", + errorDetails: { + serializedName: "errorDetails", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "JobErrorItem" } } } }, code: { - required: true, serializedName: "code", + required: true, type: { name: "String" } }, message: { - required: true, serializedName: "message", + required: true, type: { name: "String" } @@ -1426,34 +1355,32 @@ export const JobErrorItem: msRest.CompositeMapper = { } }; -export const JobErrorDetails: msRest.CompositeMapper = { - serializedName: "JobErrorDetails", +export const JobErrorItem: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobErrorDetails", + className: "JobErrorItem", modelProperties: { - errorDetails: { - serializedName: "errorDetails", + recommendations: { + serializedName: "recommendations", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "JobErrorItem" + name: "String" } } } }, code: { - required: true, serializedName: "code", + required: true, type: { name: "String" } }, message: { - required: true, serializedName: "message", + required: true, type: { name: "String" } @@ -1462,8 +1389,7 @@ export const JobErrorDetails: msRest.CompositeMapper = { } }; -export const JobStage: msRest.CompositeMapper = { - serializedName: "JobStage", +export const JobStage: coreClient.CompositeMapper = { type: { name: "Composite", className: "JobStage", @@ -1475,8 +1401,8 @@ export const JobStage: msRest.CompositeMapper = { } }, stageStatus: { - required: true, serializedName: "stageStatus", + required: true, type: { name: "Enum", allowedValues: [ @@ -1506,8 +1432,7 @@ export const JobStage: msRest.CompositeMapper = { } }; -export const JobStats: msRest.CompositeMapper = { - serializedName: "JobStats", +export const JobStats: coreClient.CompositeMapper = { type: { name: "Composite", className: "JobStats", @@ -1534,8 +1459,7 @@ export const JobStats: msRest.CompositeMapper = { } }; -export const UpdateDownloadProgress: msRest.CompositeMapper = { - serializedName: "UpdateDownloadProgress", +export const UpdateDownloadProgress: coreClient.CompositeMapper = { type: { name: "Composite", className: "UpdateDownloadProgress", @@ -1544,353 +1468,176 @@ export const UpdateDownloadProgress: msRest.CompositeMapper = { serializedName: "downloadPhase", type: { name: "Enum", - allowedValues: [ - "Unknown", - "Initializing", - "Downloading", - "Verifying" - ] - } - }, - percentComplete: { - serializedName: "percentComplete", - type: { - name: "Number" - } - }, - totalBytesToDownload: { - serializedName: "totalBytesToDownload", - type: { - name: "Number" - } - }, - totalBytesDownloaded: { - serializedName: "totalBytesDownloaded", - type: { - name: "Number" - } - }, - numberOfUpdatesToDownload: { - serializedName: "numberOfUpdatesToDownload", - type: { - name: "Number" - } - }, - numberOfUpdatesDownloaded: { - serializedName: "numberOfUpdatesDownloaded", - type: { - name: "Number" - } - } - } - } -}; - -export const UpdateInstallProgress: msRest.CompositeMapper = { - serializedName: "UpdateInstallProgress", - type: { - name: "Composite", - className: "UpdateInstallProgress", - modelProperties: { - percentComplete: { - serializedName: "percentComplete", - type: { - name: "Number" - } - }, - numberOfUpdatesToInstall: { - serializedName: "numberOfUpdatesToInstall", - type: { - name: "Number" - } - }, - numberOfUpdatesInstalled: { - serializedName: "numberOfUpdatesInstalled", - type: { - name: "Number" - } - } - } - } -}; - -export const Job: msRest.CompositeMapper = { - serializedName: "Job", - type: { - name: "Composite", - className: "Job", - modelProperties: { - ...BaseModel.type.modelProperties, - status: { - required: true, - serializedName: "status", - type: { - name: "Enum", - allowedValues: [ - "Invalid", - "Running", - "Succeeded", - "Failed", - "Canceled", - "Paused", - "Scheduled" - ] - } - }, - startTime: { - serializedName: "startTime", - type: { - name: "DateTime" - } - }, - endTime: { - serializedName: "endTime", - type: { - name: "DateTime" + allowedValues: ["Unknown", "Initializing", "Downloading", "Verifying"] } }, percentComplete: { - required: true, - serializedName: "percentComplete", - type: { - name: "Number" - } - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "JobErrorDetails" - } - }, - jobType: { - required: true, - serializedName: "properties.jobType", - type: { - name: "Enum", - allowedValues: [ - "Backup", - "Clone", - "Failover", - "DownloadUpdates", - "InstallUpdates" - ] - } - }, - targetId: { - serializedName: "properties.targetId", - type: { - name: "String" - } - }, - entityId: { - serializedName: "properties.entityId", - type: { - name: "String" - } - }, - entityType: { - serializedName: "properties.entityType", - type: { - name: "String" - } - }, - jobStages: { - serializedName: "properties.jobStages", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "JobStage" - } - } - } - }, - deviceId: { - serializedName: "properties.deviceId", - type: { - name: "String" - } - }, - isCancellable: { - serializedName: "properties.isCancellable", - type: { - name: "Boolean" - } - }, - stats: { - serializedName: "properties.stats", - type: { - name: "Composite", - className: "JobStats" - } - }, - targetType: { - serializedName: "properties.targetType", - type: { - name: "Enum", - allowedValues: [ - "FileServer", - "DiskServer" - ] + serializedName: "percentComplete", + type: { + name: "Number" } }, - sourceDeviceId: { - serializedName: "properties.sourceDeviceId", + totalBytesToDownload: { + serializedName: "totalBytesToDownload", type: { - name: "String" + name: "Number" } }, - backupPointInTime: { - serializedName: "properties.backupPointInTime", + totalBytesDownloaded: { + serializedName: "totalBytesDownloaded", type: { - name: "DateTime" + name: "Number" } }, - downloadProgress: { - serializedName: "properties.downloadProgress", + numberOfUpdatesToDownload: { + serializedName: "numberOfUpdatesToDownload", type: { - name: "Composite", - className: "UpdateDownloadProgress" + name: "Number" } }, - installProgress: { - serializedName: "properties.installProgress", + numberOfUpdatesDownloaded: { + serializedName: "numberOfUpdatesDownloaded", type: { - name: "Composite", - className: "UpdateInstallProgress" + name: "Number" } } } } }; -export const JobFilter: msRest.CompositeMapper = { - serializedName: "JobFilter", +export const UpdateInstallProgress: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobFilter", + className: "UpdateInstallProgress", modelProperties: { - jobType: { - required: true, - serializedName: "jobType", + percentComplete: { + serializedName: "percentComplete", type: { - name: "Enum", - allowedValues: [ - "Backup", - "Clone", - "Failover", - "DownloadUpdates", - "InstallUpdates" - ] + name: "Number" } }, - status: { - required: true, - serializedName: "status", + numberOfUpdatesToInstall: { + serializedName: "numberOfUpdatesToInstall", type: { - name: "Enum", - allowedValues: [ - "Invalid", - "Running", - "Succeeded", - "Failed", - "Canceled", - "Paused", - "Scheduled" - ] + name: "Number" } }, - startTime: { - serializedName: "startTime", + numberOfUpdatesInstalled: { + serializedName: "numberOfUpdatesInstalled", type: { - name: "DateTime" + name: "Number" } } } } }; -export const ManagerIntrinsicSettings: msRest.CompositeMapper = { - serializedName: "ManagerIntrinsicSettings", +export const NodeNetwork: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagerIntrinsicSettings", + className: "NodeNetwork", modelProperties: { - type: { + networkAdapters: { + serializedName: "networkAdapters", required: true, - serializedName: "type", type: { - name: "Enum", - allowedValues: [ - "GardaV1", - "HelsinkiV1" - ] + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkAdapter" + } + } } } } } }; -export const ManagerSku: msRest.CompositeMapper = { - serializedName: "ManagerSku", +export const NetworkAdapter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagerSku", + className: "NetworkAdapter", modelProperties: { - name: { + networkAdapterName: { + serializedName: "networkAdapterName", required: true, - isConstant: true, - serializedName: "name", - defaultValue: 'Standard', type: { name: "String" } + }, + iPv4Info: { + serializedName: "iPv4Info", + type: { + name: "Composite", + className: "IPConfig" + } + }, + iPv6Info: { + serializedName: "iPv6Info", + type: { + name: "Composite", + className: "IPConfig" + } + }, + dhcpStatus: { + serializedName: "dhcpStatus", + required: true, + type: { + name: "Enum", + allowedValues: ["Enabled", "Disabled"] + } + }, + linkSpeed: { + serializedName: "linkSpeed", + type: { + name: "Number" + } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const IPConfig: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "IPConfig", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", + ipAddress: { + serializedName: "ipAddress", + required: true, type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + prefixLength: { + serializedName: "prefixLength", type: { - name: "String" + name: "Number" } }, - location: { + gateway: { + serializedName: "gateway", required: true, - serializedName: "location", type: { name: "String" } - }, - tags: { - serializedName: "tags", + } + } + } +}; + +export const SendTestAlertEmailRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SendTestAlertEmailRequest", + modelProperties: { + emailList: { + serializedName: "emailList", + required: true, type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { name: "String" } @@ -1901,238 +1648,284 @@ export const Resource: msRest.CompositeMapper = { } }; -export const Manager: msRest.CompositeMapper = { - serializedName: "Manager", +export const SymmetricEncryptedSecret: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Manager", + className: "SymmetricEncryptedSecret", modelProperties: { - ...Resource.type.modelProperties, - cisIntrinsicSettings: { - serializedName: "properties.cisIntrinsicSettings", - type: { - name: "Composite", - className: "ManagerIntrinsicSettings" - } - }, - sku: { - isConstant: true, - serializedName: "properties.sku", - defaultValue: {}, + value: { + serializedName: "value", + required: true, type: { - name: "Composite", - className: "ManagerSku" + name: "String" } }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + valueCertificateThumbprint: { + serializedName: "valueCertificateThumbprint", type: { name: "String" } }, - etag: { - serializedName: "etag", + encryptionAlgorithm: { + serializedName: "encryptionAlgorithm", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["None", "AES256", "RSAES_PKCS1_v_1_5"] } } } } }; -export const ManagerExtendedInfo: msRest.CompositeMapper = { - serializedName: "ManagerExtendedInfo", +export const StorageAccountCredentialList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagerExtendedInfo", + className: "StorageAccountCredentialList", modelProperties: { - ...BaseModel.type.modelProperties, - version: { - serializedName: "properties.version", + value: { + serializedName: "value", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageAccountCredential" + } + } } - }, - integrityKey: { + } + } + } +}; + +export const StorageDomainList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageDomainList", + modelProperties: { + value: { + serializedName: "value", required: true, - serializedName: "properties.integrityKey", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageDomain" + } + } } - }, - encryptionKey: { - serializedName: "properties.encryptionKey", + } + } + } +}; + +export const AlertFilter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AlertFilter", + modelProperties: { + status: { + serializedName: "status", type: { - name: "String" + name: "Enum", + allowedValues: ["Active", "Cleared"] } }, - encryptionKeyThumbprint: { - serializedName: "properties.encryptionKeyThumbprint", + severity: { + serializedName: "severity", type: { - name: "String" + name: "Enum", + allowedValues: ["Informational", "Warning", "Critical"] } }, - portalCertificateThumbprint: { - serializedName: "properties.portalCertificateThumbprint", + sourceType: { + serializedName: "sourceType", type: { - name: "String" + name: "Enum", + allowedValues: ["Resource", "Device"] } }, - algorithm: { - required: true, - serializedName: "properties.algorithm", + sourceName: { + serializedName: "sourceName", type: { name: "String" } }, - etag: { - serializedName: "etag", + appearedOnTime: { + serializedName: "appearedOnTime", type: { - name: "String" + name: "DateTime" } } } } }; -export const ManagerPatch: msRest.CompositeMapper = { - serializedName: "ManagerPatch", +export const BackupFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagerPatch", + className: "BackupFilter", modelProperties: { - tags: { - serializedName: "tags", + initiatedBy: { + serializedName: "initiatedBy", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Enum", + allowedValues: ["Manual", "Scheduled"] + } + }, + createdTime: { + serializedName: "createdTime", + type: { + name: "DateTime" } } } } }; -export const MetricAvailablity: msRest.CompositeMapper = { - serializedName: "MetricAvailablity", +export const JobFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricAvailablity", + className: "JobFilter", modelProperties: { - timeGrain: { + jobType: { + serializedName: "jobType", required: true, - serializedName: "timeGrain", type: { - name: "String" + name: "Enum", + allowedValues: [ + "Backup", + "Clone", + "Failover", + "DownloadUpdates", + "InstallUpdates" + ] } }, - retention: { + status: { + serializedName: "status", required: true, - serializedName: "retention", type: { - name: "String" + name: "Enum", + allowedValues: [ + "Invalid", + "Running", + "Succeeded", + "Failed", + "Canceled", + "Paused", + "Scheduled" + ] + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "DateTime" } } } } }; -export const MetricData: msRest.CompositeMapper = { - serializedName: "MetricData", +export const MetricFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricData", + className: "MetricFilter", modelProperties: { - timeStamp: { - required: true, - serializedName: "timeStamp", - type: { - name: "DateTime" - } - }, - sum: { - required: true, - serializedName: "sum", - type: { - name: "Number" - } - }, - count: { - required: true, - serializedName: "count", + name: { + serializedName: "name", type: { - name: "Number" + name: "Composite", + className: "MetricNameFilter" } }, - average: { - required: true, - serializedName: "average", + startTime: { + serializedName: "startTime", type: { - name: "Number" + name: "DateTime" } }, - minimum: { - required: true, - serializedName: "minimum", + endTime: { + serializedName: "endTime", type: { - name: "Number" + name: "DateTime" } }, - maximum: { - required: true, - serializedName: "maximum", + timeGrain: { + serializedName: "timeGrain", type: { - name: "Number" + name: "String" } } } } }; -export const MetricName: msRest.CompositeMapper = { - serializedName: "MetricName", +export const MetricNameFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricName", + className: "MetricNameFilter", modelProperties: { value: { - required: true, serializedName: "value", type: { name: "String" } - }, - localizedValue: { - required: true, - serializedName: "localizedValue", - type: { - name: "String" - } } } } }; -export const MetricDimension: msRest.CompositeMapper = { - serializedName: "MetricDimension", +export const Manager: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricDimension", + className: "Manager", modelProperties: { - name: { - required: true, - serializedName: "name", + ...Resource.type.modelProperties, + etag: { + serializedName: "etag", type: { name: "String" } }, - value: { + cisIntrinsicSettings: { + serializedName: "properties.cisIntrinsicSettings", + type: { + name: "Composite", + className: "ManagerIntrinsicSettings" + } + }, + sku: { + serializedName: "properties.sku", + type: { + name: "Composite", + className: "ManagerSku" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AccessControlRecord: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessControlRecord", + modelProperties: { + ...BaseModel.type.modelProperties, + initiatorName: { + serializedName: "properties.initiatorName", required: true, - serializedName: "value", type: { name: "String" } @@ -2141,897 +1934,931 @@ export const MetricDimension: msRest.CompositeMapper = { } }; -export const MetricDefinition: msRest.CompositeMapper = { - serializedName: "MetricDefinition", +export const Alert: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricDefinition", + className: "Alert", modelProperties: { - name: { + ...BaseModel.type.modelProperties, + title: { + serializedName: "properties.title", required: true, - serializedName: "name", type: { - name: "Composite", - className: "MetricName" + name: "String" } }, - unit: { + scope: { + serializedName: "properties.scope", required: true, - serializedName: "unit", type: { name: "Enum", - allowedValues: [ - "Bytes", - "BytesPerSecond", - "Count", - "CountPerSecond", - "Percent", - "Seconds" - ] + allowedValues: ["Resource", "Device"] } }, - primaryAggregationType: { + alertType: { + serializedName: "properties.alertType", required: true, - serializedName: "primaryAggregationType", type: { - name: "Enum", - allowedValues: [ - "Average", - "Last", - "Maximum", - "Minimum", - "None", - "Total" - ] + name: "String" } }, - resourceId: { + appearedAtTime: { + serializedName: "properties.appearedAtTime", required: true, - serializedName: "resourceId", + type: { + name: "DateTime" + } + }, + appearedAtSourceTime: { + serializedName: "properties.appearedAtSourceTime", + required: true, + type: { + name: "DateTime" + } + }, + clearedAtTime: { + serializedName: "properties.clearedAtTime", + type: { + name: "DateTime" + } + }, + clearedAtSourceTime: { + serializedName: "properties.clearedAtSourceTime", + type: { + name: "DateTime" + } + }, + source: { + serializedName: "properties.source", + type: { + name: "Composite", + className: "AlertSource" + } + }, + recommendation: { + serializedName: "properties.recommendation", type: { name: "String" } }, - metricAvailabilities: { + resolutionReason: { + serializedName: "properties.resolutionReason", + type: { + name: "String" + } + }, + severity: { + serializedName: "properties.severity", required: true, - serializedName: "metricAvailabilities", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricAvailablity" - } - } + name: "Enum", + allowedValues: ["Informational", "Warning", "Critical"] } }, - dimensions: { + status: { + serializedName: "properties.status", required: true, - serializedName: "dimensions", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricDimension" - } - } + name: "Enum", + allowedValues: ["Active", "Cleared"] } }, - type: { - required: true, - serializedName: "type", + errorDetails: { + serializedName: "properties.errorDetails", type: { - name: "String" + name: "Composite", + className: "AlertErrorDetails" } - } - } - } -}; - -export const MetricNameFilter: msRest.CompositeMapper = { - serializedName: "MetricNameFilter", - type: { - name: "Composite", - className: "MetricNameFilter", - modelProperties: { - value: { - serializedName: "value", + }, + detailedInformation: { + serializedName: "properties.detailedInformation", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const MetricFilter: msRest.CompositeMapper = { - serializedName: "MetricFilter", +export const BackupElement: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricFilter", + className: "BackupElement", modelProperties: { - name: { - serializedName: "name", - type: { - name: "Composite", - className: "MetricNameFilter" - } - }, - startTime: { - serializedName: "startTime", + ...BaseModel.type.modelProperties, + sizeInBytes: { + serializedName: "properties.sizeInBytes", + required: true, type: { - name: "DateTime" + name: "Number" } }, - endTime: { - serializedName: "endTime", + endpointName: { + serializedName: "properties.endpointName", + required: true, type: { - name: "DateTime" + name: "String" } }, - timeGrain: { - serializedName: "timeGrain", + dataPolicy: { + serializedName: "properties.dataPolicy", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Invalid", "Local", "Tiered", "Cloud"] } } } } }; -export const Metrics: msRest.CompositeMapper = { - serializedName: "Metrics", +export const Backup: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Metrics", + className: "Backup", modelProperties: { - resourceId: { - required: true, - serializedName: "resourceId", + ...BaseModel.type.modelProperties, + targetId: { + serializedName: "properties.targetId", type: { name: "String" } }, - startTime: { - required: true, - serializedName: "startTime", + targetType: { + serializedName: "properties.targetType", type: { - name: "DateTime" + name: "String" } }, - endTime: { + sizeInBytes: { + serializedName: "properties.sizeInBytes", required: true, - serializedName: "endTime", + type: { + name: "Number" + } + }, + createdTime: { + serializedName: "properties.createdTime", type: { name: "DateTime" } }, - timeGrain: { - required: true, - serializedName: "timeGrain", + expirationTime: { + serializedName: "properties.expirationTime", type: { - name: "String" + name: "DateTime" } }, - primaryAggregation: { + initiatedBy: { + serializedName: "properties.initiatedBy", required: true, - serializedName: "primaryAggregation", type: { name: "Enum", - allowedValues: [ - "Average", - "Last", - "Maximum", - "Minimum", - "None", - "Total" - ] + allowedValues: ["Manual", "Scheduled"] } }, - name: { + deviceId: { + serializedName: "properties.deviceId", required: true, - serializedName: "name", type: { - name: "Composite", - className: "MetricName" + name: "String" } }, - dimensions: { + elements: { + serializedName: "properties.elements", required: true, - serializedName: "dimensions", type: { name: "Sequence", element: { type: { name: "Composite", - className: "MetricDimension" + className: "BackupElement" } } } - }, - unit: { - required: true, - serializedName: "unit", + } + } + } +}; + +export const UploadCertificateResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UploadCertificateResponse", + modelProperties: { + ...BaseModel.type.modelProperties, + authType: { + serializedName: "properties.authType", type: { name: "Enum", allowedValues: [ - "Bytes", - "BytesPerSecond", - "Count", - "CountPerSecond", - "Percent", - "Seconds" + "Invalid", + "AccessControlService", + "AzureActiveDirectory" ] } }, - type: { + certificate: { + serializedName: "properties.certificate", required: true, - serializedName: "type", type: { name: "String" } }, - values: { + resourceId: { + serializedName: "properties.resourceId", required: true, - serializedName: "values", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricData" - } - } + name: "Number" } - } - } - } -}; - -export const NetworkAdapter: msRest.CompositeMapper = { - serializedName: "NetworkAdapter", - type: { - name: "Composite", - className: "NetworkAdapter", - modelProperties: { - networkAdapterName: { + }, + aadAuthority: { + serializedName: "properties.aadAuthority", required: true, - serializedName: "networkAdapterName", type: { name: "String" } }, - iPv4Info: { - serializedName: "iPv4Info", + aadTenantId: { + serializedName: "properties.aadTenantId", + required: true, type: { - name: "Composite", - className: "IPConfig" + name: "String" } }, - iPv6Info: { - serializedName: "iPv6Info", + servicePrincipalClientId: { + serializedName: "properties.servicePrincipalClientId", + required: true, type: { - name: "Composite", - className: "IPConfig" + name: "String" } }, - dhcpStatus: { + servicePrincipalObjectId: { + serializedName: "properties.servicePrincipalObjectId", required: true, - serializedName: "dhcpStatus", type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] + name: "String" } }, - linkSpeed: { - serializedName: "linkSpeed", + azureManagementEndpointAudience: { + serializedName: "properties.azureManagementEndpointAudience", + required: true, type: { - name: "Number" + name: "String" } - } - } - } -}; - -export const NodeNetwork: msRest.CompositeMapper = { - serializedName: "NodeNetwork", - type: { - name: "Composite", - className: "NodeNetwork", - modelProperties: { - networkAdapters: { + }, + subject: { + serializedName: "properties.subject", required: true, - serializedName: "networkAdapters", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NetworkAdapter" - } - } + name: "String" } - } - } - } -}; - -export const NetworkSettings: msRest.CompositeMapper = { - serializedName: "NetworkSettings", - type: { - name: "Composite", - className: "NetworkSettings", - modelProperties: { - ...BaseModel.type.modelProperties, - primaryDnsServer: { + }, + validFrom: { + serializedName: "properties.validFrom", + required: true, + type: { + name: "DateTime" + } + }, + validTo: { + serializedName: "properties.validTo", + required: true, + type: { + name: "DateTime" + } + }, + thumbprint: { + serializedName: "properties.thumbprint", required: true, - serializedName: "properties.primaryDnsServer", type: { name: "String" } }, - secondaryDnsServer: { - serializedName: "properties.secondaryDnsServer", + friendlyName: { + serializedName: "properties.friendlyName", + required: true, type: { name: "String" } }, - nodeNetworks: { + issuer: { + serializedName: "properties.issuer", required: true, - serializedName: "properties.nodeNetworks", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NodeNetwork" - } - } + name: "String" } } } } }; -export const SecuritySettings: msRest.CompositeMapper = { - serializedName: "SecuritySettings", +export const Device: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SecuritySettings", + className: "Device", modelProperties: { ...BaseModel.type.modelProperties, - deviceAdminPassword: { - required: true, - serializedName: "properties.deviceAdminPassword", + activationTime: { + serializedName: "properties.activationTime", type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" + name: "DateTime" } - } - } - } -}; - -export const SendTestAlertEmailRequest: msRest.CompositeMapper = { - serializedName: "SendTestAlertEmailRequest", - type: { - name: "Composite", - className: "SendTestAlertEmailRequest", - modelProperties: { - emailList: { - required: true, - serializedName: "emailList", + }, + allowedDeviceOperations: { + serializedName: "properties.allowedDeviceOperations", type: { name: "Sequence", element: { type: { - name: "String" + name: "Enum", + allowedValues: [ + "None", + "Delete", + "DeleteWithWarning", + "DRSource", + "DRTarget", + "Browsable", + "ReadOnlyForDR", + "Deactivate" + ] } } } - } - } - } -}; - -export const StorageAccountCredential: msRest.CompositeMapper = { - serializedName: "StorageAccountCredential", - type: { - name: "Composite", - className: "StorageAccountCredential", - modelProperties: { - ...BaseModel.type.modelProperties, - cloudType: { - required: true, - serializedName: "properties.cloudType", + }, + culture: { + serializedName: "properties.culture", type: { - name: "Enum", - allowedValues: [ - "Azure", - "S3", - "S3_RRS", - "OpenStack", - "HP" - ] + name: "String" } }, - endPoint: { - required: true, - serializedName: "properties.endPoint", + deviceCapabilities: { + serializedName: "properties.deviceCapabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: ["Invalid", "FileServer", "IscsiServer"] + } + } + } + }, + deviceDescription: { + serializedName: "properties.deviceDescription", type: { name: "String" } }, - login: { - required: true, - serializedName: "properties.login", + domainName: { + serializedName: "properties.domainName", type: { name: "String" } }, - location: { - serializedName: "properties.location", + deviceSoftwareVersion: { + serializedName: "properties.deviceSoftwareVersion", type: { name: "String" } }, - enableSSL: { - required: true, - serializedName: "properties.enableSSL", + friendlySoftwareName: { + serializedName: "properties.friendlySoftwareName", + type: { + name: "String" + } + }, + deviceConfigurationStatus: { + serializedName: "properties.deviceConfigurationStatus", + type: { + name: "Enum", + allowedValues: ["Complete", "Pending"] + } + }, + modelDescription: { + serializedName: "properties.modelDescription", + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "Enum", + allowedValues: [ + "Unknown", + "Online", + "Offline", + "RequiresAttention", + "MaintenanceMode", + "Creating", + "Provisioning", + "Deleted", + "ReadyToSetup", + "Deactivated", + "Deactivating" + ] + } + }, + typePropertiesType: { + serializedName: "properties.type", type: { name: "Enum", allowedValues: [ - "Enabled", - "Disabled" + "Invalid", + "Appliance", + "VirtualAppliance", + "Series9000OnPremVirtualAppliance", + "Series9000VirtualAppliance", + "Series9000PhysicalAppliance" ] } }, - accessKey: { - serializedName: "properties.accessKey", + details: { + serializedName: "properties.details", type: { name: "Composite", - className: "AsymmetricEncryptedSecret" + className: "DeviceDetails" } } } } }; -export const StorageDomain: msRest.CompositeMapper = { - serializedName: "StorageDomain", +export const AlertSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageDomain", + className: "AlertSettings", modelProperties: { ...BaseModel.type.modelProperties, - storageAccountCredentialIds: { + emailNotification: { + serializedName: "properties.emailNotification", required: true, - serializedName: "properties.storageAccountCredentialIds", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } }, - encryptionKey: { - serializedName: "properties.encryptionKey", + notificationToServiceOwners: { + serializedName: "properties.notificationToServiceOwners", + required: true, type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } }, - encryptionStatus: { + alertNotificationCulture: { + serializedName: "properties.alertNotificationCulture", required: true, - serializedName: "properties.encryptionStatus", type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] + name: "String" + } + }, + additionalRecipientEmailList: { + serializedName: "properties.additionalRecipientEmailList", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const SymmetricEncryptedSecret: msRest.CompositeMapper = { - serializedName: "SymmetricEncryptedSecret", +export const FileShare: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SymmetricEncryptedSecret", + className: "FileShare", modelProperties: { - value: { - required: true, - serializedName: "value", + ...BaseModel.type.modelProperties, + description: { + serializedName: "properties.description", type: { name: "String" } }, - valueCertificateThumbprint: { - serializedName: "valueCertificateThumbprint", + shareStatus: { + serializedName: "properties.shareStatus", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Online", "Offline"] } }, - encryptionAlgorithm: { + dataPolicy: { + serializedName: "properties.dataPolicy", required: true, - serializedName: "encryptionAlgorithm", type: { name: "Enum", - allowedValues: [ - "None", - "AES256", - "RSAES_PKCS1_v_1_5" - ] + allowedValues: ["Invalid", "Local", "Tiered", "Cloud"] } - } - } - } -}; - -export const TimeSettings: msRest.CompositeMapper = { - serializedName: "TimeSettings", - type: { - name: "Composite", - className: "TimeSettings", - modelProperties: { - ...BaseModel.type.modelProperties, - timeZone: { + }, + adminUser: { + serializedName: "properties.adminUser", required: true, - serializedName: "properties.timeZone", type: { name: "String" } }, - primaryTimeServer: { + provisionedCapacityInBytes: { + serializedName: "properties.provisionedCapacityInBytes", required: true, - serializedName: "properties.primaryTimeServer", type: { - name: "String" + name: "Number" } }, - secondaryTimeServer: { - serializedName: "properties.secondaryTimeServer", + usedCapacityInBytes: { + serializedName: "properties.usedCapacityInBytes", + readOnly: true, + type: { + name: "Number" + } + }, + localUsedCapacityInBytes: { + serializedName: "properties.localUsedCapacityInBytes", + readOnly: true, + type: { + name: "Number" + } + }, + monitoringStatus: { + serializedName: "properties.monitoringStatus", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } } } } }; -export const Updates: msRest.CompositeMapper = { - serializedName: "Updates", +export const IscsiDisk: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Updates", + className: "IscsiDisk", modelProperties: { ...BaseModel.type.modelProperties, - deviceVersion: { - serializedName: "properties.deviceVersion", + description: { + serializedName: "properties.description", type: { name: "String" } }, - deviceLastScannedTime: { - serializedName: "properties.deviceLastScannedTime", + diskStatus: { + serializedName: "properties.diskStatus", + required: true, type: { - name: "DateTime" + name: "Enum", + allowedValues: ["Online", "Offline"] } }, - regularUpdatesAvailable: { - serializedName: "properties.regularUpdatesAvailable", + accessControlRecords: { + serializedName: "properties.accessControlRecords", + required: true, type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - rebootRequiredForInstall: { - serializedName: "properties.rebootRequiredForInstall", + dataPolicy: { + serializedName: "properties.dataPolicy", + required: true, type: { - name: "Boolean" + name: "Enum", + allowedValues: ["Invalid", "Local", "Tiered", "Cloud"] } }, - totalItemsPendingForDownload: { - serializedName: "properties.totalItemsPendingForDownload", + provisionedCapacityInBytes: { + serializedName: "properties.provisionedCapacityInBytes", + required: true, type: { name: "Number" } }, - totalItemsPendingForInstall: { - serializedName: "properties.totalItemsPendingForInstall", + usedCapacityInBytes: { + serializedName: "properties.usedCapacityInBytes", + readOnly: true, type: { name: "Number" } }, - status: { - serializedName: "properties.status", + localUsedCapacityInBytes: { + serializedName: "properties.localUsedCapacityInBytes", + readOnly: true, type: { - name: "Enum", - allowedValues: [ - "Idle", - "Scanning", - "Downloading", - "Installing" - ] + name: "Number" } }, - lastCompletedScanTime: { - serializedName: "properties.lastCompletedScanTime", + monitoringStatus: { + serializedName: "properties.monitoringStatus", + required: true, type: { - name: "DateTime" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } - }, - lastCompletedDownloadJobTime: { - serializedName: "properties.lastCompletedDownloadJobTime", + } + } + } +}; + +export const BackupScheduleGroup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupScheduleGroup", + modelProperties: { + ...BaseModel.type.modelProperties, + startTime: { + serializedName: "properties.startTime", type: { - name: "DateTime" + name: "Composite", + className: "Time" } - }, - lastCompletedInstallJobTime: { - serializedName: "properties.lastCompletedInstallJobTime", + } + } + } +}; + +export const ChapSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChapSettings", + modelProperties: { + ...BaseModel.type.modelProperties, + password: { + serializedName: "properties.password", type: { - name: "DateTime" + name: "Composite", + className: "AsymmetricEncryptedSecret" } - }, - inProgressDownloadJobId: { - serializedName: "properties.inProgressDownloadJobId", + } + } + } +}; + +export const FileServer: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileServer", + modelProperties: { + ...BaseModel.type.modelProperties, + domainName: { + serializedName: "properties.domainName", + required: true, type: { name: "String" } }, - inProgressInstallJobId: { - serializedName: "properties.inProgressInstallJobId", + storageDomainId: { + serializedName: "properties.storageDomainId", + required: true, type: { name: "String" } }, - inProgressScanStartedTime: { - serializedName: "properties.inProgressScanStartedTime", - type: { - name: "DateTime" - } - }, - inProgressDownloadJobStartedTime: { - serializedName: "properties.inProgressDownloadJobStartedTime", + backupScheduleGroupId: { + serializedName: "properties.backupScheduleGroupId", + required: true, type: { - name: "DateTime" + name: "String" } }, - inProgressInstallJobStartedTime: { - serializedName: "properties.inProgressInstallJobStartedTime", + description: { + serializedName: "properties.description", type: { - name: "DateTime" + name: "String" } } } } }; -export const UploadCertificateRequest: msRest.CompositeMapper = { - serializedName: "UploadCertificateRequest", +export const IscsiServer: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UploadCertificateRequest", + className: "IscsiServer", modelProperties: { - authType: { - serializedName: "properties.authType", + ...BaseModel.type.modelProperties, + storageDomainId: { + serializedName: "properties.storageDomainId", + required: true, type: { - name: "Enum", - allowedValues: [ - "Invalid", - "AccessControlService", - "AzureActiveDirectory" - ] + name: "String" } }, - certificate: { + backupScheduleGroupId: { + serializedName: "properties.backupScheduleGroupId", required: true, - serializedName: "properties.certificate", type: { name: "String" } }, - contractVersion: { - readOnly: true, - serializedName: "contractVersion", + description: { + serializedName: "properties.description", type: { - name: "Enum", - allowedValues: [ - "InvalidVersion", - "V2011_09", - "V2012_02", - "V2012_05", - "V2012_12", - "V2013_04", - "V2013_10", - "V2013_11", - "V2014_04", - "V2014_06", - "V2014_07", - "V2014_09", - "V2014_10", - "V2014_12", - "V2015_01", - "V2015_02", - "V2015_04", - "V2015_05", - "V2015_06", - "V2015_07", - "V2015_08", - "V2015_10", - "V2015_12", - "V2016_01", - "V2016_02", - "V2016_04", - "V2016_05", - "V2016_07", - "V2016_08" - ] + name: "String" + } + }, + chapId: { + serializedName: "properties.chapId", + type: { + name: "String" + } + }, + reverseChapId: { + serializedName: "properties.reverseChapId", + type: { + name: "String" } } } } }; -export const UploadCertificateResponse: msRest.CompositeMapper = { - serializedName: "UploadCertificateResponse", +export const Job: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UploadCertificateResponse", + className: "Job", modelProperties: { ...BaseModel.type.modelProperties, - authType: { - serializedName: "properties.authType", + status: { + serializedName: "status", + required: true, type: { name: "Enum", allowedValues: [ "Invalid", - "AccessControlService", - "AzureActiveDirectory" + "Running", + "Succeeded", + "Failed", + "Canceled", + "Paused", + "Scheduled" ] } }, - certificate: { - required: true, - serializedName: "properties.certificate", + startTime: { + serializedName: "startTime", type: { - name: "String" + name: "DateTime" } }, - resourceId: { + endTime: { + serializedName: "endTime", + type: { + name: "DateTime" + } + }, + percentComplete: { + serializedName: "percentComplete", required: true, - serializedName: "properties.resourceId", type: { name: "Number" } }, - aadAuthority: { - required: true, - serializedName: "properties.aadAuthority", + error: { + serializedName: "error", + type: { + name: "Composite", + className: "JobErrorDetails" + } + }, + jobType: { + serializedName: "properties.jobType", + type: { + name: "Enum", + allowedValues: [ + "Backup", + "Clone", + "Failover", + "DownloadUpdates", + "InstallUpdates" + ] + } + }, + targetId: { + serializedName: "properties.targetId", type: { name: "String" } }, - aadTenantId: { - required: true, - serializedName: "properties.aadTenantId", + entityId: { + serializedName: "properties.entityId", type: { name: "String" } }, - servicePrincipalClientId: { - required: true, - serializedName: "properties.servicePrincipalClientId", + entityType: { + serializedName: "properties.entityType", type: { name: "String" } }, - servicePrincipalObjectId: { - required: true, - serializedName: "properties.servicePrincipalObjectId", + jobStages: { + serializedName: "properties.jobStages", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "JobStage" + } + } } }, - azureManagementEndpointAudience: { - required: true, - serializedName: "properties.azureManagementEndpointAudience", + deviceId: { + serializedName: "properties.deviceId", type: { name: "String" } }, - subject: { - required: true, - serializedName: "properties.subject", + isCancellable: { + serializedName: "properties.isCancellable", type: { - name: "String" + name: "Boolean" } }, - validFrom: { - required: true, - serializedName: "properties.validFrom", + stats: { + serializedName: "properties.stats", type: { - name: "DateTime" + name: "Composite", + className: "JobStats" } }, - validTo: { - required: true, - serializedName: "properties.validTo", + targetType: { + serializedName: "properties.targetType", type: { - name: "DateTime" + name: "Enum", + allowedValues: ["FileServer", "DiskServer"] } }, - thumbprint: { - required: true, - serializedName: "properties.thumbprint", + sourceDeviceId: { + serializedName: "properties.sourceDeviceId", type: { name: "String" } }, - friendlyName: { - required: true, - serializedName: "properties.friendlyName", + backupPointInTime: { + serializedName: "properties.backupPointInTime", type: { - name: "String" + name: "DateTime" } }, - issuer: { - required: true, - serializedName: "properties.issuer", + downloadProgress: { + serializedName: "properties.downloadProgress", type: { - name: "String" + name: "Composite", + className: "UpdateDownloadProgress" + } + }, + installProgress: { + serializedName: "properties.installProgress", + type: { + name: "Composite", + className: "UpdateInstallProgress" } } } } }; -export const ManagerList: msRest.CompositeMapper = { - serializedName: "ManagerList", +export const NetworkSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagerList", + className: "NetworkSettings", modelProperties: { - value: { + ...BaseModel.type.modelProperties, + primaryDnsServer: { + serializedName: "properties.primaryDnsServer", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Manager" - } - } + name: "String" } - } - } - } -}; - -export const MetricList: msRest.CompositeMapper = { - serializedName: "MetricList", - type: { - name: "Composite", - className: "MetricList", - modelProperties: { - value: { + }, + secondaryDnsServer: { + serializedName: "properties.secondaryDnsServer", + type: { + name: "String" + } + }, + nodeNetworks: { + serializedName: "properties.nodeNetworks", required: true, - serializedName: "", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Metrics" + className: "NodeNetwork" } } } @@ -3040,50 +2867,45 @@ export const MetricList: msRest.CompositeMapper = { } }; -export const MetricDefinitionList: msRest.CompositeMapper = { - serializedName: "MetricDefinitionList", +export const SecuritySettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricDefinitionList", + className: "SecuritySettings", modelProperties: { - value: { - required: true, - serializedName: "", + ...BaseModel.type.modelProperties, + deviceAdminPassword: { + serializedName: "properties.deviceAdminPassword", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricDefinition" - } - } + name: "Composite", + className: "AsymmetricEncryptedSecret" } } } } }; -export const AvailableProviderOperations: msRest.CompositeMapper = { - serializedName: "AvailableProviderOperations", +export const TimeSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailableProviderOperations", + className: "TimeSettings", modelProperties: { - value: { + ...BaseModel.type.modelProperties, + timeZone: { + serializedName: "properties.timeZone", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AvailableProviderOperation" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + primaryTimeServer: { + serializedName: "properties.primaryTimeServer", + required: true, + type: { + name: "String" + } + }, + secondaryTimeServer: { + serializedName: "properties.secondaryTimeServer", type: { name: "String" } @@ -3092,318 +2914,272 @@ export const AvailableProviderOperations: msRest.CompositeMapper = { } }; -export const AccessControlRecordList: msRest.CompositeMapper = { - serializedName: "AccessControlRecordList", +export const Updates: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessControlRecordList", + className: "Updates", modelProperties: { - value: { - required: true, - serializedName: "", + ...BaseModel.type.modelProperties, + deviceVersion: { + serializedName: "properties.deviceVersion", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessControlRecord" - } - } + name: "String" + } + }, + deviceLastScannedTime: { + serializedName: "properties.deviceLastScannedTime", + type: { + name: "DateTime" + } + }, + regularUpdatesAvailable: { + serializedName: "properties.regularUpdatesAvailable", + type: { + name: "Boolean" + } + }, + rebootRequiredForInstall: { + serializedName: "properties.rebootRequiredForInstall", + type: { + name: "Boolean" + } + }, + totalItemsPendingForDownload: { + serializedName: "properties.totalItemsPendingForDownload", + type: { + name: "Number" + } + }, + totalItemsPendingForInstall: { + serializedName: "properties.totalItemsPendingForInstall", + type: { + name: "Number" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "Enum", + allowedValues: ["Idle", "Scanning", "Downloading", "Installing"] + } + }, + lastCompletedScanTime: { + serializedName: "properties.lastCompletedScanTime", + type: { + name: "DateTime" + } + }, + lastCompletedDownloadJobTime: { + serializedName: "properties.lastCompletedDownloadJobTime", + type: { + name: "DateTime" + } + }, + lastCompletedInstallJobTime: { + serializedName: "properties.lastCompletedInstallJobTime", + type: { + name: "DateTime" + } + }, + inProgressDownloadJobId: { + serializedName: "properties.inProgressDownloadJobId", + type: { + name: "String" + } + }, + inProgressInstallJobId: { + serializedName: "properties.inProgressInstallJobId", + type: { + name: "String" + } + }, + inProgressScanStartedTime: { + serializedName: "properties.inProgressScanStartedTime", + type: { + name: "DateTime" + } + }, + inProgressDownloadJobStartedTime: { + serializedName: "properties.inProgressDownloadJobStartedTime", + type: { + name: "DateTime" + } + }, + inProgressInstallJobStartedTime: { + serializedName: "properties.inProgressInstallJobStartedTime", + type: { + name: "DateTime" } } } } }; -export const AlertList: msRest.CompositeMapper = { - serializedName: "AlertList", +export const EncryptionSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertList", + className: "EncryptionSettings", modelProperties: { - value: { + ...BaseModel.type.modelProperties, + encryptionStatus: { + serializedName: "properties.encryptionStatus", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Alert" - } - } + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } }, - nextLink: { - serializedName: "nextLink", + keyRolloverStatus: { + serializedName: "properties.keyRolloverStatus", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Required", "NotRequired"] } } } } }; -export const BackupList: msRest.CompositeMapper = { - serializedName: "BackupList", +export const ManagerExtendedInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BackupList", + className: "ManagerExtendedInfo", modelProperties: { - value: { - required: true, - serializedName: "", + ...BaseModel.type.modelProperties, + etag: { + serializedName: "etag", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Backup" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + version: { + serializedName: "properties.version", type: { name: "String" } - } - } - } -}; - -export const DeviceList: msRest.CompositeMapper = { - serializedName: "DeviceList", - type: { - name: "Composite", - className: "DeviceList", - modelProperties: { - value: { + }, + integrityKey: { + serializedName: "properties.integrityKey", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Device" - } - } + name: "String" } - } - } - } -}; - -export const BackupScheduleGroupList: msRest.CompositeMapper = { - serializedName: "BackupScheduleGroupList", - type: { - name: "Composite", - className: "BackupScheduleGroupList", - modelProperties: { - value: { - required: true, - serializedName: "", + }, + encryptionKey: { + serializedName: "properties.encryptionKey", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BackupScheduleGroup" - } - } + name: "String" } - } - } - } -}; - -export const ChapSettingsList: msRest.CompositeMapper = { - serializedName: "ChapSettingsList", - type: { - name: "Composite", - className: "ChapSettingsList", - modelProperties: { - value: { - required: true, - serializedName: "", + }, + encryptionKeyThumbprint: { + serializedName: "properties.encryptionKeyThumbprint", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ChapSettings" - } - } + name: "String" } - } - } - } -}; - -export const ISCSIDiskList: msRest.CompositeMapper = { - serializedName: "ISCSIDiskList", - type: { - name: "Composite", - className: "ISCSIDiskList", - modelProperties: { - value: { - required: true, - serializedName: "", + }, + portalCertificateThumbprint: { + serializedName: "properties.portalCertificateThumbprint", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ISCSIDisk" - } - } + name: "String" } - } - } - } -}; - -export const FileServerList: msRest.CompositeMapper = { - serializedName: "FileServerList", - type: { - name: "Composite", - className: "FileServerList", - modelProperties: { - value: { + }, + algorithm: { + serializedName: "properties.algorithm", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FileServer" - } - } + name: "String" } } } } }; -export const FileShareList: msRest.CompositeMapper = { - serializedName: "FileShareList", +export const StorageAccountCredential: coreClient.CompositeMapper = { type: { name: "Composite", - className: "FileShareList", + className: "StorageAccountCredential", modelProperties: { - value: { + ...BaseModel.type.modelProperties, + cloudType: { + serializedName: "properties.cloudType", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FileShare" - } - } + name: "Enum", + allowedValues: ["Azure", "S3", "S3_RRS", "OpenStack", "HP"] } - } - } - } -}; - -export const ISCSIServerList: msRest.CompositeMapper = { - serializedName: "ISCSIServerList", - type: { - name: "Composite", - className: "ISCSIServerList", - modelProperties: { - value: { + }, + endPoint: { + serializedName: "properties.endPoint", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ISCSIServer" - } - } + name: "String" } - } - } - } -}; - -export const JobList: msRest.CompositeMapper = { - serializedName: "JobList", - type: { - name: "Composite", - className: "JobList", - modelProperties: { - value: { + }, + login: { + serializedName: "properties.login", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Job" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + location: { + serializedName: "properties.location", type: { name: "String" } - } - } - } -}; - -export const StorageAccountCredentialList: msRest.CompositeMapper = { - serializedName: "StorageAccountCredentialList", - type: { - name: "Composite", - className: "StorageAccountCredentialList", - modelProperties: { - value: { + }, + enableSSL: { + serializedName: "properties.enableSSL", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "StorageAccountCredential" - } - } + name: "Enum", + allowedValues: ["Enabled", "Disabled"] + } + }, + accessKey: { + serializedName: "properties.accessKey", + type: { + name: "Composite", + className: "AsymmetricEncryptedSecret" } } } } }; -export const StorageDomainList: msRest.CompositeMapper = { - serializedName: "StorageDomainList", +export const StorageDomain: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageDomainList", + className: "StorageDomain", modelProperties: { - value: { + ...BaseModel.type.modelProperties, + storageAccountCredentialIds: { + serializedName: "properties.storageAccountCredentialIds", required: true, - serializedName: "", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "StorageDomain" + name: "String" } } } + }, + encryptionKey: { + serializedName: "properties.encryptionKey", + type: { + name: "Composite", + className: "AsymmetricEncryptedSecret" + } + }, + encryptionStatus: { + serializedName: "properties.encryptionStatus", + required: true, + type: { + name: "Enum", + allowedValues: ["Enabled", "Disabled"] + } } } } diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/parameters.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/parameters.ts index ebc6c97bd8a8..c5c3cfd47ea0 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/parameters.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/models/parameters.ts @@ -1,154 +1,227 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + Manager as ManagerMapper, + ManagerPatch as ManagerPatchMapper, + UploadCertificateRequest as UploadCertificateRequestMapper, + ManagerExtendedInfo as ManagerExtendedInfoMapper, + AccessControlRecord as AccessControlRecordMapper, + ClearAlertRequest as ClearAlertRequestMapper, + SendTestAlertEmailRequest as SendTestAlertEmailRequestMapper, + CloneRequest as CloneRequestMapper, + DevicePatch as DevicePatchMapper, + AlertSettings as AlertSettingsMapper, + FailoverRequest as FailoverRequestMapper, + SecuritySettings as SecuritySettingsMapper, + BackupScheduleGroup as BackupScheduleGroupMapper, + ChapSettings as ChapSettingsMapper, + IscsiDisk as IscsiDiskMapper, + FileServer as FileServerMapper, + FileShare as FileShareMapper, + IscsiServer as IscsiServerMapper, + StorageAccountCredential as StorageAccountCredentialMapper, + StorageDomain as StorageDomainMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const accessControlRecordName: msRest.OperationURLParameter = { - parameterPath: "accessControlRecordName", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "accessControlRecordName", type: { name: "String" } - } + }, + skipEncoding: true }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "api-version", type: { name: "String" } } }; -export const backupName: msRest.OperationURLParameter = { - parameterPath: "backupName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "backupName", + defaultValue: "2016-10-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const certificateName: msRest.OperationURLParameter = { - parameterPath: "certificateName", + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + serializedName: "resourceGroupName", required: true, - serializedName: "certificateName", type: { name: "String" } } }; -export const chapUserName: msRest.OperationURLParameter = { - parameterPath: "chapUserName", + +export const managerName: OperationURLParameter = { + parameterPath: "managerName", mapper: { + constraints: { + MaxLength: 50, + MinLength: 2 + }, + serializedName: "managerName", required: true, - serializedName: "chapUserName", type: { name: "String" } } }; -export const credentialName: msRest.OperationURLParameter = { - parameterPath: "credentialName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "credentialName", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const deviceName: msRest.OperationURLParameter = { - parameterPath: "deviceName", + +export const manager: OperationParameter = { + parameterPath: "manager", + mapper: ManagerMapper +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: ManagerPatchMapper +}; + +export const uploadCertificateRequestrequest: OperationParameter = { + parameterPath: "uploadCertificateRequestrequest", + mapper: UploadCertificateRequestMapper +}; + +export const certificateName: OperationURLParameter = { + parameterPath: "certificateName", mapper: { + serializedName: "certificateName", required: true, - serializedName: "deviceName", type: { name: "String" } } }; -export const diskName: msRest.OperationURLParameter = { - parameterPath: "diskName", + +export const managerExtendedInfo: OperationParameter = { + parameterPath: "managerExtendedInfo", + mapper: ManagerExtendedInfoMapper +}; + +export const ifMatch: OperationParameter = { + parameterPath: "ifMatch", mapper: { + serializedName: "If-Match", required: true, - serializedName: "diskName", type: { name: "String" } } }; -export const elementName: msRest.OperationURLParameter = { - parameterPath: "elementName", + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], mapper: { - required: true, - serializedName: "elementName", + serializedName: "$filter", type: { name: "String" } } }; -export const expand: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "expand" - ], + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { - serializedName: "$expand", + serializedName: "nextLink", + required: true, type: { name: "String" } - } + }, + skipEncoding: true }; -export const fileServerName: msRest.OperationURLParameter = { - parameterPath: "fileServerName", + +export const accessControlRecordName: OperationURLParameter = { + parameterPath: "accessControlRecordName", mapper: { + serializedName: "accessControlRecordName", required: true, - serializedName: "fileServerName", type: { name: "String" } } }; -export const filter: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "filter" - ], + +export const accessControlRecord: OperationParameter = { + parameterPath: "accessControlRecord", + mapper: AccessControlRecordMapper +}; + +export const request: OperationParameter = { + parameterPath: "request", + mapper: ClearAlertRequestMapper +}; + +export const request1: OperationParameter = { + parameterPath: "request", + mapper: SendTestAlertEmailRequestMapper +}; + +export const deviceName: OperationURLParameter = { + parameterPath: "deviceName", mapper: { - serializedName: "$filter", + serializedName: "deviceName", + required: true, type: { name: "String" } } }; -export const forFailover: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "forFailover" - ], + +export const forFailover: OperationQueryParameter = { + parameterPath: ["options", "forFailover"], mapper: { serializedName: "forFailover", type: { @@ -156,108 +229,199 @@ export const forFailover: msRest.OperationQueryParameter = { } } }; -export const ifMatch: msRest.OperationParameter = { - parameterPath: "ifMatch", + +export const backupName: OperationURLParameter = { + parameterPath: "backupName", mapper: { + serializedName: "backupName", required: true, - serializedName: "If-Match", type: { name: "String" } } }; -export const iscsiServerName: msRest.OperationURLParameter = { - parameterPath: "iscsiServerName", + +export const cloneRequest: OperationParameter = { + parameterPath: "cloneRequest", + mapper: CloneRequestMapper +}; + +export const elementName: OperationURLParameter = { + parameterPath: "elementName", mapper: { + serializedName: "elementName", required: true, - serializedName: "iscsiServerName", type: { name: "String" } } }; -export const jobName: msRest.OperationURLParameter = { - parameterPath: "jobName", + +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], + mapper: { + serializedName: "$expand", + type: { + name: "String" + } + } +}; + +export const devicePatch: OperationParameter = { + parameterPath: "devicePatch", + mapper: DevicePatchMapper +}; + +export const alertSettings: OperationParameter = { + parameterPath: "alertSettings", + mapper: AlertSettingsMapper +}; + +export const failoverRequest: OperationParameter = { + parameterPath: "failoverRequest", + mapper: FailoverRequestMapper +}; + +export const securitySettings: OperationParameter = { + parameterPath: "securitySettings", + mapper: SecuritySettingsMapper +}; + +export const scheduleGroupName: OperationURLParameter = { + parameterPath: "scheduleGroupName", mapper: { + serializedName: "scheduleGroupName", required: true, - serializedName: "jobName", type: { name: "String" } } }; -export const managerName: msRest.OperationURLParameter = { - parameterPath: "managerName", + +export const scheduleGroup: OperationParameter = { + parameterPath: "scheduleGroup", + mapper: BackupScheduleGroupMapper +}; + +export const chapUserName: OperationURLParameter = { + parameterPath: "chapUserName", mapper: { + serializedName: "chapUserName", required: true, - serializedName: "managerName", - constraints: { - MaxLength: 50, - MinLength: 2 - }, type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const chapSetting: OperationParameter = { + parameterPath: "chapSetting", + mapper: ChapSettingsMapper +}; + +export const iscsiServerName: OperationURLParameter = { + parameterPath: "iscsiServerName", mapper: { + serializedName: "iscsiServerName", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const diskName: OperationURLParameter = { + parameterPath: "diskName", mapper: { + serializedName: "diskName", required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const scheduleGroupName: msRest.OperationURLParameter = { - parameterPath: "scheduleGroupName", + +export const iscsiDisk: OperationParameter = { + parameterPath: "iscsiDisk", + mapper: IscsiDiskMapper +}; + +export const fileServerName: OperationURLParameter = { + parameterPath: "fileServerName", mapper: { + serializedName: "fileServerName", required: true, - serializedName: "scheduleGroupName", type: { name: "String" } } }; -export const shareName: msRest.OperationURLParameter = { + +export const fileServer: OperationParameter = { + parameterPath: "fileServer", + mapper: FileServerMapper +}; + +export const shareName: OperationURLParameter = { parameterPath: "shareName", mapper: { - required: true, serializedName: "shareName", + required: true, type: { name: "String" } } }; -export const storageDomainName: msRest.OperationURLParameter = { - parameterPath: "storageDomainName", + +export const fileShare: OperationParameter = { + parameterPath: "fileShare", + mapper: FileShareMapper +}; + +export const iscsiServer: OperationParameter = { + parameterPath: "iscsiServer", + mapper: IscsiServerMapper +}; + +export const jobName: OperationURLParameter = { + parameterPath: "jobName", mapper: { + serializedName: "jobName", required: true, - serializedName: "storageDomainName", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const credentialName: OperationURLParameter = { + parameterPath: "credentialName", mapper: { + serializedName: "credentialName", + required: true, + type: { + name: "String" + } + } +}; + +export const storageAccount: OperationParameter = { + parameterPath: "storageAccount", + mapper: StorageAccountCredentialMapper +}; + +export const storageDomainName: OperationURLParameter = { + parameterPath: "storageDomainName", + mapper: { + serializedName: "storageDomainName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; + +export const storageDomain: OperationParameter = { + parameterPath: "storageDomain", + mapper: StorageDomainMapper +}; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/storageAccountCredentialsMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/storageAccountCredentialsMappers.ts deleted file mode 100644 index 0e1f9f268c5b..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/storageAccountCredentialsMappers.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - StorageAccountCredentialList, - StorageAccountCredential, - BaseModel, - AsymmetricEncryptedSecret, - ErrorModel, - Message, - Item, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - ChapSettings, - FileShare, - ISCSIDisk, - Device, - DeviceDetails, - EncryptionSettings, - FileServer, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageDomain, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/models/storageDomainsMappers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/models/storageDomainsMappers.ts deleted file mode 100644 index 8974f6a87579..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/models/storageDomainsMappers.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - StorageDomainList, - StorageDomain, - BaseModel, - AsymmetricEncryptedSecret, - ErrorModel, - Message, - Item, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupElement, - Backup, - BackupScheduleGroup, - Time, - ChapSettings, - FileShare, - ISCSIDisk, - Device, - DeviceDetails, - EncryptionSettings, - FileServer, - ISCSIServer, - Job, - JobErrorDetails, - JobErrorItem, - JobStage, - JobStats, - UpdateDownloadProgress, - UpdateInstallProgress, - ManagerExtendedInfo, - NetworkSettings, - NodeNetwork, - NetworkAdapter, - IPConfig, - SecuritySettings, - StorageAccountCredential, - TimeSettings, - Updates, - UploadCertificateResponse -} from "../models/mappers"; - diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/accessControlRecords.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/accessControlRecords.ts index ece9c93da883..011270b78644 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/accessControlRecords.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/accessControlRecords.ts @@ -1,29 +1,40 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/accessControlRecordsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessControlRecords } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + AccessControlRecord, + AccessControlRecordsListByManagerOptionalParams, + AccessControlRecordsListByManagerResponse, + AccessControlRecordsGetOptionalParams, + AccessControlRecordsGetResponse, + AccessControlRecordsCreateOrUpdateOptionalParams, + AccessControlRecordsCreateOrUpdateResponse, + AccessControlRecordsDeleteOptionalParams +} from "../models"; -/** Class representing a AccessControlRecords. */ -export class AccessControlRecords { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing AccessControlRecords operations. */ +export class AccessControlRecordsImpl implements AccessControlRecords { + private readonly client: StorSimpleManagementClient; /** - * Create a AccessControlRecords. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class AccessControlRecords class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } @@ -31,32 +42,77 @@ export class AccessControlRecords { * Retrieves all the access control records in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listByManager( + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves all the access control records in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsListByManagerOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listByManagerOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); } /** @@ -64,49 +120,119 @@ export class AccessControlRecords { * @param accessControlRecordName Name of access control record to be fetched. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param accessControlRecordName Name of access control record to be fetched. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(accessControlRecordName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + get( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accessControlRecordName, resourceGroupName, managerName, options }, + getOperationSpec + ); + } + /** - * @param accessControlRecordName Name of access control record to be fetched. + * Creates or Updates an access control record. + * @param accessControlRecordName The name of the access control record. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param accessControlRecord The access control record to be added or updated. + * @param options The options parameters. */ - get(accessControlRecordName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + accessControlRecord: AccessControlRecord, + options?: AccessControlRecordsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccessControlRecordsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { accessControlRecordName, resourceGroupName, managerName, + accessControlRecord, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or Updates an access control record. * @param accessControlRecordName The name of the access control record. - * @param accessControlRecord The access control record to be added or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param accessControlRecord The access control record to be added or updated. + * @param options The options parameters. */ - createOrUpdate(accessControlRecordName: string, accessControlRecord: Models.AccessControlRecord, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(accessControlRecordName,accessControlRecord,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + accessControlRecord: AccessControlRecord, + options?: AccessControlRecordsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + accessControlRecordName, + resourceGroupName, + managerName, + accessControlRecord, + options + ); + return poller.pollUntilDone(); } /** @@ -114,34 +240,62 @@ export class AccessControlRecords { * @param accessControlRecordName The name of the access control record to delete. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(accessControlRecordName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Creates or Updates an access control record. - * @param accessControlRecordName The name of the access control record. - * @param accessControlRecord The access control record to be added or updated. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(accessControlRecordName: string, accessControlRecord: Models.AccessControlRecord, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - accessControlRecordName, - accessControlRecord, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + const lro = new LroImpl( + sendOperation, + { accessControlRecordName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -149,38 +303,30 @@ export class AccessControlRecords { * @param accessControlRecordName The name of the access control record to delete. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - accessControlRecordName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + accessControlRecordName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByManagerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AccessControlRecordList @@ -189,24 +335,20 @@ const listByManagerOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.accessControlRecordName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AccessControlRecord @@ -215,64 +357,72 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.accessControlRecordName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.accessControlRecordName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "accessControlRecord", - mapper: { - ...Mappers.AccessControlRecord, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.AccessControlRecord }, - 202: {}, + 201: { + bodyMapper: Mappers.AccessControlRecord + }, + 202: { + bodyMapper: Mappers.AccessControlRecord + }, + 204: { + bodyMapper: Mappers.AccessControlRecord + }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", + requestBody: Parameters.accessControlRecord, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.accessControlRecordName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.accessControlRecordName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", + httpMethod: "DELETE", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.accessControlRecordName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/alerts.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/alerts.ts index 04d8e63d3a72..0846d10f5f21 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/alerts.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/alerts.ts @@ -1,28 +1,39 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/alertsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Alerts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { + Alert, + AlertsListByManagerNextOptionalParams, + AlertsListByManagerOptionalParams, + AlertsListByManagerResponse, + ClearAlertRequest, + AlertsClearOptionalParams, + SendTestAlertEmailRequest, + AlertsSendTestEmailOptionalParams, + AlertsListByManagerNextResponse +} from "../models"; -/** Class representing a Alerts. */ -export class Alerts { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing Alerts operations. */ +export class AlertsImpl implements Alerts { + private readonly client: StorSimpleManagementClient; /** - * Create a Alerts. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Alerts class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } @@ -30,156 +41,156 @@ export class Alerts { * Retrieves all the alerts in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: Models.AlertsListByManagerOptionalParams): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, options: Models.AlertsListByManagerOptionalParams, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: Models.AlertsListByManagerOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByManager( + resourceGroupName: string, + managerName: string, + options?: AlertsListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: AlertsListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByManagerNext( resourceGroupName, managerName, + continuationToken, options - }, - listByManagerOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: AlertsListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Clear the alerts. - * @param request The clear alert request. + * Retrieves all the alerts in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - clear(request: Models.ClearAlertRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: AlertsListByManagerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); + } + /** - * @param request The clear alert request. + * Clear the alerts. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback - */ - clear(request: Models.ClearAlertRequest, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** * @param request The clear alert request. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - clear(request: Models.ClearAlertRequest, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - clear(request: Models.ClearAlertRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + clear( + resourceGroupName: string, + managerName: string, + request: ClearAlertRequest, + options?: AlertsClearOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - request, - resourceGroupName, - managerName, - options - }, - clearOperationSpec, - callback); + { resourceGroupName, managerName, request, options }, + clearOperationSpec + ); } /** * Sends a test alert email. * @param deviceName The device name. - * @param request The send test alert email request. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - sendTestEmail(deviceName: string, request: Models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param request The send test alert email request. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback - */ - sendTestEmail(deviceName: string, request: Models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. * @param request The send test alert email request. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - sendTestEmail(deviceName: string, request: Models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - sendTestEmail(deviceName: string, request: Models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + sendTestEmail( + deviceName: string, + resourceGroupName: string, + managerName: string, + request: SendTestAlertEmailRequest, + options?: AlertsSendTestEmailOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - request, - resourceGroupName, - managerName, - options - }, - sendTestEmailOperationSpec, - callback); + { deviceName, resourceGroupName, managerName, request, options }, + sendTestEmailOperationSpec + ); } /** - * Retrieves all the alerts in a manager. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagerNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByManagerNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByManagerNext + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param nextLink The nextLink from the previous successful call to the ListByManager method. + * @param options The options parameters. */ - listByManagerNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManagerNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManagerNext( + resourceGroupName: string, + managerName: string, + nextLink: string, + options?: AlertsListByManagerNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByManagerNextOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, nextLink, options }, + listByManagerNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByManagerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/alerts", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/alerts", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AlertList @@ -188,80 +199,64 @@ const listByManagerOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const clearOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/clearAlerts", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "request", - mapper: { - ...Mappers.ClearAlertRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const clearOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/clearAlerts", + httpMethod: "POST", responses: { 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const sendTestEmailOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/sendTestAlertEmail", + requestBody: Parameters.request, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "request", - mapper: { - ...Mappers.SendTestAlertEmailRequest, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const sendTestEmailOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/sendTestAlertEmail", + httpMethod: "POST", responses: { 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, + requestBody: Parameters.request1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listByManagerNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByManagerNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AlertList @@ -270,5 +265,14 @@ const listByManagerNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/availableProviderOperationsOperations.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/availableProviderOperationsOperations.ts index 1ed18e0f53a4..9912aee00c91 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/availableProviderOperationsOperations.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/availableProviderOperationsOperations.ts @@ -1,95 +1,112 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/availableProviderOperationsOperationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AvailableProviderOperationsOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { + AvailableProviderOperation, + AvailableProviderOperationsListNextOptionalParams, + AvailableProviderOperationsListOptionalParams, + AvailableProviderOperationsListResponse, + AvailableProviderOperationsListNextResponse +} from "../models"; -/** Class representing a AvailableProviderOperationsOperations. */ -export class AvailableProviderOperationsOperations { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing AvailableProviderOperationsOperations operations. */ +export class AvailableProviderOperationsOperationsImpl + implements AvailableProviderOperationsOperations { + private readonly client: StorSimpleManagementClient; /** - * Create a AvailableProviderOperationsOperations. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class AvailableProviderOperationsOperations class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } /** * List of AvailableProviderOperations - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: AvailableProviderOperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: AvailableProviderOperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: AvailableProviderOperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * List of AvailableProviderOperations - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: AvailableProviderOperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: AvailableProviderOperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.StorSimple/operations", httpMethod: "GET", - path: "providers/Microsoft.StorSimple/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AvailableProviderOperations @@ -98,19 +115,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AvailableProviderOperations @@ -119,5 +131,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/backupScheduleGroups.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/backupScheduleGroups.ts index 42f0f1d76f84..651314eba295 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/backupScheduleGroups.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/backupScheduleGroups.ts @@ -1,29 +1,40 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/backupScheduleGroupsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { BackupScheduleGroups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + BackupScheduleGroup, + BackupScheduleGroupsListByDeviceOptionalParams, + BackupScheduleGroupsListByDeviceResponse, + BackupScheduleGroupsGetOptionalParams, + BackupScheduleGroupsGetResponse, + BackupScheduleGroupsCreateOrUpdateOptionalParams, + BackupScheduleGroupsCreateOrUpdateResponse, + BackupScheduleGroupsDeleteOptionalParams +} from "../models"; -/** Class representing a BackupScheduleGroups. */ -export class BackupScheduleGroups { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing BackupScheduleGroups operations. */ +export class BackupScheduleGroupsImpl implements BackupScheduleGroups { + private readonly client: StorSimpleManagementClient; /** - * Create a BackupScheduleGroups. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class BackupScheduleGroups class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } @@ -32,90 +43,220 @@ export class BackupScheduleGroups { * @param deviceName The name of the device. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupScheduleGroupsListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupScheduleGroupsListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupScheduleGroupsListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves all the backup schedule groups in a device. * @param deviceName The name of the device. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupScheduleGroupsListByDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); + } + /** + * Returns the properties of the specified backup schedule group name. * @param deviceName The name of the device. + * @param scheduleGroupName The name of the schedule group. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + scheduleGroupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupScheduleGroupsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { deviceName, + scheduleGroupName, resourceGroupName, managerName, options }, - listByDeviceOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** - * Returns the properties of the specified backup schedule group name. - * @param deviceName The name of the device. - * @param scheduleGroupName The name of the schedule group. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The name of the device. - * @param scheduleGroupName The name of the schedule group. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** + * Creates or Updates the backup schedule Group. * @param deviceName The name of the device. * @param scheduleGroupName The name of the schedule group. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param scheduleGroup The schedule group to be created + * @param options The options parameters. */ - get(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + deviceName: string, + scheduleGroupName: string, + resourceGroupName: string, + managerName: string, + scheduleGroup: BackupScheduleGroup, + options?: BackupScheduleGroupsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + BackupScheduleGroupsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, scheduleGroupName, resourceGroupName, managerName, + scheduleGroup, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or Updates the backup schedule Group. * @param deviceName The name of the device. * @param scheduleGroupName The name of the schedule group. - * @param scheduleGroup The schedule group to be created * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param scheduleGroup The schedule group to be created + * @param options The options parameters. */ - createOrUpdate(deviceName: string, scheduleGroupName: string, scheduleGroup: Models.BackupScheduleGroup, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,scheduleGroupName,scheduleGroup,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + deviceName: string, + scheduleGroupName: string, + resourceGroupName: string, + managerName: string, + scheduleGroup: BackupScheduleGroup, + options?: BackupScheduleGroupsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + scheduleGroupName, + resourceGroupName, + managerName, + scheduleGroup, + options + ); + return poller.pollUntilDone(); } /** @@ -124,36 +265,69 @@ export class BackupScheduleGroups { * @param scheduleGroupName The name of the schedule group. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,scheduleGroupName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + deviceName: string, + scheduleGroupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupScheduleGroupsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Creates or Updates the backup schedule Group. - * @param deviceName The name of the device. - * @param scheduleGroupName The name of the schedule group. - * @param scheduleGroup The schedule group to be created - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(deviceName: string, scheduleGroupName: string, scheduleGroup: Models.BackupScheduleGroup, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + const lro = new LroImpl( + sendOperation, { deviceName, scheduleGroupName, - scheduleGroup, resourceGroupName, managerName, options }, - beginCreateOrUpdateOperationSpec, - options); + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -162,40 +336,32 @@ export class BackupScheduleGroups { * @param scheduleGroupName The name of the schedule group. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - scheduleGroupName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + scheduleGroupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupScheduleGroupsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + scheduleGroupName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.BackupScheduleGroupList @@ -204,25 +370,21 @@ const listByDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.scheduleGroupName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BackupScheduleGroup @@ -231,66 +393,75 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.scheduleGroupName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.scheduleGroupName ], - requestBody: { - parameterPath: "scheduleGroup", - mapper: { - ...Mappers.BackupScheduleGroup, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.BackupScheduleGroup }, - 202: {}, + 201: { + bodyMapper: Mappers.BackupScheduleGroup + }, + 202: { + bodyMapper: Mappers.BackupScheduleGroup + }, + 204: { + bodyMapper: Mappers.BackupScheduleGroup + }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}", + requestBody: Parameters.scheduleGroup, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.scheduleGroupName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.scheduleGroupName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}", + httpMethod: "DELETE", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName, + Parameters.scheduleGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/backups.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/backups.ts index 2f583e03045c..1d976b861726 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/backups.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/backups.ts @@ -1,29 +1,44 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/backupsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Backups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Backup, + BackupsListByManagerNextOptionalParams, + BackupsListByManagerOptionalParams, + BackupsListByDeviceNextOptionalParams, + BackupsListByDeviceOptionalParams, + BackupsListByManagerResponse, + BackupsListByDeviceResponse, + BackupsDeleteOptionalParams, + CloneRequest, + BackupsCloneOptionalParams, + BackupsListByManagerNextResponse, + BackupsListByDeviceNextResponse +} from "../models"; -/** Class representing a Backups. */ -export class Backups { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing Backups operations. */ +export class BackupsImpl implements Backups { + private readonly client: StorSimpleManagementClient; /** - * Create a Backups. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Backups class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } @@ -31,32 +46,71 @@ export class Backups { * Retrieves all the backups in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: Models.BackupsListByManagerOptionalParams): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, options: Models.BackupsListByManagerOptionalParams, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: Models.BackupsListByManagerOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByManager( + resourceGroupName: string, + managerName: string, + options?: BackupsListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: BackupsListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByManagerNext( resourceGroupName, managerName, + continuationToken, options - }, - listByManagerOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: BackupsListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** @@ -64,35 +118,115 @@ export class Backups { * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.BackupsListByDeviceOptionalParams): Promise; + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDeviceNext( + deviceName, + resourceGroupName, + managerName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** - * @param deviceName The device name. + * Retrieves all the backups in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: BackupsListByManagerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); + } + /** + * Retrieves all the backups in a device. Can be used to get the backups for failover also. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: Models.BackupsListByDeviceOptionalParams, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.BackupsListByDeviceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsListByDeviceOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - listByDeviceOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); } /** @@ -101,50 +235,165 @@ export class Backups { * @param backupName The backup name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,backupName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDelete( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, backupName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Clones the given backup element to a new disk or share with given details. + * Deletes the backup. * @param deviceName The device name. * @param backupName The backup name. - * @param elementName The backup element name. - * @param cloneRequest The clone request. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - clone(deviceName: string, backupName: string, elementName: string, cloneRequest: Models.CloneRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginClone(deviceName,backupName,elementName,cloneRequest,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDeleteAndWait( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + backupName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Deletes the backup. + * Clones the given backup element to a new disk or share with given details. * @param deviceName The device name. * @param backupName The backup name. + * @param elementName The backup element name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param cloneRequest The clone request. + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginClone( + deviceName: string, + backupName: string, + elementName: string, + resourceGroupName: string, + managerName: string, + cloneRequest: CloneRequest, + options?: BackupsCloneOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, backupName, + elementName, resourceGroupName, managerName, + cloneRequest, options }, - beginDeleteMethodOperationSpec, - options); + cloneOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -152,101 +401,79 @@ export class Backups { * @param deviceName The device name. * @param backupName The backup name. * @param elementName The backup element name. - * @param cloneRequest The clone request. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param cloneRequest The clone request. + * @param options The options parameters. */ - beginClone(deviceName: string, backupName: string, elementName: string, cloneRequest: Models.CloneRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - backupName, - elementName, - cloneRequest, - resourceGroupName, - managerName, - options - }, - beginCloneOperationSpec, - options); + async beginCloneAndWait( + deviceName: string, + backupName: string, + elementName: string, + resourceGroupName: string, + managerName: string, + cloneRequest: CloneRequest, + options?: BackupsCloneOptionalParams + ): Promise { + const poller = await this.beginClone( + deviceName, + backupName, + elementName, + resourceGroupName, + managerName, + cloneRequest, + options + ); + return poller.pollUntilDone(); } /** - * Retrieves all the backups in a manager. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagerNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByManagerNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByManagerNext + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param nextLink The nextLink from the previous successful call to the ListByManager method. + * @param options The options parameters. */ - listByManagerNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManagerNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManagerNext( + resourceGroupName: string, + managerName: string, + nextLink: string, + options?: BackupsListByManagerNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByManagerNextOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, nextLink, options }, + listByManagerNextOperationSpec + ); } /** - * Retrieves all the backups in a device. Can be used to get the backups for failover also. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDeviceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByDeviceNext + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param nextLink The nextLink from the previous successful call to the ListByDevice method. + * @param options The options parameters. */ - listByDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDeviceNext( + deviceName: string, + resourceGroupName: string, + managerName: string, + nextLink: string, + options?: BackupsListByDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, nextLink, options }, + listByDeviceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByManagerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/backups", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/backups", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.BackupList @@ -255,26 +482,20 @@ const listByManagerOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listByDeviceOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.forFailover, - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BackupList @@ -283,79 +504,77 @@ const listByDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}", + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.forFailover + ], urlParameters: [ - Parameters.deviceName, - Parameters.backupName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}", + httpMethod: "DELETE", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCloneOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/elements/{elementName}/clone", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.backupName, - Parameters.elementName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.backupName ], - requestBody: { - parameterPath: "cloneRequest", - mapper: { - ...Mappers.CloneRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const cloneOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/elements/{elementName}/clone", + httpMethod: "POST", responses: { 200: {}, + 201: {}, 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, + requestBody: Parameters.cloneRequest, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName, + Parameters.backupName, + Parameters.elementName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listByManagerNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByManagerNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BackupList @@ -364,19 +583,20 @@ const listByManagerNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BackupList @@ -385,5 +605,19 @@ const listByDeviceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.forFailover + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.nextLink, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/chapSettingsOperations.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/chapSettingsOperations.ts index 7e10fbc3fcd1..4e0b84cb03c9 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/chapSettingsOperations.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/chapSettingsOperations.ts @@ -1,29 +1,40 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/chapSettingsOperationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ChapSettingsOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ChapSettings, + ChapSettingsListByDeviceOptionalParams, + ChapSettingsListByDeviceResponse, + ChapSettingsGetOptionalParams, + ChapSettingsGetResponse, + ChapSettingsCreateOrUpdateOptionalParams, + ChapSettingsCreateOrUpdateResponse, + ChapSettingsDeleteOptionalParams +} from "../models"; -/** Class representing a ChapSettingsOperations. */ -export class ChapSettingsOperations { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing ChapSettingsOperations operations. */ +export class ChapSettingsOperationsImpl implements ChapSettingsOperations { + private readonly client: StorSimpleManagementClient; /** - * Create a ChapSettingsOperations. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ChapSettingsOperations class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } @@ -32,35 +43,86 @@ export class ChapSettingsOperations { * @param deviceName The name of the device. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The name of the device. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: ChapSettingsListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: ChapSettingsListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: ChapSettingsListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves all the chap settings in a device. * @param deviceName The name of the device. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: ChapSettingsListByDeviceOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - listByDeviceOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); } /** @@ -69,53 +131,126 @@ export class ChapSettingsOperations { * @param chapUserName The user name of chap to be fetched. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param chapUserName The user name of chap to be fetched. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + get( + deviceName: string, + chapUserName: string, + resourceGroupName: string, + managerName: string, + options?: ChapSettingsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, chapUserName, resourceGroupName, managerName, options }, + getOperationSpec + ); + } + /** + * Creates or updates the chap setting. * @param deviceName The device name. - * @param chapUserName The user name of chap to be fetched. + * @param chapUserName The chap user name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param chapSetting The chap setting to be added or updated. + * @param options The options parameters. */ - get(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + deviceName: string, + chapUserName: string, + resourceGroupName: string, + managerName: string, + chapSetting: ChapSettings, + options?: ChapSettingsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ChapSettingsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, chapUserName, resourceGroupName, managerName, + chapSetting, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or updates the chap setting. * @param deviceName The device name. * @param chapUserName The chap user name. - * @param chapSetting The chap setting to be added or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param chapSetting The chap setting to be added or updated. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, chapUserName: string, chapSetting: Models.ChapSettings, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,chapUserName,chapSetting,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + deviceName: string, + chapUserName: string, + resourceGroupName: string, + managerName: string, + chapSetting: ChapSettings, + options?: ChapSettingsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + chapUserName, + resourceGroupName, + managerName, + chapSetting, + options + ); + return poller.pollUntilDone(); } /** @@ -124,36 +259,63 @@ export class ChapSettingsOperations { * @param chapUserName The chap user name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,chapUserName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + deviceName: string, + chapUserName: string, + resourceGroupName: string, + managerName: string, + options?: ChapSettingsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Creates or updates the chap setting. - * @param deviceName The device name. - * @param chapUserName The chap user name. - * @param chapSetting The chap setting to be added or updated. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(deviceName: string, chapUserName: string, chapSetting: Models.ChapSettings, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - chapUserName, - chapSetting, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + const lro = new LroImpl( + sendOperation, + { deviceName, chapUserName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -162,40 +324,32 @@ export class ChapSettingsOperations { * @param chapUserName The chap user name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - chapUserName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + chapUserName: string, + resourceGroupName: string, + managerName: string, + options?: ChapSettingsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + chapUserName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ChapSettingsList @@ -204,25 +358,21 @@ const listByDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.chapUserName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ChapSettings @@ -231,66 +381,75 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.chapUserName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.chapUserName ], - requestBody: { - parameterPath: "chapSetting", - mapper: { - ...Mappers.ChapSettings, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ChapSettings }, - 202: {}, + 201: { + bodyMapper: Mappers.ChapSettings + }, + 202: { + bodyMapper: Mappers.ChapSettings + }, + 204: { + bodyMapper: Mappers.ChapSettings + }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}", + requestBody: Parameters.chapSetting, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.chapUserName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.chapUserName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}", + httpMethod: "DELETE", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName, + Parameters.chapUserName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/devices.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/devices.ts index 60ef58914998..1528ec4103c1 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/devices.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/devices.ts @@ -1,29 +1,68 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/devicesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Devices } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Device, + DevicesListByManagerOptionalParams, + DevicesListFailoverTargetOptionalParams, + Metrics, + DevicesListMetricsOptionalParams, + MetricDefinition, + DevicesListMetricDefinitionOptionalParams, + DevicesListByManagerResponse, + DevicesGetOptionalParams, + DevicesGetResponse, + DevicesDeleteOptionalParams, + DevicePatch, + DevicesPatchOptionalParams, + DevicesPatchResponse, + DevicesGetAlertSettingsOptionalParams, + DevicesGetAlertSettingsResponse, + AlertSettings, + DevicesCreateOrUpdateAlertSettingsOptionalParams, + DevicesCreateOrUpdateAlertSettingsResponse, + DevicesDeactivateOptionalParams, + DevicesDownloadUpdatesOptionalParams, + FailoverRequest, + DevicesFailoverOptionalParams, + DevicesListFailoverTargetResponse, + DevicesInstallUpdatesOptionalParams, + DevicesListMetricsResponse, + DevicesListMetricDefinitionResponse, + DevicesGetNetworkSettingsOptionalParams, + DevicesGetNetworkSettingsResponse, + DevicesScanForUpdatesOptionalParams, + SecuritySettings, + DevicesCreateOrUpdateSecuritySettingsOptionalParams, + DevicesGetTimeSettingsOptionalParams, + DevicesGetTimeSettingsResponse, + DevicesGetUpdateSummaryOptionalParams, + DevicesGetUpdateSummaryResponse +} from "../models"; -/** Class representing a Devices. */ -export class Devices { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing Devices operations. */ +export class DevicesImpl implements Devices { + private readonly client: StorSimpleManagementClient; /** - * Create a Devices. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Devices class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } @@ -31,649 +70,1234 @@ export class Devices { * Retrieves all the devices in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: Models.DevicesListByManagerOptionalParams): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, options: Models.DevicesListByManagerOptionalParams, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: Models.DevicesListByManagerOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options + public listByManager( + resourceGroupName: string, + managerName: string, + options?: DevicesListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listByManagerOperationSpec, - callback) as Promise; + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: DevicesListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: DevicesListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Returns the properties of the specified device name. - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.DevicesGetOptionalParams): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** + * Retrieves all the devices which can be used as failover targets for the given device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, resourceGroupName: string, managerName: string, options: Models.DevicesGetOptionalParams, callback: msRest.ServiceCallback): void; - get(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.DevicesGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options + public listFailoverTarget( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListFailoverTargetOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listFailoverTargetPagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - getOperationSpec, - callback) as Promise; + byPage: () => { + return this.listFailoverTargetPagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; } - /** - * Deletes the device. - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private async *listFailoverTargetPagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListFailoverTargetOptionalParams + ): AsyncIterableIterator { + let result = await this._listFailoverTarget( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; } - /** - * Patches the device. - * @param deviceName The device Name. - * @param devicePatch Patch representation of the device. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - patch(deviceName: string, devicePatch: Models.DevicePatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginPatch(deviceName,devicePatch,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + private async *listFailoverTargetPagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListFailoverTargetOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listFailoverTargetPagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Returns the alert settings of the specified device name. - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. + * Retrieves the device metrics. + * @param deviceName The name of the appliance. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options + public listMetrics( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricsPagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - getAlertSettingsOperationSpec, - callback) as Promise; + byPage: () => { + return this.listMetricsPagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; } - /** - * Creates or updates the alert settings - * @param deviceName The device name. - * @param alertSettings The alert settings. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdateAlertSettings(deviceName: string, alertSettings: Models.AlertSettings, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdateAlertSettings(deviceName,alertSettings,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + private async *listMetricsPagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricsOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetrics( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; } - /** - * Deactivates the device. - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - deactivate(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeactivate(deviceName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private async *listMetricsPagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricsPagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Downloads udpates on the device. - * @param deviceName The device name. + * Retrieves metric definition of all metrics aggregated at device. + * @param deviceName The name of the appliance. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - downloadUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDownloadUpdates(deviceName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + public listMetricDefinition( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricDefinitionPagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricDefinitionPagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; } - /** - * Fails over the device to another device. - * @param deviceName The device name. - * @param failoverRequest The failover request. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - failover(deviceName: string, failoverRequest: Models.FailoverRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginFailover(deviceName,failoverRequest,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private async *listMetricDefinitionPagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetricDefinition( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricDefinitionPagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricDefinitionPagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Retrieves all the devices which can be used as failover targets for the given device. - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listFailoverTarget(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.DevicesListFailoverTargetOptionalParams): Promise; - /** - * @param deviceName The device name. + * Retrieves all the devices in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listFailoverTarget(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: DevicesListByManagerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); + } + /** + * Returns the properties of the specified device name. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listFailoverTarget(deviceName: string, resourceGroupName: string, managerName: string, options: Models.DevicesListFailoverTargetOptionalParams, callback: msRest.ServiceCallback): void; - listFailoverTarget(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.DevicesListFailoverTargetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - listFailoverTargetOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + getOperationSpec + ); } /** - * Installs the updates on the device. + * Deletes the device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - installUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginInstallUpdates(deviceName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDelete( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Retrieves the device metrics. - * @param deviceName The name of the appliance. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listMetrics(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.DevicesListMetricsOptionalParams): Promise; - /** - * @param deviceName The name of the appliance. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listMetrics(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The name of the appliance. + * Deletes the device. + * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listMetrics(deviceName: string, resourceGroupName: string, managerName: string, options: Models.DevicesListMetricsOptionalParams, callback: msRest.ServiceCallback): void; - listMetrics(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.DevicesListMetricsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - listMetricsOperationSpec, - callback) as Promise; + async beginDeleteAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Retrieves metric definition of all metrics aggregated at device. - * @param deviceName The name of the appliance. + * Patches the device. + * @param deviceName The device Name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param devicePatch Patch representation of the device. + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + async beginPatch( + deviceName: string, + resourceGroupName: string, + managerName: string, + devicePatch: DevicePatch, + options?: DevicesPatchOptionalParams + ): Promise< + PollerLike, DevicesPatchResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, devicePatch, options }, + patchOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** - * @param deviceName The name of the appliance. + * Patches the device. + * @param deviceName The device Name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param devicePatch Patch representation of the device. + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginPatchAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + devicePatch: DevicePatch, + options?: DevicesPatchOptionalParams + ): Promise { + const poller = await this.beginPatch( + deviceName, + resourceGroupName, + managerName, + devicePatch, + options + ); + return poller.pollUntilDone(); + } + /** - * @param deviceName The name of the appliance. + * Returns the alert settings of the specified device name. + * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getAlertSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetAlertSettingsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - listMetricDefinitionOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + getAlertSettingsOperationSpec + ); } /** - * Returns the network settings of the specified device name. + * Creates or updates the alert settings * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param alertSettings The alert settings. + * @param options The options parameters. */ - getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + async beginCreateOrUpdateAlertSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + alertSettings: AlertSettings, + options?: DevicesCreateOrUpdateAlertSettingsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevicesCreateOrUpdateAlertSettingsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, alertSettings, options }, + createOrUpdateAlertSettingsOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Creates or updates the alert settings * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param alertSettings The alert settings. + * @param options The options parameters. */ - getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginCreateOrUpdateAlertSettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + alertSettings: AlertSettings, + options?: DevicesCreateOrUpdateAlertSettingsOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdateAlertSettings( + deviceName, + resourceGroupName, + managerName, + alertSettings, + options + ); + return poller.pollUntilDone(); + } + /** + * Deactivates the device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - getNetworkSettingsOperationSpec, - callback) as Promise; + async beginDeactivate( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeactivateOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, options }, + deactivateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Scans for updates on the device. + * Deactivates the device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - scanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginScanForUpdates(deviceName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDeactivateAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeactivateOptionalParams + ): Promise { + const poller = await this.beginDeactivate( + deviceName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Creates or updates the security settings. + * Downloads updates on the device. * @param deviceName The device name. - * @param securitySettings The security settings. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdateSecuritySettings(deviceName: string, securitySettings: Models.SecuritySettings, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdateSecuritySettings(deviceName,securitySettings,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDownloadUpdates( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDownloadUpdatesOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, options }, + downloadUpdatesOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Returns the time settings of the specified device name. + * Downloads updates on the device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + async beginDownloadUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDownloadUpdatesOptionalParams + ): Promise { + const poller = await this.beginDownloadUpdates( + deviceName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); + } + /** + * Fails over the device to another device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param failoverRequest The failover request. + * @param options The options parameters. */ - getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginFailover( + deviceName: string, + resourceGroupName: string, + managerName: string, + failoverRequest: FailoverRequest, + options?: DevicesFailoverOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, failoverRequest, options }, + failoverOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Fails over the device to another device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param failoverRequest The failover request. + * @param options The options parameters. */ - getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - getTimeSettingsOperationSpec, - callback) as Promise; + async beginFailoverAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + failoverRequest: FailoverRequest, + options?: DevicesFailoverOptionalParams + ): Promise { + const poller = await this.beginFailover( + deviceName, + resourceGroupName, + managerName, + failoverRequest, + options + ); + return poller.pollUntilDone(); } /** - * Returns the update summary of the specified device name. + * Retrieves all the devices which can be used as failover targets for the given device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + private _listFailoverTarget( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListFailoverTargetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listFailoverTargetOperationSpec + ); + } + /** + * Installs the updates on the device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginInstallUpdates( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, options }, + installUpdatesOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Installs the updates on the device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - getUpdateSummaryOperationSpec, - callback) as Promise; + async beginInstallUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise { + const poller = await this.beginInstallUpdates( + deviceName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Deletes the device. - * @param deviceName The device name. + * Retrieves the device metrics. + * @param deviceName The name of the appliance. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + private _listMetrics( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listMetricsOperationSpec + ); } /** - * Patches the device. - * @param deviceName The device Name. - * @param devicePatch Patch representation of the device. + * Retrieves metric definition of all metrics aggregated at device. + * @param deviceName The name of the appliance. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginPatch(deviceName: string, devicePatch: Models.DevicePatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - devicePatch, - resourceGroupName, - managerName, - options - }, - beginPatchOperationSpec, - options); + private _listMetricDefinition( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricDefinitionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listMetricDefinitionOperationSpec + ); } /** - * Creates or updates the alert settings + * Returns the network settings of the specified device name. * @param deviceName The device name. - * @param alertSettings The alert settings. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdateAlertSettings(deviceName: string, alertSettings: Models.AlertSettings, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - alertSettings, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateAlertSettingsOperationSpec, - options); + getNetworkSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetNetworkSettingsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + getNetworkSettingsOperationSpec + ); } /** - * Deactivates the device. + * Scans for updates on the device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeactivate(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - beginDeactivateOperationSpec, - options); + async beginScanForUpdates( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, options }, + scanForUpdatesOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Downloads udpates on the device. + * Scans for updates on the device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDownloadUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - beginDownloadUpdatesOperationSpec, - options); + async beginScanForUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise { + const poller = await this.beginScanForUpdates( + deviceName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Fails over the device to another device. + * Creates or updates the security settings. * @param deviceName The device name. - * @param failoverRequest The failover request. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param securitySettings The security settings. + * @param options The options parameters. */ - beginFailover(deviceName: string, failoverRequest: Models.FailoverRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - failoverRequest, - resourceGroupName, - managerName, - options - }, - beginFailoverOperationSpec, - options); + async beginCreateOrUpdateSecuritySettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + securitySettings: SecuritySettings, + options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, securitySettings, options }, + createOrUpdateSecuritySettingsOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Installs the updates on the device. + * Creates or updates the security settings. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param securitySettings The security settings. + * @param options The options parameters. */ - beginInstallUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - beginInstallUpdatesOperationSpec, - options); + async beginCreateOrUpdateSecuritySettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + securitySettings: SecuritySettings, + options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdateSecuritySettings( + deviceName, + resourceGroupName, + managerName, + securitySettings, + options + ); + return poller.pollUntilDone(); } /** - * Scans for updates on the device. + * Returns the time settings of the specified device name. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginScanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - beginScanForUpdatesOperationSpec, - options); + getTimeSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetTimeSettingsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + getTimeSettingsOperationSpec + ); } /** - * Creates or updates the security settings. + * Returns the update summary of the specified device name. * @param deviceName The device name. - * @param securitySettings The security settings. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdateSecuritySettings(deviceName: string, securitySettings: Models.SecuritySettings, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - securitySettings, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateSecuritySettingsOperationSpec, - options); + getUpdateSummary( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetUpdateSummaryOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + getUpdateSummaryOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByManagerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.expand - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.DeviceList @@ -682,25 +1306,20 @@ const listByManagerOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion, - Parameters.expand - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Device @@ -709,446 +1328,415 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getAlertSettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default", + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.AlertSettings - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listFailoverTargetOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/failoverTargets", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.expand - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const patchOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.DeviceList + bodyMapper: Mappers.Device + }, + 201: { + bodyMapper: Mappers.Device + }, + 202: { + bodyMapper: Mappers.Device + }, + 204: { + bodyMapper: Mappers.Device }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metrics", + requestBody: Parameters.devicePatch, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getAlertSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.MetricList + bodyMapper: Mappers.AlertSettings }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricDefinitionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metricsDefinitions", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateAlertSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.MetricDefinitionList + bodyMapper: Mappers.AlertSettings + }, + 201: { + bodyMapper: Mappers.AlertSettings + }, + 202: { + bodyMapper: Mappers.AlertSettings + }, + 204: { + bodyMapper: Mappers.AlertSettings }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getNetworkSettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/networkSettings/default", + requestBody: Parameters.alertSettings, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deactivateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/deactivate", + httpMethod: "POST", responses: { - 200: { - bodyMapper: Mappers.NetworkSettings - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getTimeSettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/timeSettings/default", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const downloadUpdatesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/download", + httpMethod: "POST", responses: { - 200: { - bodyMapper: Mappers.TimeSettings - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; - -const getUpdateSummaryOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/updateSummary/default", +const failoverOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/failover", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + requestBody: Parameters.failoverRequest, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listFailoverTargetOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/failoverTargets", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Updates + bodyMapper: Mappers.DeviceList }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const installUpdatesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/install", + httpMethod: "POST", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginPatchOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName + Parameters.managerName, + Parameters.deviceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "devicePatch", - mapper: { - ...Mappers.DevicePatch, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listMetricsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metrics", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Device + bodyMapper: Mappers.MetricList }, - 202: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCreateOrUpdateAlertSettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName + Parameters.managerName, + Parameters.deviceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "alertSettings", - mapper: { - ...Mappers.AlertSettings, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listMetricDefinitionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metricsDefinitions", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AlertSettings + bodyMapper: Mappers.MetricDefinitionList }, - 202: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeactivateOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/deactivate", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getNetworkSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/networkSettings/default", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.NetworkSettings + }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDownloadUpdatesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/download", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const scanForUpdatesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/scanForUpdates", + httpMethod: "POST", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginFailoverOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/failover", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.deviceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "failoverRequest", - mapper: { - ...Mappers.FailoverRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateSecuritySettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default/update", + httpMethod: "POST", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginInstallUpdatesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/install", + requestBody: Parameters.securitySettings, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getTimeSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/timeSettings/default", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.TimeSettings + }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginScanForUpdatesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/scanForUpdates", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getUpdateSummaryOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/updateSummary/default", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.Updates + }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCreateOrUpdateSecuritySettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default/update", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName + Parameters.managerName, + Parameters.deviceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "securitySettings", - mapper: { - ...Mappers.SecuritySettings, - required: true - } - }, - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorModel - } - }, + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/fileServers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/fileServers.ts index 49325933d14d..77337fe58e5c 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/fileServers.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/fileServers.ts @@ -1,29 +1,49 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/fileServersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { FileServers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + FileServer, + FileServersListByDeviceOptionalParams, + Metrics, + FileServersListMetricsOptionalParams, + MetricDefinition, + FileServersListMetricDefinitionOptionalParams, + FileServersListByManagerOptionalParams, + FileServersListByDeviceResponse, + FileServersGetOptionalParams, + FileServersGetResponse, + FileServersCreateOrUpdateOptionalParams, + FileServersCreateOrUpdateResponse, + FileServersDeleteOptionalParams, + FileServersBackupNowOptionalParams, + FileServersListMetricsResponse, + FileServersListMetricDefinitionResponse, + FileServersListByManagerResponse +} from "../models"; -/** Class representing a FileServers. */ -export class FileServers { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing FileServers operations. */ +export class FileServersImpl implements FileServers { + private readonly client: StorSimpleManagementClient; /** - * Create a FileServers. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class FileServers class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } @@ -32,90 +52,426 @@ export class FileServers { * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** - * @param deviceName The device name. + * Gets the file server metrics. + * @param deviceName The name of the device. + * @param fileServerName The name of the file server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listMetrics( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListMetricsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricsPagingAll( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricsPagingPage( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricsPagingPage( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListMetricsOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetrics( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricsPagingAll( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricsPagingPage( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** - * @param deviceName The device name. + * Retrieves metric definitions of all metrics aggregated at the file server. + * @param deviceName The name of the device. + * @param fileServerName The name of the file server. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options + public listMetricDefinition( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricDefinitionPagingAll( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listByDeviceOperationSpec, - callback) as Promise; + byPage: () => { + return this.listMetricDefinitionPagingPage( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricDefinitionPagingPage( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetricDefinition( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricDefinitionPagingAll( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricDefinitionPagingPage( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Returns the properties of the specified file server name. + * Retrieves all the file servers in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + public listByManager( + resourceGroupName: string, + managerName: string, + options?: FileServersListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: FileServersListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: FileServersListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + + /** + * Retrieves all the file servers in a device. * @param deviceName The device name. - * @param fileServerName The file server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListByDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); + } + /** + * Returns the properties of the specified file server name. * @param deviceName The device name. * @param fileServerName The file server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + get( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, fileServerName, resourceGroupName, managerName, options }, + getOperationSpec + ); + } + /** + * Creates or updates the file server. * @param deviceName The device name. * @param fileServerName The file server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param fileServer The file server. + * @param options The options parameters. */ - get(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + fileServer: FileServer, + options?: FileServersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FileServersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, fileServerName, resourceGroupName, managerName, + fileServer, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or updates the file server. * @param deviceName The device name. * @param fileServerName The file server name. - * @param fileServer The file server. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param fileServer The file server. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, fileServerName: string, fileServer: Models.FileServer, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,fileServerName,fileServer,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + fileServer: FileServer, + options?: FileServersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + fileServerName, + resourceGroupName, + managerName, + fileServer, + options + ); + return poller.pollUntilDone(); } /** @@ -124,66 +480,199 @@ export class FileServers { * @param fileServerName The file server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,fileServerName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDelete( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, fileServerName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Backup the file server now. + * Deletes the file server. * @param deviceName The device name. * @param fileServerName The file server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - backupNow(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginBackupNow(deviceName,fileServerName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDeleteAndWait( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Gets the file server metrics. - * @param deviceName The name of the device. - * @param fileServerName The name of the file server name. + * Backup the file server now. + * @param deviceName The device name. + * @param fileServerName The file server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listMetrics(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: Models.FileServersListMetricsOptionalParams): Promise; + async beginBackupNow( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersBackupNowOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, fileServerName, resourceGroupName, managerName, options }, + backupNowOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** - * @param deviceName The name of the device. - * @param fileServerName The name of the file server name. + * Backup the file server now. + * @param deviceName The device name. + * @param fileServerName The file server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listMetrics(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginBackupNowAndWait( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersBackupNowOptionalParams + ): Promise { + const poller = await this.beginBackupNow( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets the file server metrics. * @param deviceName The name of the device. * @param fileServerName The name of the file server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listMetrics(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: Models.FileServersListMetricsOptionalParams, callback: msRest.ServiceCallback): void; - listMetrics(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: Models.FileServersListMetricsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listMetrics( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListMetricsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - fileServerName, - resourceGroupName, - managerName, - options - }, - listMetricsOperationSpec, - callback) as Promise; + { deviceName, fileServerName, resourceGroupName, managerName, options }, + listMetricsOperationSpec + ); } /** @@ -192,158 +681,45 @@ export class FileServers { * @param fileServerName The name of the file server. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The name of the device. - * @param fileServerName The name of the file server. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listMetricDefinition(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The name of the device. - * @param fileServerName The name of the file server. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listMetricDefinition(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetricDefinition(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listMetricDefinition( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListMetricDefinitionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - fileServerName, - resourceGroupName, - managerName, - options - }, - listMetricDefinitionOperationSpec, - callback) as Promise; + { deviceName, fileServerName, resourceGroupName, managerName, options }, + listMetricDefinitionOperationSpec + ); } /** * Retrieves all the file servers in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: FileServersListByManagerOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listByManagerOperationSpec, - callback) as Promise; - } - - /** - * Creates or updates the file server. - * @param deviceName The device name. - * @param fileServerName The file server name. - * @param fileServer The file server. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(deviceName: string, fileServerName: string, fileServer: Models.FileServer, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - fileServerName, - fileServer, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateOperationSpec, - options); - } - - /** - * Deletes the file server. - * @param deviceName The device name. - * @param fileServerName The file server name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteMethod(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - fileServerName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); - } - - /** - * Backup the file server now. - * @param deviceName The device name. - * @param fileServerName The file server name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginBackupNow(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - fileServerName, - resourceGroupName, - managerName, - options - }, - beginBackupNowOperationSpec, - options); + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.FileServerList @@ -352,25 +728,21 @@ const listByDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.FileServer @@ -379,172 +751,170 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/metrics", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.MetricList + bodyMapper: Mappers.FileServer + }, + 201: { + bodyMapper: Mappers.FileServer + }, + 202: { + bodyMapper: Mappers.FileServer + }, + 204: { + bodyMapper: Mappers.FileServer }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricDefinitionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/metricsDefinitions", + requestBody: Parameters.fileServer, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.MetricDefinitionList - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listByManagerOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/fileservers", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName ], + headerParameters: [Parameters.accept], + serializer +}; +const backupNowOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/backup", + httpMethod: "POST", responses: { - 200: { - bodyMapper: Mappers.FileServerList - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName ], - requestBody: { - parameterPath: "fileServer", - mapper: { - ...Mappers.FileServer, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listMetricsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/metrics", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FileServer + bodyMapper: Mappers.MetricList }, - 202: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName ], + headerParameters: [Parameters.accept], + serializer +}; +const listMetricDefinitionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/metricsDefinitions", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.MetricDefinitionList + }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginBackupNowOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/backup", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName ], + headerParameters: [Parameters.accept], + serializer +}; +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/fileservers", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.FileServerList + }, default: { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/fileShares.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/fileShares.ts index 706edc98ba95..31d20487b534 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/fileShares.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/fileShares.ts @@ -1,29 +1,48 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/fileSharesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { FileShares } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + FileShare, + FileSharesListByFileServerOptionalParams, + Metrics, + FileSharesListMetricsOptionalParams, + MetricDefinition, + FileSharesListMetricDefinitionOptionalParams, + FileSharesListByDeviceOptionalParams, + FileSharesListByFileServerResponse, + FileSharesGetOptionalParams, + FileSharesGetResponse, + FileSharesCreateOrUpdateOptionalParams, + FileSharesCreateOrUpdateResponse, + FileSharesDeleteOptionalParams, + FileSharesListMetricsResponse, + FileSharesListMetricDefinitionResponse, + FileSharesListByDeviceResponse +} from "../models"; -/** Class representing a FileShares. */ -export class FileShares { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing FileShares operations. */ +export class FileSharesImpl implements FileShares { + private readonly client: StorSimpleManagementClient; /** - * Create a FileShares. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class FileShares class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } @@ -33,71 +52,350 @@ export class FileShares { * @param fileServerName The file server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByFileServer(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + public listByFileServer( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListByFileServerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByFileServerPagingAll( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByFileServerPagingPage( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByFileServerPagingPage( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListByFileServerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByFileServer( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByFileServerPagingAll( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListByFileServerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByFileServerPagingPage( + deviceName, + fileServerName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Gets the file share metrics * @param deviceName The device name. * @param fileServerName The file server name. + * @param shareName The file share name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByFileServer(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listMetrics( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListMetricsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricsPagingAll( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricsPagingPage( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricsPagingPage( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListMetricsOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetrics( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricsPagingAll( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricsPagingPage( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves metric definitions of all metrics aggregated at the file share. * @param deviceName The device name. * @param fileServerName The file server name. + * @param shareName The file share name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByFileServer(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByFileServer(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - fileServerName, - resourceGroupName, - managerName, - options + public listMetricDefinition( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricDefinitionPagingAll( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); }, - listByFileServerOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricDefinitionPagingPage( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricDefinitionPagingPage( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetricDefinition( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricDefinitionPagingAll( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricDefinitionPagingPage( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Returns the properties of the specified file share name. + * Retrieves all the file shares in a device. * @param deviceName The device name. - * @param fileServerName The file server name. - * @param shareName The file share name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves all the file shares in a file server. * @param deviceName The device name. * @param fileServerName The file server name. - * @param shareName The file share name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _listByFileServer( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListByFileServerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, fileServerName, resourceGroupName, managerName, options }, + listByFileServerOperationSpec + ); + } + /** + * Returns the properties of the specified file share name. * @param deviceName The device name. * @param fileServerName The file server name. * @param shareName The file share name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { deviceName, @@ -107,8 +405,8 @@ export class FileShares { managerName, options }, - getOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** @@ -116,108 +414,172 @@ export class FileShares { * @param deviceName The device name. * @param fileServerName The file server name. * @param shareName The file share name. - * @param fileShare The file share. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(deviceName: string, fileServerName: string, shareName: string, fileShare: Models.FileShare, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,fileServerName,shareName,fileShare,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } - - /** - * Deletes the file share. - * @param deviceName The device name. - * @param fileServerName The file server name. - * @param shareName The file share Name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param fileShare The file share. + * @param options The options parameters. */ - deleteMethod(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,fileServerName,shareName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginCreateOrUpdate( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + fileShare: FileShare, + options?: FileSharesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FileSharesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Gets the file share metrics - * @param deviceName The device name. - * @param fileServerName The file server name. - * @param shareName The file share name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listMetrics(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: Models.FileSharesListMetricsOptionalParams): Promise; - /** - * @param deviceName The device name. - * @param fileServerName The file server name. - * @param shareName The file share name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listMetrics(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param fileServerName The file server name. - * @param shareName The file share name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listMetrics(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options: Models.FileSharesListMetricsOptionalParams, callback: msRest.ServiceCallback): void; - listMetrics(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: Models.FileSharesListMetricsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + const lro = new LroImpl( + sendOperation, { deviceName, fileServerName, shareName, resourceGroupName, managerName, + fileShare, options }, - listMetricsOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Retrieves metric definitions of all metrics aggregated at the file share. - * @param deviceName The device name. - * @param fileServerName The file server name. - * @param shareName The file share name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listMetricDefinition(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Creates or updates the file share. * @param deviceName The device name. * @param fileServerName The file server name. * @param shareName The file share name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param fileShare The file share. + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginCreateOrUpdateAndWait( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + fileShare: FileShare, + options?: FileSharesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + fileShare, + options + ); + return poller.pollUntilDone(); + } + /** + * Deletes the file share. * @param deviceName The device name. * @param fileServerName The file server name. - * @param shareName The file share name. + * @param shareName The file share Name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetricDefinition(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginDelete( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, fileServerName, @@ -226,115 +588,128 @@ export class FileShares { managerName, options }, - listMetricDefinitionOperationSpec, - callback) as Promise; + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Retrieves all the file shares in a device. - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Deletes the file share. * @param deviceName The device name. + * @param fileServerName The file server name. + * @param shareName The file share Name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginDeleteAndWait( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + fileServerName, + shareName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets the file share metrics * @param deviceName The device name. + * @param fileServerName The file server name. + * @param shareName The file share name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listMetrics( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListMetricsOptionalParams + ): Promise { return this.client.sendOperationRequest( { deviceName, + fileServerName, + shareName, resourceGroupName, managerName, options }, - listByDeviceOperationSpec, - callback) as Promise; + listMetricsOperationSpec + ); } /** - * Creates or updates the file share. + * Retrieves metric definitions of all metrics aggregated at the file share. * @param deviceName The device name. * @param fileServerName The file server name. * @param shareName The file share name. - * @param fileShare The file share. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, fileServerName: string, shareName: string, fileShare: Models.FileShare, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + private _listMetricDefinition( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListMetricDefinitionOptionalParams + ): Promise { + return this.client.sendOperationRequest( { deviceName, fileServerName, shareName, - fileShare, resourceGroupName, managerName, options }, - beginCreateOrUpdateOperationSpec, - options); + listMetricDefinitionOperationSpec + ); } /** - * Deletes the file share. + * Retrieves all the file shares in a device. * @param deviceName The device name. - * @param fileServerName The file server name. - * @param shareName The file share Name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - fileServerName, - shareName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListByDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByFileServerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByFileServerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares", - urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.FileShareList @@ -343,26 +718,22 @@ const listByFileServerOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, - Parameters.shareName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.FileShare @@ -371,151 +742,151 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}/metrics", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, - Parameters.shareName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName, + Parameters.shareName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.MetricList + bodyMapper: Mappers.FileShare + }, + 201: { + bodyMapper: Mappers.FileShare + }, + 202: { + bodyMapper: Mappers.FileShare + }, + 204: { + bodyMapper: Mappers.FileShare }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricDefinitionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}/metricsDefinitions", + requestBody: Parameters.fileShare, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, - Parameters.shareName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName, + Parameters.shareName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.MetricDefinitionList - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listByDeviceOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/shares", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName, + Parameters.shareName ], + headerParameters: [Parameters.accept], + serializer +}; +const listMetricsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}/metrics", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FileShareList + bodyMapper: Mappers.MetricList }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, - Parameters.shareName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName, + Parameters.shareName ], - requestBody: { - parameterPath: "fileShare", - mapper: { - ...Mappers.FileShare, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listMetricDefinitionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}/metricsDefinitions", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FileShare + bodyMapper: Mappers.MetricDefinitionList }, - 202: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.fileServerName, - Parameters.shareName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.fileServerName, + Parameters.shareName ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/shares", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.FileShareList + }, default: { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/index.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/index.ts index fa1844540d41..d7a167c55bfc 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/index.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./managers"; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/iscsiDisks.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/iscsiDisks.ts index 77baed1a242c..dea49468a633 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/iscsiDisks.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/iscsiDisks.ts @@ -1,139 +1,420 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/iscsiDisksMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { IscsiDisks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + IscsiDisk, + IscsiDisksListByDeviceOptionalParams, + IscsiDisksListByIscsiServerOptionalParams, + Metrics, + IscsiDisksListMetricsOptionalParams, + MetricDefinition, + IscsiDisksListMetricDefinitionOptionalParams, + IscsiDisksListByDeviceResponse, + IscsiDisksListByIscsiServerResponse, + IscsiDisksGetOptionalParams, + IscsiDisksGetResponse, + IscsiDisksCreateOrUpdateOptionalParams, + IscsiDisksCreateOrUpdateResponse, + IscsiDisksDeleteOptionalParams, + IscsiDisksListMetricsResponse, + IscsiDisksListMetricDefinitionResponse +} from "../models"; -/** Class representing a IscsiDisks. */ -export class IscsiDisks { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing IscsiDisks operations. */ +export class IscsiDisksImpl implements IscsiDisks { + private readonly client: StorSimpleManagementClient; /** - * Create a IscsiDisks. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class IscsiDisks class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } /** - * Retrieves all the iscsi disks in a device. + * Retrieves all the iSCSI disks in a device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); }, - listByDeviceOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Retrieves all the disks in a iscsi server. + * Retrieves all the disks in a iSCSI server. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByIscsiServer(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + public listByIscsiServer( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListByIscsiServerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByIscsiServerPagingAll( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByIscsiServerPagingPage( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByIscsiServerPagingPage( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListByIscsiServerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByIscsiServer( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByIscsiServerPagingAll( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListByIscsiServerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByIscsiServerPagingPage( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Gets the iSCSI disk metrics * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The iSCSI disk name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByIscsiServer(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listMetrics( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListMetricsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricsPagingAll( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricsPagingPage( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricsPagingPage( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListMetricsOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetrics( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricsPagingAll( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricsPagingPage( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves metric definitions for all metric aggregated at the iSCSI disk. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The iSCSI disk name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByIscsiServer(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByIscsiServer(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - iscsiServerName, - resourceGroupName, - managerName, - options + public listMetricDefinition( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricDefinitionPagingAll( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listByIscsiServerOperationSpec, - callback) as Promise; + byPage: () => { + return this.listMetricDefinitionPagingPage( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricDefinitionPagingPage( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetricDefinition( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricDefinitionPagingAll( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricDefinitionPagingPage( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Returns the properties of the specified iscsi disk name. + * Retrieves all the iSCSI disks in a device. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param diskName The disk name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListByDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); + } + /** + * Retrieves all the disks in a iSCSI server. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param diskName The disk name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _listByIscsiServer( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListByIscsiServerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, iscsiServerName, resourceGroupName, managerName, options }, + listByIscsiServerOperationSpec + ); + } + /** + * Returns the properties of the specified iSCSI disk name. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. + * @param iscsiServerName The iSCSI server name. * @param diskName The disk name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { deviceName, @@ -143,117 +424,181 @@ export class IscsiDisks { managerName, options }, - getOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** - * Creates or updates the iscsi disk. + * Creates or updates the iSCSI disk. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. + * @param iscsiServerName The iSCSI server name. * @param diskName The disk name. - * @param iscsiDisk The iscsi disk. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param iscsiDisk The iSCSI disk. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, iscsiServerName: string, diskName: string, iscsiDisk: Models.ISCSIDisk, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,iscsiServerName,diskName,iscsiDisk,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } + async beginCreateOrUpdate( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + iscsiDisk: IscsiDisk, + options?: IscsiDisksCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IscsiDisksCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Deletes the iscsi disk. - * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param diskName The disk name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,iscsiServerName,diskName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Gets the iscsi disk metrics - * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param diskName The iscsi disk name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listMetrics(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: Models.IscsiDisksListMetricsOptionalParams): Promise; - /** - * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param diskName The iscsi disk name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listMetrics(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param diskName The iscsi disk name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listMetrics(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options: Models.IscsiDisksListMetricsOptionalParams, callback: msRest.ServiceCallback): void; - listMetrics(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: Models.IscsiDisksListMetricsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + const lro = new LroImpl( + sendOperation, { deviceName, iscsiServerName, diskName, resourceGroupName, managerName, + iscsiDisk, options }, - listMetricsOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Retrieves metric definitions for all metric aggregated at the iscsi disk. - * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param diskName The iscsi disk name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listMetricDefinition(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Creates or updates the iSCSI disk. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param diskName The iscsi disk name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The disk name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param iscsiDisk The iSCSI disk. + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginCreateOrUpdateAndWait( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + iscsiDisk: IscsiDisk, + options?: IscsiDisksCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + iscsiDisk, + options + ); + return poller.pollUntilDone(); + } + /** + * Deletes the iSCSI disk. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param diskName The iscsi disk name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The disk name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetricDefinition(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginDelete( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, iscsiServerName, @@ -262,48 +607,90 @@ export class IscsiDisks { managerName, options }, - listMetricDefinitionOperationSpec, - callback) as Promise; + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Creates or updates the iscsi disk. + * Deletes the iSCSI disk. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. + * @param iscsiServerName The iSCSI server name. * @param diskName The disk name. - * @param iscsiDisk The iscsi disk. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, iscsiServerName: string, diskName: string, iscsiDisk: Models.ISCSIDisk, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginDeleteAndWait( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + iscsiServerName, + diskName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets the iSCSI disk metrics + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The iSCSI disk name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + private _listMetrics( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListMetricsOptionalParams + ): Promise { + return this.client.sendOperationRequest( { deviceName, iscsiServerName, diskName, - iscsiDisk, resourceGroupName, managerName, options }, - beginCreateOrUpdateOperationSpec, - options); + listMetricsOperationSpec + ); } /** - * Deletes the iscsi disk. + * Retrieves metric definitions for all metric aggregated at the iSCSI disk. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param diskName The disk name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The iSCSI disk name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + private _listMetricDefinition( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListMetricDefinitionOptionalParams + ): Promise { + return this.client.sendOperationRequest( { deviceName, iscsiServerName, @@ -312,210 +699,194 @@ export class IscsiDisks { managerName, options }, - beginDeleteMethodOperationSpec, - options); + listMetricDefinitionOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/disks", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/disks", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.ISCSIDiskList + bodyMapper: Mappers.IscsiDiskList }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listByIscsiServerOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const listByIscsiServerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ISCSIDiskList + bodyMapper: Mappers.IscsiDiskList }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, - Parameters.diskName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ISCSIDisk + bodyMapper: Mappers.IscsiDisk }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}/metrics", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, - Parameters.diskName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName, + Parameters.diskName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.MetricList + bodyMapper: Mappers.IscsiDisk + }, + 201: { + bodyMapper: Mappers.IscsiDisk + }, + 202: { + bodyMapper: Mappers.IscsiDisk + }, + 204: { + bodyMapper: Mappers.IscsiDisk }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricDefinitionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}/metricsDefinitions", + requestBody: Parameters.iscsiDisk, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, - Parameters.diskName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName, + Parameters.diskName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.MetricDefinitionList - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, - Parameters.diskName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName, + Parameters.diskName ], - requestBody: { - parameterPath: "iscsiDisk", - mapper: { - ...Mappers.ISCSIDisk, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listMetricsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}/metrics", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ISCSIDisk + bodyMapper: Mappers.MetricList }, - 202: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, - Parameters.diskName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName, + Parameters.diskName ], + headerParameters: [Parameters.accept], + serializer +}; +const listMetricDefinitionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}/metricsDefinitions", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.MetricDefinitionList + }, default: { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName, + Parameters.diskName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/iscsiServers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/iscsiServers.ts index d273cc78086c..cfccbb5188e9 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/iscsiServers.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/iscsiServers.ts @@ -1,550 +1,920 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/iscsiServersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { IscsiServers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + IscsiServer, + IscsiServersListByDeviceOptionalParams, + Metrics, + IscsiServersListMetricsOptionalParams, + MetricDefinition, + IscsiServersListMetricDefinitionOptionalParams, + IscsiServersListByManagerOptionalParams, + IscsiServersListByDeviceResponse, + IscsiServersGetOptionalParams, + IscsiServersGetResponse, + IscsiServersCreateOrUpdateOptionalParams, + IscsiServersCreateOrUpdateResponse, + IscsiServersDeleteOptionalParams, + IscsiServersBackupNowOptionalParams, + IscsiServersListMetricsResponse, + IscsiServersListMetricDefinitionResponse, + IscsiServersListByManagerResponse +} from "../models"; -/** Class representing a IscsiServers. */ -export class IscsiServers { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing IscsiServers operations. */ +export class IscsiServersImpl implements IscsiServers { + private readonly client: StorSimpleManagementClient; /** - * Create a IscsiServers. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class IscsiServers class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } /** - * Retrieves all the iscsi in a device. + * Retrieves all the iSCSI in a device. * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); }, - listByDeviceOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Returns the properties of the specified iscsi server name. - * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Gets the iSCSI server metrics * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listMetrics( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListMetricsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricsPagingAll( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricsPagingPage( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricsPagingPage( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListMetricsOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetrics( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricsPagingAll( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricsPagingPage( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves metric definitions for all metrics aggregated at iSCSI server. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - iscsiServerName, - resourceGroupName, - managerName, - options + public listMetricDefinition( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricDefinitionPagingAll( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - getOperationSpec, - callback) as Promise; + byPage: () => { + return this.listMetricDefinitionPagingPage( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricDefinitionPagingPage( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetricDefinition( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricDefinitionPagingAll( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricDefinitionPagingPage( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Creates or updates the iscsi server. - * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param iscsiServer The iscsi server. + * Retrieves all the iSCSI servers in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(deviceName: string, iscsiServerName: string, iscsiServer: Models.ISCSIServer, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,iscsiServerName,iscsiServer,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + public listByManager( + resourceGroupName: string, + managerName: string, + options?: IscsiServersListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: IscsiServersListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: IscsiServersListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Deletes the iscsi server. + * Retrieves all the iSCSI in a device. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,iscsiServerName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListByDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); } /** - * Backup the iscsi server now. + * Returns the properties of the specified iSCSI server name. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - backupNow(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginBackupNow(deviceName,iscsiServerName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + get( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, iscsiServerName, resourceGroupName, managerName, options }, + getOperationSpec + ); } /** - * Gets the iscsi server metrics - * @param deviceName The devie name. - * @param iscsiServerName The iscsi server name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listMetrics(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: Models.IscsiServersListMetricsOptionalParams): Promise; - /** - * @param deviceName The devie name. - * @param iscsiServerName The iscsi server name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listMetrics(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The devie name. - * @param iscsiServerName The iscsi server name. + * Creates or updates the iSCSI server. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param iscsiServer The iSCSI server. + * @param options The options parameters. */ - listMetrics(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: Models.IscsiServersListMetricsOptionalParams, callback: msRest.ServiceCallback): void; - listMetrics(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: Models.IscsiServersListMetricsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + iscsiServer: IscsiServer, + options?: IscsiServersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IscsiServersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, iscsiServerName, resourceGroupName, managerName, + iscsiServer, options }, - listMetricsOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Retrieves metric definitions for all metrics aggregated at iscsi server. - * @param deviceName The devie name. - * @param iscsiServerName The iscsi server name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listMetricDefinition(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The devie name. - * @param iscsiServerName The iscsi server name. + * Creates or updates the iSCSI server. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param iscsiServer The iSCSI server. + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginCreateOrUpdateAndWait( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + iscsiServer: IscsiServer, + options?: IscsiServersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + iscsiServer, + options + ); + return poller.pollUntilDone(); + } + /** - * @param deviceName The devie name. - * @param iscsiServerName The iscsi server name. + * Deletes the iSCSI server. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetricDefinition(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - iscsiServerName, - resourceGroupName, - managerName, - options - }, - listMetricDefinitionOperationSpec, - callback) as Promise; + async beginDelete( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, iscsiServerName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Retrieves all the iscsi servers in a manager. + * Deletes the iSCSI server. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + async beginDeleteAndWait( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); + } + /** + * Backup the iSCSI server now. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginBackupNow( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersBackupNowOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, iscsiServerName, resourceGroupName, managerName, options }, + backupNowOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Backup the iSCSI server now. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listByManagerOperationSpec, - callback) as Promise; + async beginBackupNowAndWait( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersBackupNowOptionalParams + ): Promise { + const poller = await this.beginBackupNow( + deviceName, + iscsiServerName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Creates or updates the iscsi server. + * Gets the iSCSI server metrics * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. - * @param iscsiServer The iscsi server. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, iscsiServerName: string, iscsiServer: Models.ISCSIServer, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - iscsiServerName, - iscsiServer, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + private _listMetrics( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListMetricsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, iscsiServerName, resourceGroupName, managerName, options }, + listMetricsOperationSpec + ); } /** - * Deletes the iscsi server. + * Retrieves metric definitions for all metrics aggregated at iSCSI server. * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. + * @param iscsiServerName The iSCSI server name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - iscsiServerName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + private _listMetricDefinition( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListMetricDefinitionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, iscsiServerName, resourceGroupName, managerName, options }, + listMetricDefinitionOperationSpec + ); } /** - * Backup the iscsi server now. - * @param deviceName The device name. - * @param iscsiServerName The iscsi server name. + * Retrieves all the iSCSI servers in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginBackupNow(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - iscsiServerName, - resourceGroupName, - managerName, - options - }, - beginBackupNowOperationSpec, - options); + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: IscsiServersListByManagerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.ISCSIServerList + bodyMapper: Mappers.IscsiServerList }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ISCSIServer + bodyMapper: Mappers.IscsiServer }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/metrics", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.MetricList + bodyMapper: Mappers.IscsiServer + }, + 201: { + bodyMapper: Mappers.IscsiServer + }, + 202: { + bodyMapper: Mappers.IscsiServer + }, + 204: { + bodyMapper: Mappers.IscsiServer }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricDefinitionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/metricsDefinitions", + requestBody: Parameters.iscsiServer, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.MetricDefinitionList - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listByManagerOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/iscsiservers", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName ], + headerParameters: [Parameters.accept], + serializer +}; +const backupNowOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/backup", + httpMethod: "POST", responses: { - 200: { - bodyMapper: Mappers.ISCSIServerList - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName ], - requestBody: { - parameterPath: "iscsiServer", - mapper: { - ...Mappers.ISCSIServer, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listMetricsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/metrics", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ISCSIServer + bodyMapper: Mappers.MetricList }, - 202: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName ], + headerParameters: [Parameters.accept], + serializer +}; +const listMetricDefinitionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/metricsDefinitions", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.MetricDefinitionList + }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginBackupNowOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/backup", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.iscsiServerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.iscsiServerName ], + headerParameters: [Parameters.accept], + serializer +}; +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/iscsiservers", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.IscsiServerList + }, default: { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/jobs.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/jobs.ts index 42185a78a85a..85e83392ed80 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/jobs.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/jobs.ts @@ -1,28 +1,41 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/jobsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Jobs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { + Job, + JobsListByDeviceNextOptionalParams, + JobsListByDeviceOptionalParams, + JobsListByManagerNextOptionalParams, + JobsListByManagerOptionalParams, + JobsListByDeviceResponse, + JobsGetOptionalParams, + JobsGetResponse, + JobsListByManagerResponse, + JobsListByDeviceNextResponse, + JobsListByManagerNextResponse +} from "../models"; -/** Class representing a Jobs. */ -export class Jobs { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing Jobs operations. */ +export class JobsImpl implements Jobs { + private readonly client: StorSimpleManagementClient; /** - * Create a Jobs. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Jobs class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } @@ -31,184 +44,256 @@ export class Jobs { * @param deviceName The device name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.JobsListByDeviceOptionalParams): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: Models.JobsListByDeviceOptionalParams, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.JobsListByDeviceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: JobsListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: JobsListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDeviceNext( deviceName, resourceGroupName, managerName, + continuationToken, options - }, - listByDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: JobsListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Returns the properties of the specified job name. - * @param deviceName The device name. - * @param jobName The job name. + * Retrieves all the jobs in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + public listByManager( + resourceGroupName: string, + managerName: string, + options?: JobsListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: JobsListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByManagerNext( + resourceGroupName, + managerName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: JobsListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves all the jobs in a device. * @param deviceName The device name. - * @param jobName The job name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: JobsListByDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); + } + /** + * Returns the properties of the specified job name. * @param deviceName The device name. * @param jobName The job name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + jobName: string, + resourceGroupName: string, + managerName: string, + options?: JobsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - jobName, - resourceGroupName, - managerName, - options - }, - getOperationSpec, - callback) as Promise; + { deviceName, jobName, resourceGroupName, managerName, options }, + getOperationSpec + ); } /** * Retrieves all the jobs in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listByManager(resourceGroupName: string, managerName: string, options?: Models.JobsListByManagerOptionalParams): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options: Models.JobsListByManagerOptionalParams, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: Models.JobsListByManagerOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: JobsListByManagerOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listByManagerOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); } /** - * Retrieves all the jobs in a device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDeviceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByDeviceNext + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param nextLink The nextLink from the previous successful call to the ListByDevice method. + * @param options The options parameters. */ - listByDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDeviceNext( + deviceName: string, + resourceGroupName: string, + managerName: string, + nextLink: string, + options?: JobsListByDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, nextLink, options }, + listByDeviceNextOperationSpec + ); } /** - * Retrieves all the jobs in a manager. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagerNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByManagerNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByManagerNext + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param nextLink The nextLink from the previous successful call to the ListByManager method. + * @param options The options parameters. */ - listByManagerNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManagerNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManagerNext( + resourceGroupName: string, + managerName: string, + nextLink: string, + options?: JobsListByManagerNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByManagerNextOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, nextLink, options }, + listByManagerNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.JobList @@ -217,25 +302,21 @@ const listByDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.deviceName, - Parameters.jobName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Job @@ -244,24 +325,22 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listByManagerOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/jobs", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.jobName ], + headerParameters: [Parameters.accept], + serializer +}; +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/jobs", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.JobList @@ -270,19 +349,19 @@ const listByManagerOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.JobList @@ -291,19 +370,21 @@ const listByDeviceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.nextLink, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByManagerNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByManagerNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.JobList @@ -312,5 +393,14 @@ const listByManagerNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/managers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/managers.ts index dab50d47db43..3a440d1773c3 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/managers.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/managers.ts @@ -1,543 +1,540 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/managersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Managers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; - -/** Class representing a Managers. */ -export class Managers { - private readonly client: StorSimpleManagementClientContext; - - /** - * Create a Managers. - * @param {StorSimpleManagementClientContext} client Reference to the service client. - */ - constructor(client: StorSimpleManagementClientContext) { +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { + Manager, + ManagersListOptionalParams, + ManagersListByResourceGroupOptionalParams, + Metrics, + ManagersListMetricsOptionalParams, + MetricDefinition, + ManagersListMetricDefinitionOptionalParams, + ManagersListResponse, + ManagersListByResourceGroupResponse, + ManagersGetOptionalParams, + ManagersGetResponse, + ManagersCreateOrUpdateOptionalParams, + ManagersCreateOrUpdateResponse, + ManagersDeleteOptionalParams, + ManagerPatch, + ManagersUpdateOptionalParams, + ManagersUpdateResponse, + UploadCertificateRequest, + ManagersUploadRegistrationCertificateOptionalParams, + ManagersUploadRegistrationCertificateResponse, + ManagersGetEncryptionSettingsOptionalParams, + ManagersGetEncryptionSettingsResponse, + ManagersGetExtendedInfoOptionalParams, + ManagersGetExtendedInfoResponse, + ManagerExtendedInfo, + ManagersCreateExtendedInfoOptionalParams, + ManagersCreateExtendedInfoResponse, + ManagersDeleteExtendedInfoOptionalParams, + ManagersUpdateExtendedInfoOptionalParams, + ManagersUpdateExtendedInfoResponse, + ManagersGetEncryptionKeyOptionalParams, + ManagersGetEncryptionKeyResponse, + ManagersListMetricsResponse, + ManagersListMetricDefinitionResponse +} from "../models"; + +/// +/** Class containing Managers operations. */ +export class ManagersImpl implements Managers { + private readonly client: StorSimpleManagementClient; + + /** + * Initialize a new instance of the class Managers class. + * @param client Reference to the service client + */ + constructor(client: StorSimpleManagementClient) { this.client = client; } /** * Retrieves all the managers in a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + * @param options The options parameters. + */ + public list( + options?: ManagersListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ManagersListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: ManagersListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Retrieves all the managers in a resource group. * @param resourceGroupName The resource group name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - options + public listByResourceGroup( + resourceGroupName: string, + options?: ManagersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); }, - listByResourceGroupOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ManagersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ManagersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Returns the properties of the specified manager name. + * Gets the manager metrics * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + * @param options The options parameters. + */ + public listMetrics( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricsPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricsPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricsPagingPage( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricsOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetrics( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricsPagingAll( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricsPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves metric definition of all metrics aggregated at manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. + */ + public listMetricDefinition( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricDefinitionPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricDefinitionPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricDefinitionPagingPage( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetricDefinition( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricDefinitionPagingAll( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricDefinitionPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + + /** + * Retrieves all the managers in a subscription. + * @param options The options parameters. */ - get(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _list( + options?: ManagersListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** + * Retrieves all the managers in a resource group. * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: ManagersListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** - * Creates or updates the manager. - * @param manager The manager. + * Returns the properties of the specified manager name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(manager: Models.Manager, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + get( + resourceGroupName: string, + managerName: string, + options?: ManagersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, managerName, options }, + getOperationSpec + ); + } + /** - * @param manager The manager. + * Creates or updates the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback - */ - createOrUpdate(manager: Models.Manager, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** * @param manager The manager. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(manager: Models.Manager, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(manager: Models.Manager, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + managerName: string, + manager: Manager, + options?: ManagersCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - manager, - resourceGroupName, - managerName, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, manager, options }, + createOrUpdateOperationSpec + ); } /** * Deletes the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + managerName: string, + options?: ManagersDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, managerName, options }, + deleteOperationSpec + ); } /** * Updates the StorSimple Manager. - * @param parameters The manager update parameters. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - update(parameters: Models.ManagerPatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param parameters The manager update parameters. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback - */ - update(parameters: Models.ManagerPatch, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** * @param parameters The manager update parameters. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - update(parameters: Models.ManagerPatch, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(parameters: Models.ManagerPatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + update( + resourceGroupName: string, + managerName: string, + parameters: ManagerPatch, + options?: ManagersUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - parameters, - resourceGroupName, - managerName, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, parameters, options }, + updateOperationSpec + ); } /** * Upload Vault Cred Certificate. * Returns UploadCertificateResponse * @param certificateName Certificate Name - * @param uploadCertificateRequestrequest UploadCertificateRequest Request * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - uploadRegistrationCertificate(certificateName: string, uploadCertificateRequestrequest: Models.UploadCertificateRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param certificateName Certificate Name * @param uploadCertificateRequestrequest UploadCertificateRequest Request - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - uploadRegistrationCertificate(certificateName: string, uploadCertificateRequestrequest: Models.UploadCertificateRequest, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param certificateName Certificate Name - * @param uploadCertificateRequestrequest UploadCertificateRequest Request - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - uploadRegistrationCertificate(certificateName: string, uploadCertificateRequestrequest: Models.UploadCertificateRequest, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - uploadRegistrationCertificate(certificateName: string, uploadCertificateRequestrequest: Models.UploadCertificateRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + uploadRegistrationCertificate( + certificateName: string, + resourceGroupName: string, + managerName: string, + uploadCertificateRequestrequest: UploadCertificateRequest, + options?: ManagersUploadRegistrationCertificateOptionalParams + ): Promise { return this.client.sendOperationRequest( { certificateName, - uploadCertificateRequestrequest, resourceGroupName, managerName, + uploadCertificateRequestrequest, options }, - uploadRegistrationCertificateOperationSpec, - callback) as Promise; + uploadRegistrationCertificateOperationSpec + ); } /** * Returns the encryption settings of the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getEncryptionSettings(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - getEncryptionSettings(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - getEncryptionSettings(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getEncryptionSettings(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getEncryptionSettings( + resourceGroupName: string, + managerName: string, + options?: ManagersGetEncryptionSettingsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - getEncryptionSettingsOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + getEncryptionSettingsOperationSpec + ); } /** * Returns the extended information of the specified manager name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - getExtendedInfo(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - getExtendedInfo(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - getExtendedInfo(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getExtendedInfo(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getExtendedInfo( + resourceGroupName: string, + managerName: string, + options?: ManagersGetExtendedInfoOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - getExtendedInfoOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + getExtendedInfoOperationSpec + ); } /** * Creates the extended info of the manager. - * @param managerExtendedInfo The manager extended information. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - createExtendedInfo(managerExtendedInfo: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** * @param managerExtendedInfo The manager extended information. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - createExtendedInfo(managerExtendedInfo: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param managerExtendedInfo The manager extended information. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - createExtendedInfo(managerExtendedInfo: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createExtendedInfo(managerExtendedInfo: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + createExtendedInfo( + resourceGroupName: string, + managerName: string, + managerExtendedInfo: ManagerExtendedInfo, + options?: ManagersCreateExtendedInfoOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - managerExtendedInfo, - resourceGroupName, - managerName, - options - }, - createExtendedInfoOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, managerExtendedInfo, options }, + createExtendedInfoOperationSpec + ); } /** * Deletes the extended info of the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - deleteExtendedInfo(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - deleteExtendedInfo(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteExtendedInfo(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteExtendedInfo(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + deleteExtendedInfo( + resourceGroupName: string, + managerName: string, + options?: ManagersDeleteExtendedInfoOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - deleteExtendedInfoOperationSpec, - callback); + { resourceGroupName, managerName, options }, + deleteExtendedInfoOperationSpec + ); } /** * Updates the extended info of the manager. - * @param managerExtendedInfo The manager extended information. * @param resourceGroupName The resource group name * @param managerName The manager name * @param ifMatch Pass the ETag of ExtendedInfo fetched from GET call - * @param [options] The optional parameters - * @returns Promise - */ - updateExtendedInfo(managerExtendedInfo: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, options?: msRest.RequestOptionsBase): Promise; - /** * @param managerExtendedInfo The manager extended information. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param ifMatch Pass the ETag of ExtendedInfo fetched from GET call - * @param callback The callback - */ - updateExtendedInfo(managerExtendedInfo: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, callback: msRest.ServiceCallback): void; - /** - * @param managerExtendedInfo The manager extended information. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param ifMatch Pass the ETag of ExtendedInfo fetched from GET call - * @param options The optional parameters - * @param callback The callback - */ - updateExtendedInfo(managerExtendedInfo: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - updateExtendedInfo(managerExtendedInfo: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + updateExtendedInfo( + resourceGroupName: string, + managerName: string, + ifMatch: string, + managerExtendedInfo: ManagerExtendedInfo, + options?: ManagersUpdateExtendedInfoOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - managerExtendedInfo, - resourceGroupName, - managerName, - ifMatch, - options - }, - updateExtendedInfoOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, ifMatch, managerExtendedInfo, options }, + updateExtendedInfoOperationSpec + ); } /** * Returns the symmetric encryption key of the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getEncryptionKey(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - getEncryptionKey(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - getEncryptionKey(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getEncryptionKey(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getEncryptionKey( + resourceGroupName: string, + managerName: string, + options?: ManagersGetEncryptionKeyOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - getEncryptionKeyOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + getEncryptionKeyOperationSpec + ); } /** * Gets the manager metrics * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listMetrics(resourceGroupName: string, managerName: string, options?: Models.ManagersListMetricsOptionalParams): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listMetrics(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listMetrics(resourceGroupName: string, managerName: string, options: Models.ManagersListMetricsOptionalParams, callback: msRest.ServiceCallback): void; - listMetrics(resourceGroupName: string, managerName: string, options?: Models.ManagersListMetricsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listMetrics( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listMetricsOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listMetricsOperationSpec + ); } /** * Retrieves metric definition of all metrics aggregated at manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listMetricDefinition(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listMetricDefinition(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listMetricDefinition(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetricDefinition(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listMetricDefinition( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricDefinitionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listMetricDefinitionOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listMetricDefinitionOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.StorSimple/managers", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.StorSimple/managers", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ManagerList @@ -546,22 +543,15 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ManagerList @@ -570,23 +560,19 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Manager @@ -595,30 +581,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "manager", - mapper: { - ...Mappers.Manager, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Manager @@ -630,23 +606,22 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + requestBody: Parameters.manager, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -654,30 +629,20 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ManagerPatch, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.Manager @@ -686,31 +651,22 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const uploadRegistrationCertificateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/certificates/{certificateName}", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.certificateName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "uploadCertificateRequestrequest", - mapper: { - ...Mappers.UploadCertificateRequest, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const uploadRegistrationCertificateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/certificates/{certificateName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.UploadCertificateResponse @@ -719,23 +675,23 @@ const uploadRegistrationCertificateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getEncryptionSettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/encryptionSettings/default", + requestBody: Parameters.uploadCertificateRequestrequest, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.certificateName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getEncryptionSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/encryptionSettings/default", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EncryptionSettings @@ -744,23 +700,20 @@ const getEncryptionSettingsOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getExtendedInfoOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getExtendedInfoOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ManagerExtendedInfo @@ -769,30 +722,20 @@ const getExtendedInfoOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const createExtendedInfoOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "managerExtendedInfo", - mapper: { - ...Mappers.ManagerExtendedInfo, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createExtendedInfoOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ManagerExtendedInfo @@ -801,54 +744,42 @@ const createExtendedInfoOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const deleteExtendedInfoOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + requestBody: Parameters.managerExtendedInfo, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteExtendedInfoOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + httpMethod: "DELETE", responses: { 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const updateExtendedInfoOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.ifMatch, - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "managerExtendedInfo", - mapper: { - ...Mappers.ManagerExtendedInfo, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateExtendedInfoOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.ManagerExtendedInfo @@ -857,23 +788,26 @@ const updateExtendedInfoOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getEncryptionKeyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/getEncryptionKey", + requestBody: Parameters.managerExtendedInfo, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], headerParameters: [ - Parameters.acceptLanguage + Parameters.accept, + Parameters.contentType, + Parameters.ifMatch ], + mediaType: "json", + serializer +}; +const getEncryptionKeyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/getEncryptionKey", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.SymmetricEncryptedSecret @@ -882,24 +816,20 @@ const getEncryptionKeyOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metrics", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listMetricsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metrics", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.MetricList @@ -908,23 +838,20 @@ const listMetricsOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const listMetricDefinitionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metricsDefinitions", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listMetricDefinitionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metricsDefinitions", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.MetricDefinitionList @@ -933,5 +860,13 @@ const listMetricDefinitionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/storageAccountCredentials.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/storageAccountCredentials.ts index 6af5266ef3d2..d524681d0d32 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/storageAccountCredentials.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/storageAccountCredentials.ts @@ -1,29 +1,41 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/storageAccountCredentialsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { StorageAccountCredentials } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + StorageAccountCredential, + StorageAccountCredentialsListByManagerOptionalParams, + StorageAccountCredentialsListByManagerResponse, + StorageAccountCredentialsGetOptionalParams, + StorageAccountCredentialsGetResponse, + StorageAccountCredentialsCreateOrUpdateOptionalParams, + StorageAccountCredentialsCreateOrUpdateResponse, + StorageAccountCredentialsDeleteOptionalParams +} from "../models"; -/** Class representing a StorageAccountCredentials. */ -export class StorageAccountCredentials { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing StorageAccountCredentials operations. */ +export class StorageAccountCredentialsImpl + implements StorageAccountCredentials { + private readonly client: StorSimpleManagementClient; /** - * Create a StorageAccountCredentials. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class StorageAccountCredentials class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } @@ -31,32 +43,77 @@ export class StorageAccountCredentials { * Retrieves all the storage account credentials in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listByManager( + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves all the storage account credentials in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsListByManagerOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listByManagerOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); } /** @@ -64,49 +121,119 @@ export class StorageAccountCredentials { * @param credentialName The name of storage account credential to be fetched. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(credentialName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param credentialName The name of storage account credential to be fetched. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(credentialName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + get( + credentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { credentialName, resourceGroupName, managerName, options }, + getOperationSpec + ); + } + /** - * @param credentialName The name of storage account credential to be fetched. + * Creates or updates the storage account credential + * @param credentialName The credential name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param storageAccount The storage account credential to be added or updated. + * @param options The options parameters. */ - get(credentialName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(credentialName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + credentialName: string, + resourceGroupName: string, + managerName: string, + storageAccount: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageAccountCredentialsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { credentialName, resourceGroupName, managerName, + storageAccount, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or updates the storage account credential * @param credentialName The credential name. - * @param storageAccount The storage account credential to be added or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param storageAccount The storage account credential to be added or updated. + * @param options The options parameters. */ - createOrUpdate(credentialName: string, storageAccount: Models.StorageAccountCredential, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(credentialName,storageAccount,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + credentialName: string, + resourceGroupName: string, + managerName: string, + storageAccount: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + credentialName, + resourceGroupName, + managerName, + storageAccount, + options + ); + return poller.pollUntilDone(); } /** @@ -114,34 +241,62 @@ export class StorageAccountCredentials { * @param credentialName The name of the storage account credential. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(credentialName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(credentialName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + credentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Creates or updates the storage account credential - * @param credentialName The credential name. - * @param storageAccount The storage account credential to be added or updated. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(credentialName: string, storageAccount: Models.StorageAccountCredential, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - credentialName, - storageAccount, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + const lro = new LroImpl( + sendOperation, + { credentialName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -149,38 +304,30 @@ export class StorageAccountCredentials { * @param credentialName The name of the storage account credential. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(credentialName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - credentialName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + credentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + credentialName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByManagerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.StorageAccountCredentialList @@ -189,24 +336,20 @@ const listByManagerOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.credentialName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.StorageAccountCredential @@ -215,64 +358,72 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.credentialName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.credentialName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "storageAccount", - mapper: { - ...Mappers.StorageAccountCredential, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.StorageAccountCredential }, - 202: {}, + 201: { + bodyMapper: Mappers.StorageAccountCredential + }, + 202: { + bodyMapper: Mappers.StorageAccountCredential + }, + 204: { + bodyMapper: Mappers.StorageAccountCredential + }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}", + requestBody: Parameters.storageAccount, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.credentialName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.credentialName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}", + httpMethod: "DELETE", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.credentialName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/storageDomains.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/storageDomains.ts index b0d97f7e19e4..99eda1f04834 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/operations/storageDomains.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operations/storageDomains.ts @@ -1,29 +1,40 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/storageDomainsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { StorageDomains } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimpleManagementClientContext } from "../storSimpleManagementClientContext"; +import { StorSimpleManagementClient } from "../storSimpleManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + StorageDomain, + StorageDomainsListByManagerOptionalParams, + StorageDomainsListByManagerResponse, + StorageDomainsGetOptionalParams, + StorageDomainsGetResponse, + StorageDomainsCreateOrUpdateOptionalParams, + StorageDomainsCreateOrUpdateResponse, + StorageDomainsDeleteOptionalParams +} from "../models"; -/** Class representing a StorageDomains. */ -export class StorageDomains { - private readonly client: StorSimpleManagementClientContext; +/// +/** Class containing StorageDomains operations. */ +export class StorageDomainsImpl implements StorageDomains { + private readonly client: StorSimpleManagementClient; /** - * Create a StorageDomains. - * @param {StorSimpleManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class StorageDomains class. + * @param client Reference to the service client */ - constructor(client: StorSimpleManagementClientContext) { + constructor(client: StorSimpleManagementClient) { this.client = client; } @@ -31,32 +42,77 @@ export class StorageDomains { * Retrieves all the storage domains in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listByManager( + resourceGroupName: string, + managerName: string, + options?: StorageDomainsListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: StorageDomainsListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: StorageDomainsListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves all the storage domains in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: StorageDomainsListByManagerOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listByManagerOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); } /** @@ -64,49 +120,119 @@ export class StorageDomains { * @param storageDomainName The storage domain name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(storageDomainName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param storageDomainName The storage domain name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(storageDomainName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + get( + storageDomainName: string, + resourceGroupName: string, + managerName: string, + options?: StorageDomainsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { storageDomainName, resourceGroupName, managerName, options }, + getOperationSpec + ); + } + /** + * Creates or updates the storage domain. * @param storageDomainName The storage domain name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param storageDomain The storageDomain. + * @param options The options parameters. */ - get(storageDomainName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(storageDomainName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + storageDomainName: string, + resourceGroupName: string, + managerName: string, + storageDomain: StorageDomain, + options?: StorageDomainsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageDomainsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { storageDomainName, resourceGroupName, managerName, + storageDomain, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or updates the storage domain. * @param storageDomainName The storage domain name. - * @param storageDomain The storageDomain. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param storageDomain The storageDomain. + * @param options The options parameters. */ - createOrUpdate(storageDomainName: string, storageDomain: Models.StorageDomain, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(storageDomainName,storageDomain,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + storageDomainName: string, + resourceGroupName: string, + managerName: string, + storageDomain: StorageDomain, + options?: StorageDomainsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + storageDomainName, + resourceGroupName, + managerName, + storageDomain, + options + ); + return poller.pollUntilDone(); } /** @@ -114,34 +240,62 @@ export class StorageDomains { * @param storageDomainName The storage domain name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(storageDomainName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(storageDomainName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + storageDomainName: string, + resourceGroupName: string, + managerName: string, + options?: StorageDomainsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Creates or updates the storage domain. - * @param storageDomainName The storage domain name. - * @param storageDomain The storageDomain. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(storageDomainName: string, storageDomain: Models.StorageDomain, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - storageDomainName, - storageDomain, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + const lro = new LroImpl( + sendOperation, + { storageDomainName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -149,38 +303,30 @@ export class StorageDomains { * @param storageDomainName The storage domain name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(storageDomainName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - storageDomainName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + storageDomainName: string, + resourceGroupName: string, + managerName: string, + options?: StorageDomainsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + storageDomainName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByManagerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.StorageDomainList @@ -189,24 +335,20 @@ const listByManagerOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.storageDomainName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.StorageDomain @@ -215,64 +357,72 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.storageDomainName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.storageDomainName ], - requestBody: { - parameterPath: "storageDomain", - mapper: { - ...Mappers.StorageDomain, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.StorageDomain }, - 202: {}, + 201: { + bodyMapper: Mappers.StorageDomain + }, + 202: { + bodyMapper: Mappers.StorageDomain + }, + 204: { + bodyMapper: Mappers.StorageDomain + }, default: { bodyMapper: Mappers.ErrorModel } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}", + requestBody: Parameters.storageDomain, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.storageDomainName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.storageDomainName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}", + httpMethod: "DELETE", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.storageDomainName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/accessControlRecords.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/accessControlRecords.ts new file mode 100644 index 000000000000..b085c01b940e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/accessControlRecords.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + AccessControlRecord, + AccessControlRecordsListByManagerOptionalParams, + AccessControlRecordsGetOptionalParams, + AccessControlRecordsGetResponse, + AccessControlRecordsCreateOrUpdateOptionalParams, + AccessControlRecordsCreateOrUpdateResponse, + AccessControlRecordsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a AccessControlRecords. */ +export interface AccessControlRecords { + /** + * Retrieves all the access control records in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified access control record name. + * @param accessControlRecordName Name of access control record to be fetched. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsGetOptionalParams + ): Promise; + /** + * Creates or Updates an access control record. + * @param accessControlRecordName The name of the access control record. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param accessControlRecord The access control record to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdate( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + accessControlRecord: AccessControlRecord, + options?: AccessControlRecordsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccessControlRecordsCreateOrUpdateResponse + > + >; + /** + * Creates or Updates an access control record. + * @param accessControlRecordName The name of the access control record. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param accessControlRecord The access control record to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + accessControlRecord: AccessControlRecord, + options?: AccessControlRecordsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the access control record. + * @param accessControlRecordName The name of the access control record to delete. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the access control record. + * @param accessControlRecordName The name of the access control record to delete. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/alerts.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/alerts.ts new file mode 100644 index 000000000000..514783ca0620 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/alerts.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Alert, + AlertsListByManagerOptionalParams, + ClearAlertRequest, + AlertsClearOptionalParams, + SendTestAlertEmailRequest, + AlertsSendTestEmailOptionalParams +} from "../models"; + +/// +/** Interface representing a Alerts. */ +export interface Alerts { + /** + * Retrieves all the alerts in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: AlertsListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Clear the alerts. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param request The clear alert request. + * @param options The options parameters. + */ + clear( + resourceGroupName: string, + managerName: string, + request: ClearAlertRequest, + options?: AlertsClearOptionalParams + ): Promise; + /** + * Sends a test alert email. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param request The send test alert email request. + * @param options The options parameters. + */ + sendTestEmail( + deviceName: string, + resourceGroupName: string, + managerName: string, + request: SendTestAlertEmailRequest, + options?: AlertsSendTestEmailOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/availableProviderOperationsOperations.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/availableProviderOperationsOperations.ts new file mode 100644 index 000000000000..fe8f661f0e72 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/availableProviderOperationsOperations.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AvailableProviderOperation, + AvailableProviderOperationsListOptionalParams +} from "../models"; + +/// +/** Interface representing a AvailableProviderOperationsOperations. */ +export interface AvailableProviderOperationsOperations { + /** + * List of AvailableProviderOperations + * @param options The options parameters. + */ + list( + options?: AvailableProviderOperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/backupScheduleGroups.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/backupScheduleGroups.ts new file mode 100644 index 000000000000..ffc8a1486d24 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/backupScheduleGroups.ts @@ -0,0 +1,121 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + BackupScheduleGroup, + BackupScheduleGroupsListByDeviceOptionalParams, + BackupScheduleGroupsGetOptionalParams, + BackupScheduleGroupsGetResponse, + BackupScheduleGroupsCreateOrUpdateOptionalParams, + BackupScheduleGroupsCreateOrUpdateResponse, + BackupScheduleGroupsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a BackupScheduleGroups. */ +export interface BackupScheduleGroups { + /** + * Retrieves all the backup schedule groups in a device. + * @param deviceName The name of the device. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupScheduleGroupsListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified backup schedule group name. + * @param deviceName The name of the device. + * @param scheduleGroupName The name of the schedule group. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + scheduleGroupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupScheduleGroupsGetOptionalParams + ): Promise; + /** + * Creates or Updates the backup schedule Group. + * @param deviceName The name of the device. + * @param scheduleGroupName The name of the schedule group. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param scheduleGroup The schedule group to be created + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + scheduleGroupName: string, + resourceGroupName: string, + managerName: string, + scheduleGroup: BackupScheduleGroup, + options?: BackupScheduleGroupsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + BackupScheduleGroupsCreateOrUpdateResponse + > + >; + /** + * Creates or Updates the backup schedule Group. + * @param deviceName The name of the device. + * @param scheduleGroupName The name of the schedule group. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param scheduleGroup The schedule group to be created + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + scheduleGroupName: string, + resourceGroupName: string, + managerName: string, + scheduleGroup: BackupScheduleGroup, + options?: BackupScheduleGroupsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the backup schedule group. + * @param deviceName The name of the device. + * @param scheduleGroupName The name of the schedule group. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + scheduleGroupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupScheduleGroupsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the backup schedule group. + * @param deviceName The name of the device. + * @param scheduleGroupName The name of the schedule group. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + scheduleGroupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupScheduleGroupsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/backups.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/backups.ts new file mode 100644 index 000000000000..6d97db834a00 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/backups.ts @@ -0,0 +1,115 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Backup, + BackupsListByManagerOptionalParams, + BackupsListByDeviceOptionalParams, + BackupsDeleteOptionalParams, + CloneRequest, + BackupsCloneOptionalParams +} from "../models"; + +/// +/** Interface representing a Backups. */ +export interface Backups { + /** + * Retrieves all the backups in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: BackupsListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves all the backups in a device. Can be used to get the backups for failover also. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Deletes the backup. + * @param deviceName The device name. + * @param backupName The backup name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the backup. + * @param deviceName The device name. + * @param backupName The backup name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsDeleteOptionalParams + ): Promise; + /** + * Clones the given backup element to a new disk or share with given details. + * @param deviceName The device name. + * @param backupName The backup name. + * @param elementName The backup element name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param cloneRequest The clone request. + * @param options The options parameters. + */ + beginClone( + deviceName: string, + backupName: string, + elementName: string, + resourceGroupName: string, + managerName: string, + cloneRequest: CloneRequest, + options?: BackupsCloneOptionalParams + ): Promise, void>>; + /** + * Clones the given backup element to a new disk or share with given details. + * @param deviceName The device name. + * @param backupName The backup name. + * @param elementName The backup element name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param cloneRequest The clone request. + * @param options The options parameters. + */ + beginCloneAndWait( + deviceName: string, + backupName: string, + elementName: string, + resourceGroupName: string, + managerName: string, + cloneRequest: CloneRequest, + options?: BackupsCloneOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/chapSettingsOperations.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/chapSettingsOperations.ts new file mode 100644 index 000000000000..a5773e70be54 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/chapSettingsOperations.ts @@ -0,0 +1,121 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ChapSettings, + ChapSettingsListByDeviceOptionalParams, + ChapSettingsGetOptionalParams, + ChapSettingsGetResponse, + ChapSettingsCreateOrUpdateOptionalParams, + ChapSettingsCreateOrUpdateResponse, + ChapSettingsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a ChapSettingsOperations. */ +export interface ChapSettingsOperations { + /** + * Retrieves all the chap settings in a device. + * @param deviceName The name of the device. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: ChapSettingsListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified chap setting name. + * @param deviceName The device name. + * @param chapUserName The user name of chap to be fetched. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + chapUserName: string, + resourceGroupName: string, + managerName: string, + options?: ChapSettingsGetOptionalParams + ): Promise; + /** + * Creates or updates the chap setting. + * @param deviceName The device name. + * @param chapUserName The chap user name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param chapSetting The chap setting to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + chapUserName: string, + resourceGroupName: string, + managerName: string, + chapSetting: ChapSettings, + options?: ChapSettingsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ChapSettingsCreateOrUpdateResponse + > + >; + /** + * Creates or updates the chap setting. + * @param deviceName The device name. + * @param chapUserName The chap user name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param chapSetting The chap setting to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + chapUserName: string, + resourceGroupName: string, + managerName: string, + chapSetting: ChapSettings, + options?: ChapSettingsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the chap setting. + * @param deviceName The device name. + * @param chapUserName The chap user name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + chapUserName: string, + resourceGroupName: string, + managerName: string, + options?: ChapSettingsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the chap setting. + * @param deviceName The device name. + * @param chapUserName The chap user name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + chapUserName: string, + resourceGroupName: string, + managerName: string, + options?: ChapSettingsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/devices.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/devices.ts new file mode 100644 index 000000000000..ba3174c793c3 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/devices.ts @@ -0,0 +1,421 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Device, + DevicesListByManagerOptionalParams, + DevicesListFailoverTargetOptionalParams, + Metrics, + DevicesListMetricsOptionalParams, + MetricDefinition, + DevicesListMetricDefinitionOptionalParams, + DevicesGetOptionalParams, + DevicesGetResponse, + DevicesDeleteOptionalParams, + DevicePatch, + DevicesPatchOptionalParams, + DevicesPatchResponse, + DevicesGetAlertSettingsOptionalParams, + DevicesGetAlertSettingsResponse, + AlertSettings, + DevicesCreateOrUpdateAlertSettingsOptionalParams, + DevicesCreateOrUpdateAlertSettingsResponse, + DevicesDeactivateOptionalParams, + DevicesDownloadUpdatesOptionalParams, + FailoverRequest, + DevicesFailoverOptionalParams, + DevicesInstallUpdatesOptionalParams, + DevicesGetNetworkSettingsOptionalParams, + DevicesGetNetworkSettingsResponse, + DevicesScanForUpdatesOptionalParams, + SecuritySettings, + DevicesCreateOrUpdateSecuritySettingsOptionalParams, + DevicesGetTimeSettingsOptionalParams, + DevicesGetTimeSettingsResponse, + DevicesGetUpdateSummaryOptionalParams, + DevicesGetUpdateSummaryResponse +} from "../models"; + +/// +/** Interface representing a Devices. */ +export interface Devices { + /** + * Retrieves all the devices in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: DevicesListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves all the devices which can be used as failover targets for the given device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listFailoverTarget( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListFailoverTargetOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves the device metrics. + * @param deviceName The name of the appliance. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetrics( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves metric definition of all metrics aggregated at device. + * @param deviceName The name of the appliance. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetricDefinition( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified device name. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetOptionalParams + ): Promise; + /** + * Deletes the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeleteOptionalParams + ): Promise; + /** + * Patches the device. + * @param deviceName The device Name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param devicePatch Patch representation of the device. + * @param options The options parameters. + */ + beginPatch( + deviceName: string, + resourceGroupName: string, + managerName: string, + devicePatch: DevicePatch, + options?: DevicesPatchOptionalParams + ): Promise< + PollerLike, DevicesPatchResponse> + >; + /** + * Patches the device. + * @param deviceName The device Name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param devicePatch Patch representation of the device. + * @param options The options parameters. + */ + beginPatchAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + devicePatch: DevicePatch, + options?: DevicesPatchOptionalParams + ): Promise; + /** + * Returns the alert settings of the specified device name. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getAlertSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetAlertSettingsOptionalParams + ): Promise; + /** + * Creates or updates the alert settings + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param alertSettings The alert settings. + * @param options The options parameters. + */ + beginCreateOrUpdateAlertSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + alertSettings: AlertSettings, + options?: DevicesCreateOrUpdateAlertSettingsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevicesCreateOrUpdateAlertSettingsResponse + > + >; + /** + * Creates or updates the alert settings + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param alertSettings The alert settings. + * @param options The options parameters. + */ + beginCreateOrUpdateAlertSettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + alertSettings: AlertSettings, + options?: DevicesCreateOrUpdateAlertSettingsOptionalParams + ): Promise; + /** + * Deactivates the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeactivate( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeactivateOptionalParams + ): Promise, void>>; + /** + * Deactivates the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeactivateAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeactivateOptionalParams + ): Promise; + /** + * Downloads updates on the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDownloadUpdates( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDownloadUpdatesOptionalParams + ): Promise, void>>; + /** + * Downloads updates on the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDownloadUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDownloadUpdatesOptionalParams + ): Promise; + /** + * Fails over the device to another device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param failoverRequest The failover request. + * @param options The options parameters. + */ + beginFailover( + deviceName: string, + resourceGroupName: string, + managerName: string, + failoverRequest: FailoverRequest, + options?: DevicesFailoverOptionalParams + ): Promise, void>>; + /** + * Fails over the device to another device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param failoverRequest The failover request. + * @param options The options parameters. + */ + beginFailoverAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + failoverRequest: FailoverRequest, + options?: DevicesFailoverOptionalParams + ): Promise; + /** + * Installs the updates on the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginInstallUpdates( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise, void>>; + /** + * Installs the updates on the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginInstallUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise; + /** + * Returns the network settings of the specified device name. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getNetworkSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetNetworkSettingsOptionalParams + ): Promise; + /** + * Scans for updates on the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginScanForUpdates( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise, void>>; + /** + * Scans for updates on the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginScanForUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise; + /** + * Creates or updates the security settings. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param securitySettings The security settings. + * @param options The options parameters. + */ + beginCreateOrUpdateSecuritySettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + securitySettings: SecuritySettings, + options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams + ): Promise, void>>; + /** + * Creates or updates the security settings. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param securitySettings The security settings. + * @param options The options parameters. + */ + beginCreateOrUpdateSecuritySettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + securitySettings: SecuritySettings, + options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams + ): Promise; + /** + * Returns the time settings of the specified device name. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getTimeSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetTimeSettingsOptionalParams + ): Promise; + /** + * Returns the update summary of the specified device name. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getUpdateSummary( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetUpdateSummaryOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/fileServers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/fileServers.ts new file mode 100644 index 000000000000..c3dd8408d0c6 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/fileServers.ts @@ -0,0 +1,198 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + FileServer, + FileServersListByDeviceOptionalParams, + Metrics, + FileServersListMetricsOptionalParams, + MetricDefinition, + FileServersListMetricDefinitionOptionalParams, + FileServersListByManagerOptionalParams, + FileServersGetOptionalParams, + FileServersGetResponse, + FileServersCreateOrUpdateOptionalParams, + FileServersCreateOrUpdateResponse, + FileServersDeleteOptionalParams, + FileServersBackupNowOptionalParams +} from "../models"; + +/// +/** Interface representing a FileServers. */ +export interface FileServers { + /** + * Retrieves all the file servers in a device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the file server metrics. + * @param deviceName The name of the device. + * @param fileServerName The name of the file server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetrics( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListMetricsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves metric definitions of all metrics aggregated at the file server. + * @param deviceName The name of the device. + * @param fileServerName The name of the file server. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetricDefinition( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves all the file servers in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: FileServersListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified file server name. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersGetOptionalParams + ): Promise; + /** + * Creates or updates the file server. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param fileServer The file server. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + fileServer: FileServer, + options?: FileServersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FileServersCreateOrUpdateResponse + > + >; + /** + * Creates or updates the file server. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param fileServer The file server. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + fileServer: FileServer, + options?: FileServersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the file server. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the file server. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersDeleteOptionalParams + ): Promise; + /** + * Backup the file server now. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginBackupNow( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersBackupNowOptionalParams + ): Promise, void>>; + /** + * Backup the file server now. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginBackupNowAndWait( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileServersBackupNowOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/fileShares.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/fileShares.ts new file mode 100644 index 000000000000..cd44cb6c48af --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/fileShares.ts @@ -0,0 +1,185 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + FileShare, + FileSharesListByFileServerOptionalParams, + Metrics, + FileSharesListMetricsOptionalParams, + MetricDefinition, + FileSharesListMetricDefinitionOptionalParams, + FileSharesListByDeviceOptionalParams, + FileSharesGetOptionalParams, + FileSharesGetResponse, + FileSharesCreateOrUpdateOptionalParams, + FileSharesCreateOrUpdateResponse, + FileSharesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a FileShares. */ +export interface FileShares { + /** + * Retrieves all the file shares in a file server. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByFileServer( + deviceName: string, + fileServerName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListByFileServerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the file share metrics + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param shareName The file share name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetrics( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListMetricsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves metric definitions of all metrics aggregated at the file share. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param shareName The file share name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetricDefinition( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves all the file shares in a device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified file share name. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param shareName The file share name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesGetOptionalParams + ): Promise; + /** + * Creates or updates the file share. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param shareName The file share name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param fileShare The file share. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + fileShare: FileShare, + options?: FileSharesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FileSharesCreateOrUpdateResponse + > + >; + /** + * Creates or updates the file share. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param shareName The file share name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param fileShare The file share. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + fileShare: FileShare, + options?: FileSharesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the file share. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param shareName The file share Name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the file share. + * @param deviceName The device name. + * @param fileServerName The file server name. + * @param shareName The file share Name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + fileServerName: string, + shareName: string, + resourceGroupName: string, + managerName: string, + options?: FileSharesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/index.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..d7a167c55bfc --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/index.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./managers"; +export * from "./availableProviderOperationsOperations"; +export * from "./accessControlRecords"; +export * from "./alerts"; +export * from "./backups"; +export * from "./devices"; +export * from "./backupScheduleGroups"; +export * from "./chapSettingsOperations"; +export * from "./iscsiDisks"; +export * from "./fileServers"; +export * from "./fileShares"; +export * from "./iscsiServers"; +export * from "./jobs"; +export * from "./storageAccountCredentials"; +export * from "./storageDomains"; diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/iscsiDisks.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/iscsiDisks.ts new file mode 100644 index 000000000000..3f6cbfd4c9d6 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/iscsiDisks.ts @@ -0,0 +1,185 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + IscsiDisk, + IscsiDisksListByDeviceOptionalParams, + IscsiDisksListByIscsiServerOptionalParams, + Metrics, + IscsiDisksListMetricsOptionalParams, + MetricDefinition, + IscsiDisksListMetricDefinitionOptionalParams, + IscsiDisksGetOptionalParams, + IscsiDisksGetResponse, + IscsiDisksCreateOrUpdateOptionalParams, + IscsiDisksCreateOrUpdateResponse, + IscsiDisksDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a IscsiDisks. */ +export interface IscsiDisks { + /** + * Retrieves all the iSCSI disks in a device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves all the disks in a iSCSI server. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByIscsiServer( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListByIscsiServerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the iSCSI disk metrics + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The iSCSI disk name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetrics( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListMetricsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves metric definitions for all metric aggregated at the iSCSI disk. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The iSCSI disk name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetricDefinition( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified iSCSI disk name. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The disk name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksGetOptionalParams + ): Promise; + /** + * Creates or updates the iSCSI disk. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The disk name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param iscsiDisk The iSCSI disk. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + iscsiDisk: IscsiDisk, + options?: IscsiDisksCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IscsiDisksCreateOrUpdateResponse + > + >; + /** + * Creates or updates the iSCSI disk. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The disk name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param iscsiDisk The iSCSI disk. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + iscsiDisk: IscsiDisk, + options?: IscsiDisksCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the iSCSI disk. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The disk name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the iSCSI disk. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param diskName The disk name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + iscsiServerName: string, + diskName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiDisksDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/iscsiServers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/iscsiServers.ts new file mode 100644 index 000000000000..27ca11e02675 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/iscsiServers.ts @@ -0,0 +1,198 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + IscsiServer, + IscsiServersListByDeviceOptionalParams, + Metrics, + IscsiServersListMetricsOptionalParams, + MetricDefinition, + IscsiServersListMetricDefinitionOptionalParams, + IscsiServersListByManagerOptionalParams, + IscsiServersGetOptionalParams, + IscsiServersGetResponse, + IscsiServersCreateOrUpdateOptionalParams, + IscsiServersCreateOrUpdateResponse, + IscsiServersDeleteOptionalParams, + IscsiServersBackupNowOptionalParams +} from "../models"; + +/// +/** Interface representing a IscsiServers. */ +export interface IscsiServers { + /** + * Retrieves all the iSCSI in a device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the iSCSI server metrics + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetrics( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListMetricsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves metric definitions for all metrics aggregated at iSCSI server. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetricDefinition( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves all the iSCSI servers in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: IscsiServersListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified iSCSI server name. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersGetOptionalParams + ): Promise; + /** + * Creates or updates the iSCSI server. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param iscsiServer The iSCSI server. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + iscsiServer: IscsiServer, + options?: IscsiServersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IscsiServersCreateOrUpdateResponse + > + >; + /** + * Creates or updates the iSCSI server. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param iscsiServer The iSCSI server. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + iscsiServer: IscsiServer, + options?: IscsiServersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the iSCSI server. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the iSCSI server. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersDeleteOptionalParams + ): Promise; + /** + * Backup the iSCSI server now. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginBackupNow( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersBackupNowOptionalParams + ): Promise, void>>; + /** + * Backup the iSCSI server now. + * @param deviceName The device name. + * @param iscsiServerName The iSCSI server name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginBackupNowAndWait( + deviceName: string, + iscsiServerName: string, + resourceGroupName: string, + managerName: string, + options?: IscsiServersBackupNowOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/jobs.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/jobs.ts new file mode 100644 index 000000000000..dd0c668dcfe2 --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/jobs.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Job, + JobsListByDeviceOptionalParams, + JobsListByManagerOptionalParams, + JobsGetOptionalParams, + JobsGetResponse +} from "../models"; + +/// +/** Interface representing a Jobs. */ +export interface Jobs { + /** + * Retrieves all the jobs in a device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: JobsListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves all the jobs in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: JobsListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified job name. + * @param deviceName The device name. + * @param jobName The job name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + jobName: string, + resourceGroupName: string, + managerName: string, + options?: JobsGetOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/managers.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/managers.ts new file mode 100644 index 000000000000..1ffa843eedfa --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/managers.ts @@ -0,0 +1,220 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Manager, + ManagersListOptionalParams, + ManagersListByResourceGroupOptionalParams, + Metrics, + ManagersListMetricsOptionalParams, + MetricDefinition, + ManagersListMetricDefinitionOptionalParams, + ManagersGetOptionalParams, + ManagersGetResponse, + ManagersCreateOrUpdateOptionalParams, + ManagersCreateOrUpdateResponse, + ManagersDeleteOptionalParams, + ManagerPatch, + ManagersUpdateOptionalParams, + ManagersUpdateResponse, + UploadCertificateRequest, + ManagersUploadRegistrationCertificateOptionalParams, + ManagersUploadRegistrationCertificateResponse, + ManagersGetEncryptionSettingsOptionalParams, + ManagersGetEncryptionSettingsResponse, + ManagersGetExtendedInfoOptionalParams, + ManagersGetExtendedInfoResponse, + ManagerExtendedInfo, + ManagersCreateExtendedInfoOptionalParams, + ManagersCreateExtendedInfoResponse, + ManagersDeleteExtendedInfoOptionalParams, + ManagersUpdateExtendedInfoOptionalParams, + ManagersUpdateExtendedInfoResponse, + ManagersGetEncryptionKeyOptionalParams, + ManagersGetEncryptionKeyResponse +} from "../models"; + +/// +/** Interface representing a Managers. */ +export interface Managers { + /** + * Retrieves all the managers in a subscription. + * @param options The options parameters. + */ + list( + options?: ManagersListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves all the managers in a resource group. + * @param resourceGroupName The resource group name + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ManagersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the manager metrics + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetrics( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves metric definition of all metrics aggregated at manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetricDefinition( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified manager name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + managerName: string, + options?: ManagersGetOptionalParams + ): Promise; + /** + * Creates or updates the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param manager The manager. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + managerName: string, + manager: Manager, + options?: ManagersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + managerName: string, + options?: ManagersDeleteOptionalParams + ): Promise; + /** + * Updates the StorSimple Manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The manager update parameters. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + managerName: string, + parameters: ManagerPatch, + options?: ManagersUpdateOptionalParams + ): Promise; + /** + * Upload Vault Cred Certificate. + * Returns UploadCertificateResponse + * @param certificateName Certificate Name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param uploadCertificateRequestrequest UploadCertificateRequest Request + * @param options The options parameters. + */ + uploadRegistrationCertificate( + certificateName: string, + resourceGroupName: string, + managerName: string, + uploadCertificateRequestrequest: UploadCertificateRequest, + options?: ManagersUploadRegistrationCertificateOptionalParams + ): Promise; + /** + * Returns the encryption settings of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getEncryptionSettings( + resourceGroupName: string, + managerName: string, + options?: ManagersGetEncryptionSettingsOptionalParams + ): Promise; + /** + * Returns the extended information of the specified manager name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getExtendedInfo( + resourceGroupName: string, + managerName: string, + options?: ManagersGetExtendedInfoOptionalParams + ): Promise; + /** + * Creates the extended info of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param managerExtendedInfo The manager extended information. + * @param options The options parameters. + */ + createExtendedInfo( + resourceGroupName: string, + managerName: string, + managerExtendedInfo: ManagerExtendedInfo, + options?: ManagersCreateExtendedInfoOptionalParams + ): Promise; + /** + * Deletes the extended info of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + deleteExtendedInfo( + resourceGroupName: string, + managerName: string, + options?: ManagersDeleteExtendedInfoOptionalParams + ): Promise; + /** + * Updates the extended info of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param ifMatch Pass the ETag of ExtendedInfo fetched from GET call + * @param managerExtendedInfo The manager extended information. + * @param options The options parameters. + */ + updateExtendedInfo( + resourceGroupName: string, + managerName: string, + ifMatch: string, + managerExtendedInfo: ManagerExtendedInfo, + options?: ManagersUpdateExtendedInfoOptionalParams + ): Promise; + /** + * Returns the symmetric encryption key of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getEncryptionKey( + resourceGroupName: string, + managerName: string, + options?: ManagersGetEncryptionKeyOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/storageAccountCredentials.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/storageAccountCredentials.ts new file mode 100644 index 000000000000..718729b2f62e --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/storageAccountCredentials.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + StorageAccountCredential, + StorageAccountCredentialsListByManagerOptionalParams, + StorageAccountCredentialsGetOptionalParams, + StorageAccountCredentialsGetResponse, + StorageAccountCredentialsCreateOrUpdateOptionalParams, + StorageAccountCredentialsCreateOrUpdateResponse, + StorageAccountCredentialsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a StorageAccountCredentials. */ +export interface StorageAccountCredentials { + /** + * Retrieves all the storage account credentials in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified storage account credential name. + * @param credentialName The name of storage account credential to be fetched. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + credentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsGetOptionalParams + ): Promise; + /** + * Creates or updates the storage account credential + * @param credentialName The credential name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param storageAccount The storage account credential to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdate( + credentialName: string, + resourceGroupName: string, + managerName: string, + storageAccount: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageAccountCredentialsCreateOrUpdateResponse + > + >; + /** + * Creates or updates the storage account credential + * @param credentialName The credential name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param storageAccount The storage account credential to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + credentialName: string, + resourceGroupName: string, + managerName: string, + storageAccount: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the storage account credential + * @param credentialName The name of the storage account credential. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + credentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the storage account credential + * @param credentialName The name of the storage account credential. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + credentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/storageDomains.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/storageDomains.ts new file mode 100644 index 000000000000..b0e00e8e715b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/operationsInterfaces/storageDomains.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + StorageDomain, + StorageDomainsListByManagerOptionalParams, + StorageDomainsGetOptionalParams, + StorageDomainsGetResponse, + StorageDomainsCreateOrUpdateOptionalParams, + StorageDomainsCreateOrUpdateResponse, + StorageDomainsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a StorageDomains. */ +export interface StorageDomains { + /** + * Retrieves all the storage domains in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: StorageDomainsListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified storage domain name. + * @param storageDomainName The storage domain name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + storageDomainName: string, + resourceGroupName: string, + managerName: string, + options?: StorageDomainsGetOptionalParams + ): Promise; + /** + * Creates or updates the storage domain. + * @param storageDomainName The storage domain name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param storageDomain The storageDomain. + * @param options The options parameters. + */ + beginCreateOrUpdate( + storageDomainName: string, + resourceGroupName: string, + managerName: string, + storageDomain: StorageDomain, + options?: StorageDomainsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageDomainsCreateOrUpdateResponse + > + >; + /** + * Creates or updates the storage domain. + * @param storageDomainName The storage domain name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param storageDomain The storageDomain. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + storageDomainName: string, + resourceGroupName: string, + managerName: string, + storageDomain: StorageDomain, + options?: StorageDomainsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the storage domain. + * @param storageDomainName The storage domain name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + storageDomainName: string, + resourceGroupName: string, + managerName: string, + options?: StorageDomainsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the storage domain. + * @param storageDomainName The storage domain name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + storageDomainName: string, + resourceGroupName: string, + managerName: string, + options?: StorageDomainsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/storSimpleManagementClient.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/storSimpleManagementClient.ts index 142f5f4dd5e2..83e565f242a9 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/storSimpleManagementClient.ts +++ b/sdk/storsimple1200series/arm-storsimple1200series/src/storSimpleManagementClient.ts @@ -1,70 +1,137 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { StorSimpleManagementClientContext } from "./storSimpleManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + ManagersImpl, + AvailableProviderOperationsOperationsImpl, + AccessControlRecordsImpl, + AlertsImpl, + BackupsImpl, + DevicesImpl, + BackupScheduleGroupsImpl, + ChapSettingsOperationsImpl, + IscsiDisksImpl, + FileServersImpl, + FileSharesImpl, + IscsiServersImpl, + JobsImpl, + StorageAccountCredentialsImpl, + StorageDomainsImpl +} from "./operations"; +import { + Managers, + AvailableProviderOperationsOperations, + AccessControlRecords, + Alerts, + Backups, + Devices, + BackupScheduleGroups, + ChapSettingsOperations, + IscsiDisks, + FileServers, + FileShares, + IscsiServers, + Jobs, + StorageAccountCredentials, + StorageDomains +} from "./operationsInterfaces"; +import { StorSimpleManagementClientOptionalParams } from "./models"; - -class StorSimpleManagementClient extends StorSimpleManagementClientContext { - // Operation groups - managers: operations.Managers; - availableProviderOperations: operations.AvailableProviderOperationsOperations; - accessControlRecords: operations.AccessControlRecords; - alerts: operations.Alerts; - backups: operations.Backups; - devices: operations.Devices; - backupScheduleGroups: operations.BackupScheduleGroups; - chapSettings: operations.ChapSettingsOperations; - iscsiDisks: operations.IscsiDisks; - fileServers: operations.FileServers; - fileShares: operations.FileShares; - iscsiServers: operations.IscsiServers; - jobs: operations.Jobs; - storageAccountCredentials: operations.StorageAccountCredentials; - storageDomains: operations.StorageDomains; +export class StorSimpleManagementClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; /** * Initializes a new instance of the StorSimpleManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId The subscription id - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.StorSimpleManagementClientOptions) { - super(credentials, subscriptionId, options); - this.managers = new operations.Managers(this); - this.availableProviderOperations = new operations.AvailableProviderOperationsOperations(this); - this.accessControlRecords = new operations.AccessControlRecords(this); - this.alerts = new operations.Alerts(this); - this.backups = new operations.Backups(this); - this.devices = new operations.Devices(this); - this.backupScheduleGroups = new operations.BackupScheduleGroups(this); - this.chapSettings = new operations.ChapSettingsOperations(this); - this.iscsiDisks = new operations.IscsiDisks(this); - this.fileServers = new operations.FileServers(this); - this.fileShares = new operations.FileShares(this); - this.iscsiServers = new operations.IscsiServers(this); - this.jobs = new operations.Jobs(this); - this.storageAccountCredentials = new operations.StorageAccountCredentials(this); - this.storageDomains = new operations.StorageDomains(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: StorSimpleManagementClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: StorSimpleManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-storsimple1200series/2.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - StorSimpleManagementClient, - StorSimpleManagementClientContext, - Models as StorSimpleManagementModels, - Mappers as StorSimpleManagementMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2016-10-01"; + this.managers = new ManagersImpl(this); + this.availableProviderOperationsOperations = new AvailableProviderOperationsOperationsImpl( + this + ); + this.accessControlRecords = new AccessControlRecordsImpl(this); + this.alerts = new AlertsImpl(this); + this.backups = new BackupsImpl(this); + this.devices = new DevicesImpl(this); + this.backupScheduleGroups = new BackupScheduleGroupsImpl(this); + this.chapSettingsOperations = new ChapSettingsOperationsImpl(this); + this.iscsiDisks = new IscsiDisksImpl(this); + this.fileServers = new FileServersImpl(this); + this.fileShares = new FileSharesImpl(this); + this.iscsiServers = new IscsiServersImpl(this); + this.jobs = new JobsImpl(this); + this.storageAccountCredentials = new StorageAccountCredentialsImpl(this); + this.storageDomains = new StorageDomainsImpl(this); + } + + managers: Managers; + availableProviderOperationsOperations: AvailableProviderOperationsOperations; + accessControlRecords: AccessControlRecords; + alerts: Alerts; + backups: Backups; + devices: Devices; + backupScheduleGroups: BackupScheduleGroups; + chapSettingsOperations: ChapSettingsOperations; + iscsiDisks: IscsiDisks; + fileServers: FileServers; + fileShares: FileShares; + iscsiServers: IscsiServers; + jobs: Jobs; + storageAccountCredentials: StorageAccountCredentials; + storageDomains: StorageDomains; +} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/src/storSimpleManagementClientContext.ts b/sdk/storsimple1200series/arm-storsimple1200series/src/storSimpleManagementClientContext.ts deleted file mode 100644 index 4d4df0919526..000000000000 --- a/sdk/storsimple1200series/arm-storsimple1200series/src/storSimpleManagementClientContext.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-storsimple1200series"; -const packageVersion = "0.1.0"; - -export class StorSimpleManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - apiVersion?: string; - subscriptionId: string; - - /** - * Initializes a new instance of the StorSimpleManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The subscription id - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.StorSimpleManagementClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2016-10-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/storsimple1200series/arm-storsimple1200series/test/sampleTest.ts b/sdk/storsimple1200series/arm-storsimple1200series/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/storsimple1200series/arm-storsimple1200series/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/storsimple1200series/arm-storsimple1200series/tsconfig.json b/sdk/storsimple1200series/arm-storsimple1200series/tsconfig.json index 87bbf5b5fa49..89c9c406d349 100644 --- a/sdk/storsimple1200series/arm-storsimple1200series/tsconfig.json +++ b/sdk/storsimple1200series/arm-storsimple1200series/tsconfig.json @@ -3,17 +3,18 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", - "importHelpers": true + "outDir": "./dist-esm", + "importHelpers": true, + "paths": { "@azure/arm-storsimple1200series": ["./src/index"] } }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/storsimple1200series/ci.yml b/sdk/storsimple1200series/ci.yml new file mode 100644 index 000000000000..3a794204f0c2 --- /dev/null +++ b/sdk/storsimple1200series/ci.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/storsimple1200series/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/storsimple1200series/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: storsimple1200series + Artifacts: + - name: azure-arm-storsimple1200series + safeName: azurearmstorsimple1200series + \ No newline at end of file diff --git a/sdk/storsimple8000series/arm-storsimple8000series/CHANGELOG.md b/sdk/storsimple8000series/arm-storsimple8000series/CHANGELOG.md new file mode 100644 index 000000000000..f1e9aa59915d --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-01-21) + +The package of @azure/arm-storsimple8000series is using our next generation design principles since version 2.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/storsimple8000series/arm-storsimple8000series/LICENSE b/sdk/storsimple8000series/arm-storsimple8000series/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/storsimple8000series/arm-storsimple8000series/README.md b/sdk/storsimple8000series/arm-storsimple8000series/README.md index de3a0e2f9e44..22465b6702a2 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/README.md +++ b/sdk/storsimple8000series/arm-storsimple8000series/README.md @@ -1,99 +1,98 @@ -## Azure StorSimple8000SeriesManagementClient SDK for JavaScript +# Azure StorSimple8000SeriesManagement client library for JavaScript -This package contains an isomorphic SDK for StorSimple8000SeriesManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure StorSimple8000SeriesManagement client. + + + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple8000series/arm-storsimple8000series) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-storsimple8000series) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-storsimple8000series) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. -### How to Install +### Prerequisites -``` +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-storsimple8000series` package + +Install the Azure StorSimple8000SeriesManagement client library for JavaScript with `npm`: + +```bash npm install @azure/arm-storsimple8000series ``` -### How to use +### Create and authenticate a `StorSimple8000SeriesManagementClient` -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure StorSimple8000SeriesManagement API, you will need the `endpoint` of your Azure StorSimple8000SeriesManagement resource and a `credential`. The Azure StorSimple8000SeriesManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure StorSimple8000SeriesManagement resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -``` -npm install @azure/ms-rest-nodeauth -``` +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -##### Sample code - -```ts -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { StorSimple8000SeriesManagementClient, StorSimple8000SeriesManagementModels, StorSimple8000SeriesManagementMappers } from "@azure/arm-storsimple8000series"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new StorSimple8000SeriesManagementClient(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +```bash +npm install @azure/identity ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure StorSimple8000SeriesManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Install @azure/ms-rest-browserauth +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). +```javascript +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new StorSimple8000SeriesManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -npm install @azure/ms-rest-browserauth -``` -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-storsimple8000series sample - - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### StorSimple8000SeriesManagementClient + +`StorSimple8000SeriesManagementClient` is the primary interface for developers using the Azure StorSimple8000SeriesManagement client library. Explore the methods on this client object to understand the different features of the Azure StorSimple8000SeriesManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` -## Related projects +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +## Next steps +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorsimple8000series%2Farm-storsimple8000series%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/storsimple8000series/arm-storsimple8000series/_meta.json b/sdk/storsimple8000series/arm-storsimple8000series/_meta.json new file mode 100644 index 000000000000..3d478351a154 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "readme": "specification/storsimple8000series/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/storsimple8000series/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1 --generate-sample=true", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" +} \ No newline at end of file diff --git a/sdk/storsimple8000series/arm-storsimple8000series/api-extractor.json b/sdk/storsimple8000series/arm-storsimple8000series/api-extractor.json new file mode 100644 index 000000000000..275c49a46ff1 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-storsimple8000series.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/package.json b/sdk/storsimple8000series/arm-storsimple8000series/package.json index 192caba6625a..49358af949c7 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/package.json +++ b/sdk/storsimple8000series/arm-storsimple8000series/package.json @@ -1,56 +1,106 @@ { "name": "@azure/arm-storsimple8000series", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "StorSimple8000SeriesManagementClient Library with typescript type definitions for node.js and browser.", - "version": "1.1.0", + "description": "A generated SDK for StorSimple8000SeriesManagementClient.", + "version": "2.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", - "tslib": "^1.9.3" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-storsimple8000series.js", - "module": "./esm/storSimple8000SeriesManagementClient.js", - "types": "./esm/storSimple8000SeriesManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-storsimple8000series.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", - "uglify-js": "^3.4.9" + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/main/sdk/storsimple8000series/arm-storsimple8000series", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple8000series/arm-storsimple8000series", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" - }, - "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-storsimple8000series.js.map'\" -o ./dist/arm-storsimple8000series.min.js ./dist/arm-storsimple8000series.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, - "autoPublish": true + "//metadata": { + "constantPaths": [ + { + "path": "src/StorSimple8000SeriesManagementClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "//sampleConfiguration": { + "productName": "", + "productSlugs": ["azure"], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-storsimple8000series?view=azure-node-preview" + } } diff --git a/sdk/storsimple8000series/arm-storsimple8000series/recordings/node/my_test/recording_sample_test.js b/sdk/storsimple8000series/arm-storsimple8000series/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/review/arm-storsimple8000series.api.md b/sdk/storsimple8000series/arm-storsimple8000series/review/arm-storsimple8000series.api.md new file mode 100644 index 000000000000..c40e16145d2e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/review/arm-storsimple8000series.api.md @@ -0,0 +1,1924 @@ +## API Report File for "@azure/arm-storsimple8000series" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type AccessControlRecord = BaseModel & { + initiatorName: string; + readonly volumeCount?: number; +}; + +// @public +export interface AccessControlRecordList { + value: AccessControlRecord[]; +} + +// @public +export interface AccessControlRecords { + beginCreateOrUpdate(accessControlRecordName: string, resourceGroupName: string, managerName: string, parameters: AccessControlRecord, options?: AccessControlRecordsCreateOrUpdateOptionalParams): Promise, AccessControlRecordsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(accessControlRecordName: string, resourceGroupName: string, managerName: string, parameters: AccessControlRecord, options?: AccessControlRecordsCreateOrUpdateOptionalParams): Promise; + beginDelete(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: AccessControlRecordsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: AccessControlRecordsDeleteOptionalParams): Promise; + get(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: AccessControlRecordsGetOptionalParams): Promise; + listByManager(resourceGroupName: string, managerName: string, options?: AccessControlRecordsListByManagerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AccessControlRecordsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccessControlRecordsCreateOrUpdateResponse = AccessControlRecord; + +// @public +export interface AccessControlRecordsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface AccessControlRecordsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessControlRecordsGetResponse = AccessControlRecord; + +// @public +export interface AccessControlRecordsListByManagerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessControlRecordsListByManagerResponse = AccessControlRecordList; + +// @public +export interface AcsConfiguration { + namespace: string; + realm: string; + serviceUrl: string; +} + +// @public +export type Alert = BaseModel & { + title: string; + scope: AlertScope; + alertType: string; + appearedAtTime: Date; + appearedAtSourceTime: Date; + clearedAtTime?: Date; + clearedAtSourceTime?: Date; + source: AlertSource; + recommendation?: string; + resolutionReason?: string; + severity: AlertSeverity; + status: AlertStatus; + errorDetails?: AlertErrorDetails; + detailedInformation?: { + [propertyName: string]: string; + }; +}; + +// @public +export type AlertEmailNotificationStatus = "Enabled" | "Disabled"; + +// @public +export interface AlertErrorDetails { + errorCode?: string; + errorMessage?: string; + occurences?: number; +} + +// @public +export interface AlertFilter { + appearedOnTime?: Date; + severity?: AlertSeverity; + sourceName?: string; + sourceType?: AlertSourceType; + status?: AlertStatus; +} + +// @public +export interface AlertList { + nextLink?: string; + value: Alert[]; +} + +// @public +export interface Alerts { + clear(resourceGroupName: string, managerName: string, parameters: ClearAlertRequest, options?: AlertsClearOptionalParams): Promise; + listByManager(resourceGroupName: string, managerName: string, options?: AlertsListByManagerOptionalParams): PagedAsyncIterableIterator; + sendTestEmail(deviceName: string, resourceGroupName: string, managerName: string, parameters: SendTestAlertEmailRequest, options?: AlertsSendTestEmailOptionalParams): Promise; +} + +// @public +export interface AlertsClearOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertScope = "Resource" | "Device"; + +// @public +export type AlertSettings = BaseModel & { + emailNotification: AlertEmailNotificationStatus; + alertNotificationCulture?: string; + notificationToServiceOwners?: AlertEmailNotificationStatus; + additionalRecipientEmailList?: string[]; +}; + +// @public +export type AlertSeverity = "Informational" | "Warning" | "Critical"; + +// @public +export interface AlertsListByManagerNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type AlertsListByManagerNextResponse = AlertList; + +// @public +export interface AlertsListByManagerOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type AlertsListByManagerResponse = AlertList; + +// @public +export interface AlertSource { + alertSourceType?: AlertSourceType; + name?: string; + timeZone?: string; +} + +// @public +export type AlertSourceType = "Resource" | "Device"; + +// @public +export interface AlertsSendTestEmailOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertStatus = "Active" | "Cleared"; + +// @public +export interface AsymmetricEncryptedSecret { + encryptionAlgorithm: EncryptionAlgorithm; + encryptionCertThumbprint?: string; + value: string; +} + +// @public +export type AuthenticationType = "Invalid" | "None" | "Basic" | "NTLM"; + +// @public +export type AuthorizationEligibility = "InEligible" | "Eligible"; + +// @public +export type AuthorizationStatus = "Disabled" | "Enabled"; + +// @public +export interface AvailableProviderOperation { + display?: AvailableProviderOperationDisplay; + name?: string; + origin?: string; + properties?: Record; +} + +// @public +export interface AvailableProviderOperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface AvailableProviderOperationList { + nextLink?: string; + value: AvailableProviderOperation[]; +} + +// @public +export type Backup = BaseModel & { + createdOn: Date; + sizeInBytes: number; + backupType?: BackupType; + backupJobCreationType?: BackupJobCreationType; + backupPolicyId?: string; + ssmHostName?: string; + elements: BackupElement[]; +}; + +// @public +export interface BackupElement { + elementId: string; + elementName: string; + elementType: string; + sizeInBytes: number; + volumeContainerId: string; + volumeName: string; + volumeType?: VolumeType; +} + +// @public +export interface BackupFilter { + backupPolicyId?: string; + createdTime?: Date; + volumeId?: string; +} + +// @public +export type BackupJobCreationType = "Adhoc" | "BySchedule" | "BySSM"; + +// @public +export interface BackupList { + nextLink?: string; + value: Backup[]; +} + +// @public +export interface BackupPolicies { + beginBackupNow(deviceName: string, backupPolicyName: string, backupType: string, resourceGroupName: string, managerName: string, options?: BackupPoliciesBackupNowOptionalParams): Promise, void>>; + beginBackupNowAndWait(deviceName: string, backupPolicyName: string, backupType: string, resourceGroupName: string, managerName: string, options?: BackupPoliciesBackupNowOptionalParams): Promise; + beginCreateOrUpdate(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, parameters: BackupPolicy, options?: BackupPoliciesCreateOrUpdateOptionalParams): Promise, BackupPoliciesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, parameters: BackupPolicy, options?: BackupPoliciesCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options?: BackupPoliciesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options?: BackupPoliciesDeleteOptionalParams): Promise; + get(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options?: BackupPoliciesGetOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: BackupPoliciesListByDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BackupPoliciesBackupNowOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BackupPoliciesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupPoliciesCreateOrUpdateResponse = BackupPolicy; + +// @public +export interface BackupPoliciesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BackupPoliciesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupPoliciesGetResponse = BackupPolicy; + +// @public +export interface BackupPoliciesListByDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupPoliciesListByDeviceResponse = BackupPolicyList; + +// @public +export type BackupPolicy = BaseModel & { + volumeIds: string[]; + readonly nextBackupTime?: Date; + readonly lastBackupTime?: Date; + readonly schedulesCount?: number; + readonly scheduledBackupStatus?: ScheduledBackupStatus; + readonly backupPolicyCreationType?: BackupPolicyCreationType; + readonly ssmHostName?: string; +}; + +// @public +export type BackupPolicyCreationType = "BySaaS" | "BySSM"; + +// @public +export interface BackupPolicyList { + value: BackupPolicy[]; +} + +// @public +export interface Backups { + beginClone(deviceName: string, backupName: string, backupElementName: string, resourceGroupName: string, managerName: string, parameters: CloneRequest, options?: BackupsCloneOptionalParams): Promise, void>>; + beginCloneAndWait(deviceName: string, backupName: string, backupElementName: string, resourceGroupName: string, managerName: string, parameters: CloneRequest, options?: BackupsCloneOptionalParams): Promise; + beginDelete(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: BackupsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: BackupsDeleteOptionalParams): Promise; + beginRestore(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: BackupsRestoreOptionalParams): Promise, void>>; + beginRestoreAndWait(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: BackupsRestoreOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: BackupsListByDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type BackupSchedule = BaseModel & { + scheduleRecurrence: ScheduleRecurrence; + backupType: BackupType; + retentionCount: number; + startTime: Date; + scheduleStatus: ScheduleStatus; + readonly lastSuccessfulRun?: Date; +}; + +// @public +export interface BackupScheduleList { + value: BackupSchedule[]; +} + +// @public +export interface BackupSchedules { + beginCreateOrUpdate(deviceName: string, backupPolicyName: string, backupScheduleName: string, resourceGroupName: string, managerName: string, parameters: BackupSchedule, options?: BackupSchedulesCreateOrUpdateOptionalParams): Promise, BackupSchedulesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, backupPolicyName: string, backupScheduleName: string, resourceGroupName: string, managerName: string, parameters: BackupSchedule, options?: BackupSchedulesCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, backupPolicyName: string, backupScheduleName: string, resourceGroupName: string, managerName: string, options?: BackupSchedulesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, backupPolicyName: string, backupScheduleName: string, resourceGroupName: string, managerName: string, options?: BackupSchedulesDeleteOptionalParams): Promise; + get(deviceName: string, backupPolicyName: string, backupScheduleName: string, resourceGroupName: string, managerName: string, options?: BackupSchedulesGetOptionalParams): Promise; + listByBackupPolicy(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options?: BackupSchedulesListByBackupPolicyOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BackupSchedulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupSchedulesCreateOrUpdateResponse = BackupSchedule; + +// @public +export interface BackupSchedulesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BackupSchedulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupSchedulesGetResponse = BackupSchedule; + +// @public +export interface BackupSchedulesListByBackupPolicyOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupSchedulesListByBackupPolicyResponse = BackupScheduleList; + +// @public +export interface BackupsCloneOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BackupsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BackupsListByDeviceNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type BackupsListByDeviceNextResponse = BackupList; + +// @public +export interface BackupsListByDeviceOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type BackupsListByDeviceResponse = BackupList; + +// @public +export interface BackupsRestoreOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupStatus = "Enabled" | "Disabled"; + +// @public +export type BackupType = "LocalSnapshot" | "CloudSnapshot"; + +// @public +export interface BandwidthSchedule { + days: DayOfWeek[]; + rateInMbps: number; + start: Time; + stop: Time; +} + +// @public +export type BandwidthSetting = BaseModel & { + schedules: BandwidthSchedule[]; + readonly volumeCount?: number; +}; + +// @public +export interface BandwidthSettingList { + value: BandwidthSetting[]; +} + +// @public +export interface BandwidthSettings { + beginCreateOrUpdate(bandwidthSettingName: string, resourceGroupName: string, managerName: string, parameters: BandwidthSetting, options?: BandwidthSettingsCreateOrUpdateOptionalParams): Promise, BandwidthSettingsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(bandwidthSettingName: string, resourceGroupName: string, managerName: string, parameters: BandwidthSetting, options?: BandwidthSettingsCreateOrUpdateOptionalParams): Promise; + beginDelete(bandwidthSettingName: string, resourceGroupName: string, managerName: string, options?: BandwidthSettingsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(bandwidthSettingName: string, resourceGroupName: string, managerName: string, options?: BandwidthSettingsDeleteOptionalParams): Promise; + get(bandwidthSettingName: string, resourceGroupName: string, managerName: string, options?: BandwidthSettingsGetOptionalParams): Promise; + listByManager(resourceGroupName: string, managerName: string, options?: BandwidthSettingsListByManagerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BandwidthSettingsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BandwidthSettingsCreateOrUpdateResponse = BandwidthSetting; + +// @public +export interface BandwidthSettingsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BandwidthSettingsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BandwidthSettingsGetResponse = BandwidthSetting; + +// @public +export interface BandwidthSettingsListByManagerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BandwidthSettingsListByManagerResponse = BandwidthSettingList; + +// @public +export interface BaseModel { + readonly id?: string; + kind?: "Series8000"; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ChapSettings { + initiatorSecret?: AsymmetricEncryptedSecret; + initiatorUser?: string; + targetSecret?: AsymmetricEncryptedSecret; + targetUser?: string; +} + +// @public +export interface ClearAlertRequest { + alerts: string[]; + resolutionMessage?: string; +} + +// @public +export interface CloneRequest { + backupElement: BackupElement; + targetAccessControlRecordIds: string[]; + targetDeviceId: string; + targetVolumeName: string; +} + +// @public +export interface CloudAppliance { + isVnetDnsConfigured?: boolean; + isVnetExpressConfigured?: boolean; + modelNumber?: string; + name: string; + storageAccountName?: string; + storageAccountType?: string; + subnetName?: string; + vmImageName?: string; + vmType?: string; + vnetName?: string; + vnetRegion: string; +} + +// @public +export type CloudApplianceConfiguration = BaseModel & { + modelNumber: string; + cloudPlatform: string; + acsConfiguration: AcsConfiguration; + supportedStorageAccountTypes: string[]; + supportedRegions: string[]; + supportedVmTypes: string[]; + supportedVmImages: VmImage[]; +}; + +// @public +export interface CloudApplianceConfigurationList { + value: CloudApplianceConfiguration[]; +} + +// @public +export interface CloudAppliances { + beginProvision(resourceGroupName: string, managerName: string, parameters: CloudAppliance, options?: CloudAppliancesProvisionOptionalParams): Promise, void>>; + beginProvisionAndWait(resourceGroupName: string, managerName: string, parameters: CloudAppliance, options?: CloudAppliancesProvisionOptionalParams): Promise; + listSupportedConfigurations(resourceGroupName: string, managerName: string, options?: CloudAppliancesListSupportedConfigurationsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CloudApplianceSettings { + channelIntegrityKey?: AsymmetricEncryptedSecret; + serviceDataEncryptionKey?: AsymmetricEncryptedSecret; +} + +// @public +export interface CloudAppliancesListSupportedConfigurationsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CloudAppliancesListSupportedConfigurationsResponse = CloudApplianceConfigurationList; + +// @public +export interface CloudAppliancesProvisionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConfigureDeviceRequest = BaseModel & { + friendlyName: string; + currentDeviceName: string; + timeZone: string; + dnsSettings?: SecondaryDNSSettings; + networkInterfaceData0Settings?: NetworkInterfaceData0Settings; +}; + +// @public +export type ControllerId = "Unknown" | "None" | "Controller0" | "Controller1"; + +// @public +export type ControllerPowerStateAction = "Start" | "Restart" | "Shutdown"; + +// @public +export type ControllerPowerStateChangeRequest = BaseModel & { + action: ControllerPowerStateAction; + activeController: ControllerId; + controller0State: ControllerStatus; + controller1State: ControllerStatus; +}; + +// @public +export type ControllerStatus = "NotPresent" | "PoweredOff" | "Ok" | "Recovering" | "Warning" | "Failure"; + +// @public +export interface DataStatistics { + cloudData?: number; + processedData?: number; + throughput?: number; + totalData?: number; +} + +// @public +export type DayOfWeek = "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday"; + +// @public +export type Device = BaseModel & { + friendlyName: string; + activationTime: Date; + culture: string; + deviceDescription: string; + deviceSoftwareVersion: string; + friendlySoftwareName?: string; + deviceConfigurationStatus: DeviceConfigurationStatus; + targetIqn: string; + modelDescription: string; + status: DeviceStatus; + serialNumber: string; + deviceType: DeviceType; + activeController: ControllerId; + friendlySoftwareVersion: string; + availableLocalStorageInBytes?: number; + availableTieredStorageInBytes?: number; + provisionedTieredStorageInBytes?: number; + provisionedLocalStorageInBytes?: number; + provisionedVolumeSizeInBytes?: number; + usingStorageInBytes?: number; + totalTieredStorageInBytes?: number; + agentGroupVersion?: number; + networkInterfaceCardCount?: number; + deviceLocation?: string; + readonly virtualMachineApiType?: VirtualMachineApiType; + details?: DeviceDetails; + rolloverDetails?: DeviceRolloverDetails; +}; + +// @public +export type DeviceConfigurationStatus = "Complete" | "Pending"; + +// @public +export interface DeviceDetails { + endpointCount?: number; + volumeContainerCount?: number; +} + +// @public +export interface DeviceList { + value: Device[]; +} + +// @public +export interface DevicePatch { + deviceDescription?: string; +} + +// @public +export interface DeviceRolloverDetails { + authorizationEligibility?: AuthorizationEligibility; + authorizationStatus?: AuthorizationStatus; + inEligibilityReason?: InEligibilityCategory; +} + +// @public +export interface Devices { + authorizeForServiceEncryptionKeyRollover(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesAuthorizeForServiceEncryptionKeyRolloverOptionalParams): Promise; + beginConfigure(resourceGroupName: string, managerName: string, parameters: ConfigureDeviceRequest, options?: DevicesConfigureOptionalParams): Promise, void>>; + beginConfigureAndWait(resourceGroupName: string, managerName: string, parameters: ConfigureDeviceRequest, options?: DevicesConfigureOptionalParams): Promise; + beginDeactivate(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesDeactivateOptionalParams): Promise, void>>; + beginDeactivateAndWait(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesDeactivateOptionalParams): Promise; + beginDelete(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesDeleteOptionalParams): Promise; + beginFailover(sourceDeviceName: string, resourceGroupName: string, managerName: string, parameters: FailoverRequest, options?: DevicesFailoverOptionalParams): Promise, void>>; + beginFailoverAndWait(sourceDeviceName: string, resourceGroupName: string, managerName: string, parameters: FailoverRequest, options?: DevicesFailoverOptionalParams): Promise; + beginInstallUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesInstallUpdatesOptionalParams): Promise, void>>; + beginInstallUpdatesAndWait(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesInstallUpdatesOptionalParams): Promise; + beginScanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesScanForUpdatesOptionalParams): Promise, void>>; + beginScanForUpdatesAndWait(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesScanForUpdatesOptionalParams): Promise; + get(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesGetOptionalParams): Promise; + getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesGetUpdateSummaryOptionalParams): Promise; + listByManager(resourceGroupName: string, managerName: string, options?: DevicesListByManagerOptionalParams): PagedAsyncIterableIterator; + listFailoverSets(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesListFailoverSetsOptionalParams): PagedAsyncIterableIterator; + listFailoverTargets(sourceDeviceName: string, resourceGroupName: string, managerName: string, parameters: ListFailoverTargetsRequest, options?: DevicesListFailoverTargetsOptionalParams): PagedAsyncIterableIterator; + listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, options?: DevicesListMetricDefinitionOptionalParams): PagedAsyncIterableIterator; + listMetrics(deviceName: string, resourceGroupName: string, managerName: string, filter: string, options?: DevicesListMetricsOptionalParams): PagedAsyncIterableIterator; + update(deviceName: string, resourceGroupName: string, managerName: string, parameters: DevicePatch, options?: DevicesUpdateOptionalParams): Promise; +} + +// @public +export interface DevicesAuthorizeForServiceEncryptionKeyRolloverOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DevicesConfigureOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesDeactivateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DeviceSettings { + beginCreateOrUpdateAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, parameters: AlertSettings, options?: DeviceSettingsCreateOrUpdateAlertSettingsOptionalParams): Promise, DeviceSettingsCreateOrUpdateAlertSettingsResponse>>; + beginCreateOrUpdateAlertSettingsAndWait(deviceName: string, resourceGroupName: string, managerName: string, parameters: AlertSettings, options?: DeviceSettingsCreateOrUpdateAlertSettingsOptionalParams): Promise; + beginCreateOrUpdateTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, parameters: TimeSettings, options?: DeviceSettingsCreateOrUpdateTimeSettingsOptionalParams): Promise, DeviceSettingsCreateOrUpdateTimeSettingsResponse>>; + beginCreateOrUpdateTimeSettingsAndWait(deviceName: string, resourceGroupName: string, managerName: string, parameters: TimeSettings, options?: DeviceSettingsCreateOrUpdateTimeSettingsOptionalParams): Promise; + beginSyncRemotemanagementCertificate(deviceName: string, resourceGroupName: string, managerName: string, options?: DeviceSettingsSyncRemotemanagementCertificateOptionalParams): Promise, void>>; + beginSyncRemotemanagementCertificateAndWait(deviceName: string, resourceGroupName: string, managerName: string, options?: DeviceSettingsSyncRemotemanagementCertificateOptionalParams): Promise; + beginUpdateNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, parameters: NetworkSettingsPatch, options?: DeviceSettingsUpdateNetworkSettingsOptionalParams): Promise, DeviceSettingsUpdateNetworkSettingsResponse>>; + beginUpdateNetworkSettingsAndWait(deviceName: string, resourceGroupName: string, managerName: string, parameters: NetworkSettingsPatch, options?: DeviceSettingsUpdateNetworkSettingsOptionalParams): Promise; + beginUpdateSecuritySettings(deviceName: string, resourceGroupName: string, managerName: string, parameters: SecuritySettingsPatch, options?: DeviceSettingsUpdateSecuritySettingsOptionalParams): Promise, DeviceSettingsUpdateSecuritySettingsResponse>>; + beginUpdateSecuritySettingsAndWait(deviceName: string, resourceGroupName: string, managerName: string, parameters: SecuritySettingsPatch, options?: DeviceSettingsUpdateSecuritySettingsOptionalParams): Promise; + getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: DeviceSettingsGetAlertSettingsOptionalParams): Promise; + getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: DeviceSettingsGetNetworkSettingsOptionalParams): Promise; + getSecuritySettings(deviceName: string, resourceGroupName: string, managerName: string, options?: DeviceSettingsGetSecuritySettingsOptionalParams): Promise; + getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: DeviceSettingsGetTimeSettingsOptionalParams): Promise; +} + +// @public +export interface DeviceSettingsCreateOrUpdateAlertSettingsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeviceSettingsCreateOrUpdateAlertSettingsResponse = AlertSettings; + +// @public +export interface DeviceSettingsCreateOrUpdateTimeSettingsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeviceSettingsCreateOrUpdateTimeSettingsResponse = TimeSettings; + +// @public +export interface DeviceSettingsGetAlertSettingsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeviceSettingsGetAlertSettingsResponse = AlertSettings; + +// @public +export interface DeviceSettingsGetNetworkSettingsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeviceSettingsGetNetworkSettingsResponse = NetworkSettings; + +// @public +export interface DeviceSettingsGetSecuritySettingsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeviceSettingsGetSecuritySettingsResponse = SecuritySettings; + +// @public +export interface DeviceSettingsGetTimeSettingsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeviceSettingsGetTimeSettingsResponse = TimeSettings; + +// @public +export interface DeviceSettingsSyncRemotemanagementCertificateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DeviceSettingsUpdateNetworkSettingsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeviceSettingsUpdateNetworkSettingsResponse = NetworkSettings; + +// @public +export interface DeviceSettingsUpdateSecuritySettingsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeviceSettingsUpdateSecuritySettingsResponse = SecuritySettings; + +// @public +export interface DevicesFailoverOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesGetOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type DevicesGetResponse = Device; + +// @public +export interface DevicesGetUpdateSummaryOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesGetUpdateSummaryResponse = Updates; + +// @public +export interface DevicesInstallUpdatesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesListByManagerOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type DevicesListByManagerResponse = DeviceList; + +// @public +export interface DevicesListFailoverSetsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesListFailoverSetsResponse = FailoverSetsList; + +// @public +export interface DevicesListFailoverTargetsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesListFailoverTargetsResponse = FailoverTargetsList; + +// @public +export interface DevicesListMetricDefinitionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesListMetricDefinitionResponse = MetricDefinitionList; + +// @public +export interface DevicesListMetricsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesListMetricsResponse = MetricList; + +// @public +export interface DevicesScanForUpdatesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeviceStatus = "Unknown" | "Online" | "Offline" | "Deactivated" | "RequiresAttention" | "MaintenanceMode" | "Creating" | "Provisioning" | "Deactivating" | "Deleted" | "ReadyToSetup"; + +// @public +export interface DevicesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesUpdateResponse = Device; + +// @public +export type DeviceType = "Invalid" | "Series8000VirtualAppliance" | "Series8000PhysicalAppliance"; + +// @public +export interface DimensionFilter { + name?: string; + values?: string; +} + +// @public +export interface DNSSettings { + primaryDnsServer?: string; + primaryIpv6DnsServer?: string; + secondaryDnsServers?: string[]; + secondaryIpv6DnsServers?: string[]; +} + +// @public +export type EncryptionAlgorithm = "None" | "AES256" | "RSAES_PKCS1_v_1_5"; + +// @public +export type EncryptionSettings = BaseModel & { + encryptionStatus: EncryptionStatus; + keyRolloverStatus: KeyRolloverStatus; +}; + +// @public +export type EncryptionStatus = "Enabled" | "Disabled"; + +// @public +export interface FailoverRequest { + targetDeviceId?: string; + volumeContainers?: string[]; +} + +// @public +export interface FailoverSet { + eligibilityResult?: FailoverSetEligibilityResult; + volumeContainers?: VolumeContainerFailoverMetadata[]; +} + +// @public +export interface FailoverSetEligibilityResult { + errorMessage?: string; + isEligibleForFailover?: boolean; +} + +// @public +export interface FailoverSetsList { + value?: FailoverSet[]; +} + +// @public +export interface FailoverTarget { + availableLocalStorageInBytes?: number; + availableTieredStorageInBytes?: number; + dataContainersCount?: number; + deviceId?: string; + deviceLocation?: string; + deviceSoftwareVersion?: string; + deviceStatus?: DeviceStatus; + eligibilityResult?: TargetEligibilityResult; + friendlyDeviceSoftwareVersion?: string; + modelDescription?: string; + volumesCount?: number; +} + +// @public +export interface FailoverTargetsList { + value?: FailoverTarget[]; +} + +// @public +export interface Feature { + name: string; + status: FeatureSupportStatus; +} + +// @public +export interface FeatureFilter { + deviceId?: string; +} + +// @public +export interface FeatureList { + value: Feature[]; +} + +// @public +export type FeatureSupportStatus = "NotAvailable" | "UnsupportedDeviceVersion" | "Supported"; + +// @public +export interface HardwareComponent { + componentId: string; + displayName: string; + status: HardwareComponentStatus; + statusDisplayName: string; +} + +// @public +export type HardwareComponentGroup = BaseModel & { + displayName: string; + lastUpdatedTime: Date; + components: HardwareComponent[]; +}; + +// @public +export interface HardwareComponentGroupList { + value: HardwareComponentGroup[]; +} + +// @public +export interface HardwareComponentGroups { + beginChangeControllerPowerState(deviceName: string, hardwareComponentGroupName: string, resourceGroupName: string, managerName: string, parameters: ControllerPowerStateChangeRequest, options?: HardwareComponentGroupsChangeControllerPowerStateOptionalParams): Promise, void>>; + beginChangeControllerPowerStateAndWait(deviceName: string, hardwareComponentGroupName: string, resourceGroupName: string, managerName: string, parameters: ControllerPowerStateChangeRequest, options?: HardwareComponentGroupsChangeControllerPowerStateOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: HardwareComponentGroupsListByDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface HardwareComponentGroupsChangeControllerPowerStateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface HardwareComponentGroupsListByDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HardwareComponentGroupsListByDeviceResponse = HardwareComponentGroupList; + +// @public +export type HardwareComponentStatus = "Unknown" | "NotPresent" | "PoweredOff" | "Ok" | "Recovering" | "Warning" | "Failure"; + +// @public +export type InEligibilityCategory = "DeviceNotOnline" | "NotSupportedAppliance" | "RolloverPending"; + +// @public +export type IscsiAndCloudStatus = "Disabled" | "IscsiEnabled" | "CloudEnabled" | "IscsiAndCloudEnabled"; + +// @public +export type Job = BaseModel & { + status: JobStatus; + startTime?: Date; + endTime?: Date; + percentComplete: number; + error?: JobErrorDetails; + jobType?: JobType; + dataStats?: DataStatistics; + entityLabel?: string; + entityType?: string; + jobStages?: JobStage[]; + deviceId?: string; + isCancellable?: boolean; + backupType?: BackupType; + sourceDeviceId?: string; + backupPointInTime?: Date; +}; + +// @public +export interface JobErrorDetails { + code: string; + errorDetails?: JobErrorItem[]; + message: string; +} + +// @public +export interface JobErrorItem { + code: string; + message: string; + recommendations?: string[]; +} + +// @public +export interface JobFilter { + jobType?: string; + startTime?: Date; + status?: string; +} + +// @public +export interface JobList { + nextLink?: string; + value: Job[]; +} + +// @public +export interface Jobs { + beginCancel(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: JobsCancelOptionalParams): Promise, void>>; + beginCancelAndWait(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: JobsCancelOptionalParams): Promise; + get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: JobsGetOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: JobsListByDeviceOptionalParams): PagedAsyncIterableIterator; + listByManager(resourceGroupName: string, managerName: string, options?: JobsListByManagerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface JobsCancelOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface JobsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type JobsGetResponse = Job; + +// @public +export interface JobsListByDeviceNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type JobsListByDeviceNextResponse = JobList; + +// @public +export interface JobsListByDeviceOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type JobsListByDeviceResponse = JobList; + +// @public +export interface JobsListByManagerNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type JobsListByManagerNextResponse = JobList; + +// @public +export interface JobsListByManagerOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type JobsListByManagerResponse = JobList; + +// @public +export interface JobStage { + detail?: string; + errorCode?: string; + message?: string; + stageStatus: JobStatus; +} + +// @public +export type JobStatus = "Running" | "Succeeded" | "Failed" | "Canceled"; + +// @public +export type JobType = "ScheduledBackup" | "ManualBackup" | "RestoreBackup" | "CloneVolume" | "FailoverVolumeContainers" | "CreateLocallyPinnedVolume" | "ModifyVolume" | "InstallUpdates" | "SupportPackageLogs" | "CreateCloudAppliance"; + +// @public +export interface Key { + activationKey: string; +} + +// @public +export type KeyRolloverStatus = "Required" | "NotRequired"; + +// @public +export interface ListFailoverTargetsRequest { + volumeContainers?: string[]; +} + +// @public +export type Manager = Resource & { + etag?: string; + cisIntrinsicSettings?: ManagerIntrinsicSettings; + sku?: ManagerSku; + provisioningState?: string; +}; + +// @public +export type ManagerExtendedInfo = BaseModel & { + etag?: string; + version?: string; + integrityKey?: string; + encryptionKey?: string; + encryptionKeyThumbprint?: string; + portalCertificateThumbprint?: string; + algorithm?: string; +}; + +// @public +export interface ManagerIntrinsicSettings { + type: ManagerType; +} + +// @public +export interface ManagerList { + value: Manager[]; +} + +// @public +export interface ManagerPatch { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface Managers { + createExtendedInfo(resourceGroupName: string, managerName: string, parameters: ManagerExtendedInfo, options?: ManagersCreateExtendedInfoOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, managerName: string, parameters: Manager, options?: ManagersCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, managerName: string, options?: ManagersDeleteOptionalParams): Promise; + deleteExtendedInfo(resourceGroupName: string, managerName: string, options?: ManagersDeleteExtendedInfoOptionalParams): Promise; + get(resourceGroupName: string, managerName: string, options?: ManagersGetOptionalParams): Promise; + getActivationKey(resourceGroupName: string, managerName: string, options?: ManagersGetActivationKeyOptionalParams): Promise; + getDevicePublicEncryptionKey(deviceName: string, resourceGroupName: string, managerName: string, options?: ManagersGetDevicePublicEncryptionKeyOptionalParams): Promise; + getEncryptionSettings(resourceGroupName: string, managerName: string, options?: ManagersGetEncryptionSettingsOptionalParams): Promise; + getExtendedInfo(resourceGroupName: string, managerName: string, options?: ManagersGetExtendedInfoOptionalParams): Promise; + getPublicEncryptionKey(resourceGroupName: string, managerName: string, options?: ManagersGetPublicEncryptionKeyOptionalParams): Promise; + list(options?: ManagersListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: ManagersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listFeatureSupportStatus(resourceGroupName: string, managerName: string, options?: ManagersListFeatureSupportStatusOptionalParams): PagedAsyncIterableIterator; + listMetricDefinition(resourceGroupName: string, managerName: string, options?: ManagersListMetricDefinitionOptionalParams): PagedAsyncIterableIterator; + listMetrics(resourceGroupName: string, managerName: string, filter: string, options?: ManagersListMetricsOptionalParams): PagedAsyncIterableIterator; + regenerateActivationKey(resourceGroupName: string, managerName: string, options?: ManagersRegenerateActivationKeyOptionalParams): Promise; + update(resourceGroupName: string, managerName: string, parameters: ManagerPatch, options?: ManagersUpdateOptionalParams): Promise; + updateExtendedInfo(resourceGroupName: string, managerName: string, ifMatch: string, parameters: ManagerExtendedInfo, options?: ManagersUpdateExtendedInfoOptionalParams): Promise; +} + +// @public +export interface ManagersCreateExtendedInfoOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersCreateExtendedInfoResponse = ManagerExtendedInfo; + +// @public +export interface ManagersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersCreateOrUpdateResponse = Manager; + +// @public +export interface ManagersDeleteExtendedInfoOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ManagersDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ManagersGetActivationKeyOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersGetActivationKeyResponse = Key; + +// @public +export interface ManagersGetDevicePublicEncryptionKeyOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersGetDevicePublicEncryptionKeyResponse = PublicKey; + +// @public +export interface ManagersGetEncryptionSettingsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersGetEncryptionSettingsResponse = EncryptionSettings; + +// @public +export interface ManagersGetExtendedInfoOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersGetExtendedInfoResponse = ManagerExtendedInfo; + +// @public +export interface ManagersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ManagersGetPublicEncryptionKeyOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersGetPublicEncryptionKeyResponse = SymmetricEncryptedSecret; + +// @public +export type ManagersGetResponse = Manager; + +// @public +export interface ManagerSku { + name: "Standard"; +} + +// @public +export interface ManagersListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersListByResourceGroupResponse = ManagerList; + +// @public +export interface ManagersListFeatureSupportStatusOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ManagersListFeatureSupportStatusResponse = FeatureList; + +// @public +export interface ManagersListMetricDefinitionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersListMetricDefinitionResponse = MetricDefinitionList; + +// @public +export interface ManagersListMetricsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersListMetricsResponse = MetricList; + +// @public +export interface ManagersListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersListResponse = ManagerList; + +// @public +export interface ManagersRegenerateActivationKeyOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersRegenerateActivationKeyResponse = Key; + +// @public +export interface ManagersUpdateExtendedInfoOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersUpdateExtendedInfoResponse = ManagerExtendedInfo; + +// @public +export interface ManagersUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagersUpdateResponse = Manager; + +// @public +export type ManagerType = "GardaV1" | "HelsinkiV1"; + +// @public +export type MetricAggregationType = "Average" | "Last" | "Maximum" | "Minimum" | "None" | "Total"; + +// @public +export interface MetricAvailablity { + retention?: string; + timeGrain?: string; +} + +// @public +export interface MetricData { + average?: number; + count?: number; + maximum?: number; + minimum?: number; + sum?: number; + timeStamp?: Date; +} + +// @public +export interface MetricDefinition { + category?: string; + dimensions?: MetricDimension[]; + metricAvailabilities?: MetricAvailablity[]; + name?: MetricName; + primaryAggregationType?: MetricAggregationType; + resourceId?: string; + type?: string; + unit?: MetricUnit; +} + +// @public +export interface MetricDefinitionList { + value?: MetricDefinition[]; +} + +// @public +export interface MetricDimension { + name?: string; + value?: string; +} + +// @public +export interface MetricFilter { + category: string; + dimensions?: DimensionFilter; + endTime?: Date; + name?: MetricNameFilter; + startTime?: Date; + timeGrain?: string; +} + +// @public +export interface MetricList { + value?: Metrics[]; +} + +// @public +export interface MetricName { + localizedValue?: string; + value?: string; +} + +// @public +export interface MetricNameFilter { + value?: string; +} + +// @public +export interface Metrics { + dimensions?: MetricDimension[]; + endTime?: Date; + name?: MetricName; + primaryAggregation?: MetricAggregationType; + resourceId?: string; + startTime?: Date; + timeGrain?: string; + type?: string; + unit?: MetricUnit; + values?: MetricData[]; +} + +// @public +export type MetricUnit = "Bytes" | "BytesPerSecond" | "Count" | "CountPerSecond" | "Percent" | "Seconds"; + +// @public +export type MonitoringStatus = "Enabled" | "Disabled"; + +// @public +export type NetInterfaceId = "Invalid" | "Data0" | "Data1" | "Data2" | "Data3" | "Data4" | "Data5"; + +// @public +export type NetInterfaceStatus = "Enabled" | "Disabled"; + +// @public +export interface NetworkAdapterList { + value: NetworkAdapters[]; +} + +// @public +export interface NetworkAdapters { + interfaceId: NetInterfaceId; + iscsiAndCloudStatus: IscsiAndCloudStatus; + isDefault?: boolean; + mode: NetworkMode; + netInterfaceStatus: NetInterfaceStatus; + nicIpv4Settings?: NicIPv4; + nicIpv6Settings?: NicIPv6; + speed?: number; +} + +// @public +export interface NetworkInterfaceData0Settings { + controllerOneIp?: string; + controllerZeroIp?: string; +} + +// @public +export type NetworkMode = "Invalid" | "IPV4" | "IPV6" | "BOTH"; + +// @public +export type NetworkSettings = BaseModel & { + dnsSettings: DNSSettings; + networkAdapters: NetworkAdapterList; + webproxySettings: WebproxySettings; +}; + +// @public +export interface NetworkSettingsPatch { + dnsSettings?: DNSSettings; + networkAdapters?: NetworkAdapterList; +} + +// @public +export interface NicIPv4 { + controller0Ipv4Address?: string; + controller1Ipv4Address?: string; + ipv4Address?: string; + ipv4Gateway?: string; + ipv4Netmask?: string; +} + +// @public +export interface NicIPv6 { + controller0Ipv6Address?: string; + controller1Ipv6Address?: string; + ipv6Address?: string; + ipv6Gateway?: string; + ipv6Prefix?: string; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = AvailableProviderOperationList; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = AvailableProviderOperationList; + +// @public +export type OperationStatus = "None" | "Updating" | "Deleting" | "Restoring"; + +// @public +export type OwnerShipStatus = "Owned" | "NotOwned"; + +// @public +export interface PublicKey { + key: string; +} + +// @public +export type RecurrenceType = "Minutes" | "Hourly" | "Daily" | "Weekly"; + +// @public +export type RemoteManagementModeConfiguration = "Unknown" | "Disabled" | "HttpsEnabled" | "HttpsAndHttpEnabled"; + +// @public +export interface RemoteManagementSettings { + remoteManagementCertificate?: string; + remoteManagementMode: RemoteManagementModeConfiguration; +} + +// @public +export interface RemoteManagementSettingsPatch { + remoteManagementMode: RemoteManagementModeConfiguration; +} + +// @public +export interface Resource { + readonly id?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export type ScheduledBackupStatus = "Disabled" | "Enabled"; + +// @public +export interface ScheduleRecurrence { + recurrenceType: RecurrenceType; + recurrenceValue: number; + weeklyDaysList?: DayOfWeek[]; +} + +// @public +export type ScheduleStatus = "Enabled" | "Disabled"; + +// @public +export interface SecondaryDNSSettings { + secondaryDnsServers?: string[]; +} + +// @public +export type SecuritySettings = BaseModel & { + remoteManagementSettings: RemoteManagementSettings; + chapSettings: ChapSettings; +}; + +// @public +export interface SecuritySettingsPatch { + chapSettings?: ChapSettings; + cloudApplianceSettings?: CloudApplianceSettings; + deviceAdminPassword?: AsymmetricEncryptedSecret; + remoteManagementSettings?: RemoteManagementSettingsPatch; + snapshotPassword?: AsymmetricEncryptedSecret; +} + +// @public +export interface SendTestAlertEmailRequest { + emailList: string[]; +} + +// @public +export type SslStatus = "Enabled" | "Disabled"; + +// @public +export type StorageAccountCredential = BaseModel & { + endPoint: string; + sslStatus: SslStatus; + accessKey?: AsymmetricEncryptedSecret; + readonly volumesCount?: number; +}; + +// @public +export interface StorageAccountCredentialList { + value: StorageAccountCredential[]; +} + +// @public +export interface StorageAccountCredentials { + beginCreateOrUpdate(storageAccountCredentialName: string, resourceGroupName: string, managerName: string, parameters: StorageAccountCredential, options?: StorageAccountCredentialsCreateOrUpdateOptionalParams): Promise, StorageAccountCredentialsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(storageAccountCredentialName: string, resourceGroupName: string, managerName: string, parameters: StorageAccountCredential, options?: StorageAccountCredentialsCreateOrUpdateOptionalParams): Promise; + beginDelete(storageAccountCredentialName: string, resourceGroupName: string, managerName: string, options?: StorageAccountCredentialsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(storageAccountCredentialName: string, resourceGroupName: string, managerName: string, options?: StorageAccountCredentialsDeleteOptionalParams): Promise; + get(storageAccountCredentialName: string, resourceGroupName: string, managerName: string, options?: StorageAccountCredentialsGetOptionalParams): Promise; + listByManager(resourceGroupName: string, managerName: string, options?: StorageAccountCredentialsListByManagerOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface StorageAccountCredentialsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageAccountCredentialsCreateOrUpdateResponse = StorageAccountCredential; + +// @public +export interface StorageAccountCredentialsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface StorageAccountCredentialsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAccountCredentialsGetResponse = StorageAccountCredential; + +// @public +export interface StorageAccountCredentialsListByManagerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAccountCredentialsListByManagerResponse = StorageAccountCredentialList; + +// @public (undocumented) +export class StorSimple8000SeriesManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: StorSimple8000SeriesManagementClientOptionalParams); + // (undocumented) + accessControlRecords: AccessControlRecords; + // (undocumented) + alerts: Alerts; + // (undocumented) + apiVersion: string; + // (undocumented) + backupPolicies: BackupPolicies; + // (undocumented) + backups: Backups; + // (undocumented) + backupSchedules: BackupSchedules; + // (undocumented) + bandwidthSettings: BandwidthSettings; + // (undocumented) + cloudAppliances: CloudAppliances; + // (undocumented) + devices: Devices; + // (undocumented) + deviceSettings: DeviceSettings; + // (undocumented) + hardwareComponentGroups: HardwareComponentGroups; + // (undocumented) + jobs: Jobs; + // (undocumented) + managers: Managers; + // (undocumented) + operations: Operations; + // (undocumented) + storageAccountCredentials: StorageAccountCredentials; + // (undocumented) + subscriptionId: string; + // (undocumented) + volumeContainers: VolumeContainers; + // (undocumented) + volumes: Volumes; +} + +// @public +export interface StorSimple8000SeriesManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface SymmetricEncryptedSecret { + encryptionAlgorithm: EncryptionAlgorithm; + value: string; + valueCertificateThumbprint?: string; +} + +// @public +export interface TargetEligibilityErrorMessage { + message?: string; + resolution?: string; + resultCode?: TargetEligibilityResultCode; +} + +// @public +export interface TargetEligibilityResult { + eligibilityStatus?: TargetEligibilityStatus; + messages?: TargetEligibilityErrorMessage[]; +} + +// @public +export type TargetEligibilityResultCode = "TargetAndSourceCannotBeSameError" | "TargetIsNotOnlineError" | "TargetSourceIncompatibleVersionError" | "LocalToTieredVolumesConversionWarning" | "TargetInsufficientCapacityError" | "TargetInsufficientLocalVolumeMemoryError" | "TargetInsufficientTieredVolumeMemoryError"; + +// @public +export type TargetEligibilityStatus = "NotEligible" | "Eligible"; + +// @public +export interface Time { + hours: number; + minutes: number; + seconds: number; +} + +// @public +export type TimeSettings = BaseModel & { + timeZone: string; + primaryTimeServer?: string; + secondaryTimeServer?: string[]; +}; + +// @public +export type Updates = BaseModel & { + regularUpdatesAvailable?: boolean; + maintenanceModeUpdatesAvailable?: boolean; + isUpdateInProgress?: boolean; + lastUpdatedTime?: Date; +}; + +// @public +export type VirtualMachineApiType = "Classic" | "Arm"; + +// @public +export interface VmImage { + name: string; + offer: string; + publisher: string; + sku: string; + version: string; +} + +// @public +export type Volume = BaseModel & { + sizeInBytes: number; + volumeType: VolumeType; + readonly volumeContainerId?: string; + accessControlRecordIds: string[]; + volumeStatus: VolumeStatus; + readonly operationStatus?: OperationStatus; + readonly backupStatus?: BackupStatus; + monitoringStatus: MonitoringStatus; + readonly backupPolicyIds?: string[]; +}; + +// @public +export type VolumeContainer = BaseModel & { + encryptionKey?: AsymmetricEncryptedSecret; + readonly encryptionStatus?: EncryptionStatus; + readonly volumeCount?: number; + storageAccountCredentialId: string; + readonly ownerShipStatus?: OwnerShipStatus; + bandWidthRateInMbps?: number; + bandwidthSettingId?: string; + readonly totalCloudStorageUsageInBytes?: number; +}; + +// @public +export interface VolumeContainerFailoverMetadata { + volumeContainerId?: string; + volumes?: VolumeFailoverMetadata[]; +} + +// @public +export interface VolumeContainerList { + value: VolumeContainer[]; +} + +// @public +export interface VolumeContainers { + beginCreateOrUpdate(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, parameters: VolumeContainer, options?: VolumeContainersCreateOrUpdateOptionalParams): Promise, VolumeContainersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, parameters: VolumeContainer, options?: VolumeContainersCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: VolumeContainersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: VolumeContainersDeleteOptionalParams): Promise; + get(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: VolumeContainersGetOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: VolumeContainersListByDeviceOptionalParams): PagedAsyncIterableIterator; + listMetricDefinition(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: VolumeContainersListMetricDefinitionOptionalParams): PagedAsyncIterableIterator; + listMetrics(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, filter: string, options?: VolumeContainersListMetricsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VolumeContainersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VolumeContainersCreateOrUpdateResponse = VolumeContainer; + +// @public +export interface VolumeContainersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VolumeContainersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumeContainersGetResponse = VolumeContainer; + +// @public +export interface VolumeContainersListByDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumeContainersListByDeviceResponse = VolumeContainerList; + +// @public +export interface VolumeContainersListMetricDefinitionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumeContainersListMetricDefinitionResponse = MetricDefinitionList; + +// @public +export interface VolumeContainersListMetricsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumeContainersListMetricsResponse = MetricList; + +// @public +export interface VolumeFailoverMetadata { + backupCreatedDate?: Date; + backupElementId?: string; + backupId?: string; + backupPolicyId?: string; + sizeInBytes?: number; + volumeId?: string; + volumeType?: VolumeType; +} + +// @public +export interface VolumeList { + value: Volume[]; +} + +// @public +export interface Volumes { + beginCreateOrUpdate(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, parameters: Volume, options?: VolumesCreateOrUpdateOptionalParams): Promise, VolumesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, parameters: Volume, options?: VolumesCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options?: VolumesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options?: VolumesDeleteOptionalParams): Promise; + get(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options?: VolumesGetOptionalParams): Promise; + listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: VolumesListByDeviceOptionalParams): PagedAsyncIterableIterator; + listByVolumeContainer(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: VolumesListByVolumeContainerOptionalParams): PagedAsyncIterableIterator; + listMetricDefinition(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options?: VolumesListMetricDefinitionOptionalParams): PagedAsyncIterableIterator; + listMetrics(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, filter: string, options?: VolumesListMetricsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VolumesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VolumesCreateOrUpdateResponse = Volume; + +// @public +export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VolumesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesGetResponse = Volume; + +// @public +export interface VolumesListByDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesListByDeviceResponse = VolumeList; + +// @public +export interface VolumesListByVolumeContainerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesListByVolumeContainerResponse = VolumeList; + +// @public +export interface VolumesListMetricDefinitionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesListMetricDefinitionResponse = MetricDefinitionList; + +// @public +export interface VolumesListMetricsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesListMetricsResponse = MetricList; + +// @public +export type VolumeStatus = "Online" | "Offline"; + +// @public +export type VolumeType = "Tiered" | "Archival" | "LocallyPinned"; + +// @public +export interface WebproxySettings { + authentication: AuthenticationType; + connectionUri?: string; + username: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/storsimple8000series/arm-storsimple8000series/rollup.config.js b/sdk/storsimple8000series/arm-storsimple8000series/rollup.config.js index a8fd715a2068..9be1955eb7f1 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/rollup.config.js +++ b/sdk/storsimple8000series/arm-storsimple8000series/rollup.config.js @@ -1,31 +1,188 @@ -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + /** - * @type {import('rollup').RollupFileOptions} + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. */ -const config = { - input: './esm/storSimple8000SeriesManagementClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], - output: { - file: "./dist/arm-storsimple8000series.js", - format: "umd", - name: "Azure.ArmStorsimple8000series", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */` - }, - plugins: [ - nodeResolve({ module: true }) - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/sample.env b/sdk/storsimple8000series/arm-storsimple8000series/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsCreateOrUpdate.ts new file mode 100644 index 000000000000..5eaa8371a19b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsCreateOrUpdate.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or Updates an access control record. + * + * @summary Creates or Updates an access control record. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsCreateOrUpdate.json + */ +import { + AccessControlRecord, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const accessControlRecordName = "ACRForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: AccessControlRecord = { + initiatorName: "iqn.2017-06.com.contoso:ForTest" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.accessControlRecords.beginCreateOrUpdateAndWait( + accessControlRecordName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +accessControlRecordsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsDelete.ts new file mode 100644 index 000000000000..6e062016bcd8 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsDelete.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the access control record. + * + * @summary Deletes the access control record. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const accessControlRecordName = "ACRForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.accessControlRecords.beginDeleteAndWait( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsGet.ts new file mode 100644 index 000000000000..5c529001e905 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsGet.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified access control record name. + * + * @summary Returns the properties of the specified access control record name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const accessControlRecordName = "ACRForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.accessControlRecords.get( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsListByManager.ts new file mode 100644 index 000000000000..85187728fcc9 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/accessControlRecordsListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the access control records in a manager. + * + * @summary Retrieves all the access control records in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.accessControlRecords.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +accessControlRecordsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsClear.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsClear.ts new file mode 100644 index 000000000000..10d8df45bb1f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsClear.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clear the alerts. + * + * @summary Clear the alerts. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsClear.json + */ +import { + ClearAlertRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsClear() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: ClearAlertRequest = { + alerts: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/alerts/308b5bd2-824b-436f-840e-44bde075ef33" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.alerts.clear( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +alertsClear().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsListByManager.ts new file mode 100644 index 000000000000..c62418cf7a6b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsListByManager.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the alerts in a manager. + * + * @summary Retrieves all the alerts in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "status eq 'Active' and appearedOnTime ge '2017-06-09T18:30:00Z' and appearedOnTime le '2017-06-19T18:30:00Z' and sourceType eq 'Device' and sourceName eq 'Device05ForSDKTest'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.alerts.listByManager( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +alertsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsSendTestEmail.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsSendTestEmail.ts new file mode 100644 index 000000000000..719cac5b6770 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/alertsSendTestEmail.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Sends a test alert email. + * + * @summary Sends a test alert email. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsSendTestEmail.json + */ +import { + SendTestAlertEmailRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsSendTestEmail() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: SendTestAlertEmailRequest = { + emailList: ["testemailid@contoso.com"] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.alerts.sendTestEmail( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +alertsSendTestEmail().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesBackupNow.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesBackupNow.ts new file mode 100644 index 000000000000..a343b2f65982 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesBackupNow.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Backup the backup policy now. + * + * @summary Backup the backup policy now. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesBackupNow.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupPoliciesBackupNow() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupType = "CloudSnapshot"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupPolicies.beginBackupNowAndWait( + deviceName, + backupPolicyName, + backupType, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupPoliciesBackupNow().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesCreateOrUpdate.ts new file mode 100644 index 000000000000..efb9b1ee65ba --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesCreateOrUpdate.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the backup policy. + * + * @summary Creates or updates the backup policy. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesCreateOrUpdate.json + */ +import { + BackupPolicy, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupPoliciesCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: BackupPolicy = { + kind: "Series8000", + volumeIds: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/volumeContainerForSDKTest/volumes/Clonedvolume1", + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/volumeContainerForSDKTest/volumes/volume1" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupPolicies.beginCreateOrUpdateAndWait( + deviceName, + backupPolicyName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +backupPoliciesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesDelete.ts new file mode 100644 index 000000000000..58582b5d4f2d --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesDelete.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup policy. + * + * @summary Deletes the backup policy. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupPoliciesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupPolicies.beginDeleteAndWait( + deviceName, + backupPolicyName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupPoliciesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesGet.ts new file mode 100644 index 000000000000..f212b9641fb8 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesGet.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified backup policy name. + * + * @summary Gets the properties of the specified backup policy name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupPoliciesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupPolicies.get( + deviceName, + backupPolicyName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupPoliciesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesListByDevice.ts new file mode 100644 index 000000000000..5154fbaf072f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupPoliciesListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the backup policies in a device. + * + * @summary Gets all the backup policies in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupPoliciesListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.backupPolicies.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupPoliciesListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesCreateOrUpdate.ts new file mode 100644 index 000000000000..66d7544a7d56 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesCreateOrUpdate.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the backup schedule. + * + * @summary Creates or updates the backup schedule. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesCreateOrUpdate.json + */ +import { + BackupSchedule, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupSchedulesCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupScheduleName = "schedule2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: BackupSchedule = { + backupType: "CloudSnapshot", + kind: "Series8000", + retentionCount: 1, + scheduleRecurrence: { + recurrenceType: "Weekly", + recurrenceValue: 1, + weeklyDaysList: ["Friday", "Thursday", "Monday"] + }, + scheduleStatus: "Enabled", + startTime: new Date("2017-06-24T01:00:00Z") + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupSchedules.beginCreateOrUpdateAndWait( + deviceName, + backupPolicyName, + backupScheduleName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +backupSchedulesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesDelete.ts new file mode 100644 index 000000000000..33cfe9876b49 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesDelete.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup schedule. + * + * @summary Deletes the backup schedule. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupSchedulesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupScheduleName = "schedule1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupSchedules.beginDeleteAndWait( + deviceName, + backupPolicyName, + backupScheduleName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupSchedulesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesGet.ts new file mode 100644 index 000000000000..3f08943422d7 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesGet.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified backup schedule name. + * + * @summary Gets the properties of the specified backup schedule name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupSchedulesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupScheduleName = "schedule2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupSchedules.get( + deviceName, + backupPolicyName, + backupScheduleName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupSchedulesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesListByBackupPolicy.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesListByBackupPolicy.ts new file mode 100644 index 000000000000..9cdbfc9c6bc0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupSchedulesListByBackupPolicy.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the backup schedules in a backup policy. + * + * @summary Gets all the backup schedules in a backup policy. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesListByBackupPolicy.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupSchedulesListByBackupPolicy() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.backupSchedules.listByBackupPolicy( + deviceName, + backupPolicyName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupSchedulesListByBackupPolicy().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsClone.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsClone.ts new file mode 100644 index 000000000000..e32d580ab8e0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsClone.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clones the backup element as a new volume. + * + * @summary Clones the backup element as a new volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsClone.json + */ +import { + CloneRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsClone() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupName = "880e1774-94a8-4f3e-85e6-a61e6b94a8b7"; + const backupElementName = + "7e115577-4a3b-4921-bfd4-ee5a1b9bcbb5_0000000000000000"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: CloneRequest = { + backupElement: { + elementId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/backups/880e1774-94a8-4f3e-85e6-a61e6b94a8b7/elements/7e115577-4a3b-4921-bfd4-ee5a1b9bcbb5_0000000000000000", + elementName: "7e115577-4a3b-4921-bfd4-ee5a1b9bcbb5_0000000000000000", + elementType: "managers/devices/backups/elements", + sizeInBytes: 10737418240, + volumeContainerId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/volumeContainerForSDKTest", + volumeName: "Clonedvolume1", + volumeType: "Tiered" + }, + targetAccessControlRecordIds: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/accessControlRecords/ACR2" + ], + targetDeviceId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest", + targetVolumeName: "ClonedClonedvolume1" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backups.beginCloneAndWait( + deviceName, + backupName, + backupElementName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +backupsClone().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsDelete.ts new file mode 100644 index 000000000000..6445cb2de31b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsDelete.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup. + * + * @summary Deletes the backup. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupName = "880e1774-94a8-4f3e-85e6-a61e6b94a8b7"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backups.beginDeleteAndWait( + deviceName, + backupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsListByDevice.ts new file mode 100644 index 000000000000..96c25199f36e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsListByDevice.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backups in a device. + * + * @summary Retrieves all the backups in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "createdTime ge '2017-06-22T18:30:00Z' and backupPolicyId eq '/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/backupPolicies/BkUpPolicy01ForSDKTest'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.backups.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsRestore.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsRestore.ts new file mode 100644 index 000000000000..adab04a58a8d --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/backupsRestore.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Restores the backup on the device. + * + * @summary Restores the backup on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsRestore.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsRestore() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupName = "880e1774-94a8-4f3e-85e6-a61e6b94a8b7"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backups.beginRestoreAndWait( + deviceName, + backupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupsRestore().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsCreateOrUpdate.ts new file mode 100644 index 000000000000..c48d8b5cc489 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsCreateOrUpdate.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the bandwidth setting + * + * @summary Creates or updates the bandwidth setting + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsCreateOrUpdate.json + */ +import { + BandwidthSetting, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function bandwidthSettingsCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const bandwidthSettingName = "BWSForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: BandwidthSetting = { + schedules: [ + { + days: ["Saturday", "Sunday"], + rateInMbps: 10, + start: { hours: 10, minutes: 0, seconds: 0 }, + stop: { hours: 20, minutes: 0, seconds: 0 } + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.bandwidthSettings.beginCreateOrUpdateAndWait( + bandwidthSettingName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +bandwidthSettingsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsDelete.ts new file mode 100644 index 000000000000..9b97a7450497 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsDelete.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the bandwidth setting + * + * @summary Deletes the bandwidth setting + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function bandwidthSettingsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const bandwidthSettingName = "BWSForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.bandwidthSettings.beginDeleteAndWait( + bandwidthSettingName, + resourceGroupName, + managerName + ); + console.log(result); +} + +bandwidthSettingsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsGet.ts new file mode 100644 index 000000000000..f54c8b9b40f7 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsGet.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified bandwidth setting name. + * + * @summary Returns the properties of the specified bandwidth setting name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function bandwidthSettingsGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const bandwidthSettingName = "bandwidthSetting1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.bandwidthSettings.get( + bandwidthSettingName, + resourceGroupName, + managerName + ); + console.log(result); +} + +bandwidthSettingsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsListByManager.ts new file mode 100644 index 000000000000..32a5c590b541 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/bandwidthSettingsListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the bandwidth setting in a manager. + * + * @summary Retrieves all the bandwidth setting in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function bandwidthSettingsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.bandwidthSettings.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +bandwidthSettingsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/cloudAppliancesListSupportedConfigurations.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/cloudAppliancesListSupportedConfigurations.ts new file mode 100644 index 000000000000..1dc1f3b5310a --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/cloudAppliancesListSupportedConfigurations.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists supported cloud appliance models and supported configurations. + * + * @summary Lists supported cloud appliance models and supported configurations. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/CloudAppliancesListSupportedConfigurations.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function cloudAppliancesListSupportedConfigurations() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.cloudAppliances.listSupportedConfigurations( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +cloudAppliancesListSupportedConfigurations().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/cloudAppliancesProvision.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/cloudAppliancesProvision.ts new file mode 100644 index 000000000000..dc8fec502321 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/cloudAppliancesProvision.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Provisions cloud appliance. + * + * @summary Provisions cloud appliance. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/CloudAppliancesProvision.json + */ +import { + CloudAppliance, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function cloudAppliancesProvision() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: CloudAppliance = { + name: "sca07forsdktest", + modelNumber: "8020", + vnetRegion: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.cloudAppliances.beginProvisionAndWait( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +cloudAppliancesProvision().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsCreateOrUpdateAlertSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsCreateOrUpdateAlertSettings.ts new file mode 100644 index 000000000000..bd5348da77ae --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsCreateOrUpdateAlertSettings.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the alert settings of the specified device. + * + * @summary Creates or updates the alert settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsCreateOrUpdateAlertSettings.json + */ +import { + AlertSettings, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsCreateOrUpdateAlertSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: AlertSettings = { + additionalRecipientEmailList: [], + alertNotificationCulture: "en-US", + emailNotification: "Enabled", + notificationToServiceOwners: "Enabled" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.beginCreateOrUpdateAlertSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsCreateOrUpdateAlertSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsCreateOrUpdateTimeSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsCreateOrUpdateTimeSettings.ts new file mode 100644 index 000000000000..447124287298 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsCreateOrUpdateTimeSettings.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the time settings of the specified device. + * + * @summary Creates or updates the time settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsCreateOrUpdateTimeSettings.json + */ +import { + TimeSettings, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsCreateOrUpdateTimeSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: TimeSettings = { + primaryTimeServer: "time.windows.com", + secondaryTimeServer: ["8.8.8.8"], + timeZone: "Pacific Standard Time" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.beginCreateOrUpdateTimeSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsCreateOrUpdateTimeSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetAlertSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetAlertSettings.ts new file mode 100644 index 000000000000..d6591b496638 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetAlertSettings.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the alert settings of the specified device. + * + * @summary Gets the alert settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetAlertSettings.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsGetAlertSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.getAlertSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetAlertSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetNetworkSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetNetworkSettings.ts new file mode 100644 index 000000000000..14834531a36d --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetNetworkSettings.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the network settings of the specified device. + * + * @summary Gets the network settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetNetworkSettings.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsGetNetworkSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.getNetworkSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetNetworkSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetSecuritySettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetSecuritySettings.ts new file mode 100644 index 000000000000..81c19bde8a16 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetSecuritySettings.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the Security properties of the specified device name. + * + * @summary Returns the Security properties of the specified device name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetSecuritySettings.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsGetSecuritySettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.getSecuritySettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetSecuritySettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetTimeSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetTimeSettings.ts new file mode 100644 index 000000000000..d2e8b77be41a --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsGetTimeSettings.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the time settings of the specified device. + * + * @summary Gets the time settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetTimeSettings.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsGetTimeSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.getTimeSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetTimeSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsSyncRemotemanagementCertificate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsSyncRemotemanagementCertificate.ts new file mode 100644 index 000000000000..473946dd09e1 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsSyncRemotemanagementCertificate.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to sync Remote management Certificate between appliance and Service + * + * @summary sync Remote management Certificate between appliance and Service + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsSyncRemotemanagementCertificate.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsSyncRemotemanagementCertificate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.beginSyncRemotemanagementCertificateAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsSyncRemotemanagementCertificate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsUpdateNetworkSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsUpdateNetworkSettings.ts new file mode 100644 index 000000000000..929b48754380 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsUpdateNetworkSettings.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the network settings on the specified device. + * + * @summary Updates the network settings on the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsUpdateNetworkSettings.json + */ +import { + NetworkSettingsPatch, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsUpdateNetworkSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: NetworkSettingsPatch = { + dnsSettings: { + primaryDnsServer: "10.171.65.60", + secondaryDnsServers: ["8.8.8.8"] + } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.beginUpdateNetworkSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsUpdateNetworkSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsUpdateSecuritySettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsUpdateSecuritySettings.ts new file mode 100644 index 000000000000..2881a6457226 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/deviceSettingsUpdateSecuritySettings.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Patch Security properties of the specified device name. + * + * @summary Patch Security properties of the specified device name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsUpdateSecuritySettings.json + */ +import { + SecuritySettingsPatch, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsUpdateSecuritySettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: SecuritySettingsPatch = { + chapSettings: { + initiatorSecret: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "V/uVfWk5OcXfMC0HvUV89o9+cmF636jBnqhFM1pD/zHhmh8Z1KB5/LhVV3T53uGjIlKL3wjhwg+9NIQrIbYuKhl/r8jSftSSH+WqUnQHTRDWazjPAeMu6ozrL5RYzP1h5mgw7XtidZPaaV9ae/uF1KQPkK6TIARaOTdr8I/BLWUg7WdDrfARNYHnW6ezXek1M9Qhv1sL9fZY+JrGB58LF6D2aC2Xjed4K4Jk6v2T1ieneNV27uIdnt21TajuM7w90UlRiVZJZtq/KdEUfqI28C7VoUdcXluAwzR95Ho8hmyIJDqeW3/Wxymdjv+Rctwqtmcka9i2G85Hj8SVV3g4kA==" + }, + initiatorUser: "test-initiator-user", + targetSecret: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "OTR4uwVpy+pf0zthnCIAUXurC8NdSh8RpRG5GWL9TSv4WtkVmpeU/U2A4vjkrchfQOzI1x+uooWikWW9txwwQOM+/N3NG44+/dlHoaEe7AxjmItCKhNj8K2RM6D1mb45wicbF/M4uanuXnGXuT+JmZ+1Lcy2k1GXsk67ejplz2K08h37B+oIW85qMUHLdKuuQlAA/fFS+q6qMti3j2Q8Fr+Sh4U76/2AZVkKRtFeqPB1QhC12dFx6TFoZJkMFzdQz4WNvWVelIK2McKNnOiH0/Z5lAXC7164uzReAoTEfqoNU7qqqRrHhsdwWPu6jbeUn8BQnr7A/X6NWvgeax+HGA==" + }, + targetUser: "test-target-user" + }, + deviceAdminPassword: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: "" + }, + remoteManagementSettings: { remoteManagementMode: "HttpsAndHttpEnabled" }, + snapshotPassword: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: "" + } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.beginUpdateSecuritySettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsUpdateSecuritySettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesAuthorizeForServiceEncryptionKeyRollover.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesAuthorizeForServiceEncryptionKeyRollover.ts new file mode 100644 index 000000000000..b62caca054dc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesAuthorizeForServiceEncryptionKeyRollover.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Authorizes the specified device for service data encryption key rollover. + * + * @summary Authorizes the specified device for service data encryption key rollover. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesAuthorizeForServiceEncryptionKeyRollover.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesAuthorizeForServiceEncryptionKeyRollover() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.authorizeForServiceEncryptionKeyRollover( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesAuthorizeForServiceEncryptionKeyRollover().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesConfigure.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesConfigure.ts new file mode 100644 index 000000000000..0aab85e3063b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesConfigure.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Complete minimal setup before using the device. + * + * @summary Complete minimal setup before using the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesConfigure.json + */ +import { + ConfigureDeviceRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesConfigure() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: ConfigureDeviceRequest = { + currentDeviceName: "Device001ForSDKTest", + friendlyName: "Device001ForSDKTest", + networkInterfaceData0Settings: { + controllerOneIp: "10.168.220.228", + controllerZeroIp: "10.168.220.227" + }, + timeZone: "Pacific Standard Time" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginConfigureAndWait( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +devicesConfigure().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesDeactivate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesDeactivate.ts new file mode 100644 index 000000000000..7da9ec48c243 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesDeactivate.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deactivates the device. + * + * @summary Deactivates the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesDeactivate.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesDeactivate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginDeactivateAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDeactivate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesDelete.ts new file mode 100644 index 000000000000..80cef5b9c797 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesDelete.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the device. + * + * @summary Deletes the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginDeleteAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesFailover.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesFailover.ts new file mode 100644 index 000000000000..bc683ede5953 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesFailover.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Failovers a set of volume containers from a specified source device to a target device. + * + * @summary Failovers a set of volume containers from a specified source device to a target device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesFailover.json + */ +import { + FailoverRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesFailover() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const sourceDeviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: FailoverRequest = { + targetDeviceId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/jemdeviceforsdk", + volumeContainers: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/vcforsdktest" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginFailoverAndWait( + sourceDeviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +devicesFailover().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesGet.ts new file mode 100644 index 000000000000..035888ab4b7d --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesGet.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified device. + * + * @summary Returns the properties of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const expand = "details"; + const options = { expand: expand }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.get( + deviceName, + resourceGroupName, + managerName, + options + ); + console.log(result); +} + +devicesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesGetUpdateSummary.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesGetUpdateSummary.ts new file mode 100644 index 000000000000..e19872432298 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesGetUpdateSummary.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the update summary of the specified device name. + * + * @summary Returns the update summary of the specified device name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesGetUpdateSummary.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGetUpdateSummary() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.getUpdateSummary( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGetUpdateSummary().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesInstallUpdates.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesInstallUpdates.ts new file mode 100644 index 000000000000..2cd075e054f9 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesInstallUpdates.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Downloads and installs the updates on the device. + * + * @summary Downloads and installs the updates on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesInstallUpdates.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesInstallUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginInstallUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesInstallUpdates().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListByManager.ts new file mode 100644 index 000000000000..f360a0e51ad5 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the list of devices for the specified manager. + * + * @summary Returns the list of devices for the specified manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.devices.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListFailoverSets.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListFailoverSets.ts new file mode 100644 index 000000000000..ec5abcf05afb --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListFailoverSets.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns all failover sets for a given device and their eligibility for participating in a failover. A failover set refers to a set of volume containers that need to be failed-over as a single unit to maintain data integrity. + * + * @summary Returns all failover sets for a given device and their eligibility for participating in a failover. A failover set refers to a set of volume containers that need to be failed-over as a single unit to maintain data integrity. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListFailoverSets.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListFailoverSets() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.devices.listFailoverSets( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListFailoverSets().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListFailoverTargets.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListFailoverTargets.ts new file mode 100644 index 000000000000..6a4970707390 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListFailoverTargets.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Given a list of volume containers to be failed over from a source device, this method returns the eligibility result, as a failover target, for all devices under that resource. + * + * @summary Given a list of volume containers to be failed over from a source device, this method returns the eligibility result, as a failover target, for all devices under that resource. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListFailoverTargets.json + */ +import { + ListFailoverTargetsRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListFailoverTargets() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const sourceDeviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: ListFailoverTargetsRequest = { + volumeContainers: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/vcforsdktest" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.devices.listFailoverTargets( + sourceDeviceName, + resourceGroupName, + managerName, + parameters + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListFailoverTargets().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListMetricDefinition.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListMetricDefinition.ts new file mode 100644 index 000000000000..1d8bfd1829a3 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListMetricDefinition.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified device. + * + * @summary Gets the metric definitions for the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListMetricDefinition.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.devices.listMetricDefinition( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListMetrics.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListMetrics.ts new file mode 100644 index 000000000000..9def3d7f98cc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesListMetrics.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified device. + * + * @summary Gets the metrics for the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListMetrics.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'PrimaryStorageTieredUsed' and timeGrain eq 'PT1H' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.devices.listMetrics( + deviceName, + resourceGroupName, + managerName, + filter + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesScanForUpdates.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesScanForUpdates.ts new file mode 100644 index 000000000000..5b489f5a3e16 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesScanForUpdates.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Scans for updates on the device. + * + * @summary Scans for updates on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesScanForUpdates.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesScanForUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginScanForUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesScanForUpdates().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesUpdate.ts new file mode 100644 index 000000000000..056df7e73222 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/devicesUpdate.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Patches the device. + * + * @summary Patches the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesUpdate.json + */ +import { + DevicePatch, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: DevicePatch = { + deviceDescription: "updated device description" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.update( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +devicesUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/hardwareComponentGroupsChangeControllerPowerState.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/hardwareComponentGroupsChangeControllerPowerState.ts new file mode 100644 index 000000000000..a2103aff4fab --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/hardwareComponentGroupsChangeControllerPowerState.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Changes the power state of the controller. + * + * @summary Changes the power state of the controller. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/HardwareComponentGroupsChangeControllerPowerState.json + */ +import { + ControllerPowerStateChangeRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function hardwareComponentGroupsChangeControllerPowerState() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const hardwareComponentGroupName = "Controller0Components"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: ControllerPowerStateChangeRequest = { + action: "Start", + activeController: "Controller0", + controller0State: "Ok", + controller1State: "NotPresent" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.hardwareComponentGroups.beginChangeControllerPowerStateAndWait( + deviceName, + hardwareComponentGroupName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +hardwareComponentGroupsChangeControllerPowerState().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/hardwareComponentGroupsListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/hardwareComponentGroupsListByDevice.ts new file mode 100644 index 000000000000..72cc63580416 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/hardwareComponentGroupsListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists the hardware component groups at device-level. + * + * @summary Lists the hardware component groups at device-level. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/HardwareComponentGroupsListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function hardwareComponentGroupsListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.hardwareComponentGroups.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +hardwareComponentGroupsListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsCancel.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsCancel.ts new file mode 100644 index 000000000000..89769c535639 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsCancel.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Cancels a job on the device. + * + * @summary Cancels a job on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsCancel.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsCancel() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const jobName = "993db21d-101b-41af-9e12-f593d78b99e9"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.jobs.beginCancelAndWait( + deviceName, + jobName, + resourceGroupName, + managerName + ); + console.log(result); +} + +jobsCancel().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsGet.ts new file mode 100644 index 000000000000..88791e82d55f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsGet.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of the specified job name. + * + * @summary Gets the details of the specified job name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsGet() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const deviceName = "sca07forsdktest"; + const jobName = "70a29339-de6d-48e8-b24f-e25ee6769a00"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.jobs.get( + deviceName, + jobName, + resourceGroupName, + managerName + ); + console.log(result); +} + +jobsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsListByDevice.ts new file mode 100644 index 000000000000..d171422ab7f9 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsListByDevice.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs is returned. + * + * @summary Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs is returned. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = "jobType eq 'ManualBackup'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.jobs.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsListByManager.ts new file mode 100644 index 000000000000..c401be1844e8 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/jobsListByManager.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of jobs is returned. + * + * @summary Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of jobs is returned. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = "jobType eq 'FailoverVolumeContainers'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.jobs.listByManager( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersCreateExtendedInfo.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersCreateExtendedInfo.ts new file mode 100644 index 000000000000..415a852dd815 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersCreateExtendedInfo.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates the extended info of the manager. + * + * @summary Creates the extended info of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersCreateExtendedInfo.json + */ +import { + ManagerExtendedInfo, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersCreateExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters: ManagerExtendedInfo = { + algorithm: "None", + integrityKey: "BIl+RHqO8PZ6DRvuXTTK7g==" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.createExtendedInfo( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +managersCreateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersCreateOrUpdate.ts new file mode 100644 index 000000000000..bb0322165bb6 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersCreateOrUpdate.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the manager. + * + * @summary Creates or updates the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersCreateOrUpdate.json + */ +import { + Manager, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters: Manager = { + cisIntrinsicSettings: { type: "GardaV1" }, + location: "westus", + sku: { name: "Standard" } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.createOrUpdate( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +managersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersDelete.ts new file mode 100644 index 000000000000..cb0df97eda73 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersDelete.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the manager. + * + * @summary Deletes the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.delete(resourceGroupName, managerName); + console.log(result); +} + +managersDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersDeleteExtendedInfo.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersDeleteExtendedInfo.ts new file mode 100644 index 000000000000..343d3ad2ea15 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersDeleteExtendedInfo.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the extended info of the manager. + * + * @summary Deletes the extended info of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersDeleteExtendedInfo.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersDeleteExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.deleteExtendedInfo( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersDeleteExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGet.ts new file mode 100644 index 000000000000..6b47c673f4fc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGet.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified manager name. + * + * @summary Returns the properties of the specified manager name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.get(resourceGroupName, managerName); + console.log(result); +} + +managersGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetActivationKey.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetActivationKey.ts new file mode 100644 index 000000000000..5dfc2794963b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetActivationKey.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the activation key of the manager. + * + * @summary Returns the activation key of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetActivationKey.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetActivationKey() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.getActivationKey( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetActivationKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetDevicePublicEncryptionKey.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetDevicePublicEncryptionKey.ts new file mode 100644 index 000000000000..238b4c831d11 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetDevicePublicEncryptionKey.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the public encryption key of the device. + * + * @summary Returns the public encryption key of the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetDevicePublicEncryptionKey.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetDevicePublicEncryptionKey() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const deviceName = "sca01forsdktest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.getDevicePublicEncryptionKey( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetDevicePublicEncryptionKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetEncryptionSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetEncryptionSettings.ts new file mode 100644 index 000000000000..f157af894b4a --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetEncryptionSettings.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the encryption settings of the manager. + * + * @summary Returns the encryption settings of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetEncryptionSettings.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetEncryptionSettings() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.getEncryptionSettings( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetEncryptionSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetExtendedInfo.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetExtendedInfo.ts new file mode 100644 index 000000000000..160a789c94e5 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetExtendedInfo.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the extended information of the specified manager name. + * + * @summary Returns the extended information of the specified manager name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetExtendedInfo.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.getExtendedInfo( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetPublicEncryptionKey.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetPublicEncryptionKey.ts new file mode 100644 index 000000000000..cb4bfb32c64f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersGetPublicEncryptionKey.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the symmetric encrypted public encryption key of the manager. + * + * @summary Returns the symmetric encrypted public encryption key of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetPublicEncryptionKey.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetPublicEncryptionKey() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.getPublicEncryptionKey( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetPublicEncryptionKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersList.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersList.ts new file mode 100644 index 000000000000..5780224ae3bb --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersList.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a subscription. + * + * @summary Retrieves all the managers in a subscription. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersList.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersList() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.managers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +managersList().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListByResourceGroup.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListByResourceGroup.ts new file mode 100644 index 000000000000..c9565c6b7efc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListByResourceGroup.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a resource group. + * + * @summary Retrieves all the managers in a resource group. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListByResourceGroup.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListByResourceGroup() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.managers.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListByResourceGroup().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListFeatureSupportStatus.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListFeatureSupportStatus.ts new file mode 100644 index 000000000000..ca26c25f666b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListFeatureSupportStatus.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists the features and their support status + * + * @summary Lists the features and their support status + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListFeatureSupportStatus.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListFeatureSupportStatus() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.managers.listFeatureSupportStatus( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListFeatureSupportStatus().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListMetricDefinition.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListMetricDefinition.ts new file mode 100644 index 000000000000..121bcaec57f4 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListMetricDefinition.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified manager. + * + * @summary Gets the metric definitions for the specified manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListMetricDefinition.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.managers.listMetricDefinition( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListMetrics.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListMetrics.ts new file mode 100644 index 000000000000..829826ca5440 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersListMetrics.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified manager. + * + * @summary Gets the metrics for the specified manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListMetrics.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'PrimaryStorageTieredUsed' and timeGrain eq 'PT1H' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.managers.listMetrics( + resourceGroupName, + managerName, + filter + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersRegenerateActivationKey.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersRegenerateActivationKey.ts new file mode 100644 index 000000000000..5a93a38da999 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersRegenerateActivationKey.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Re-generates and returns the activation key of the manager. + * + * @summary Re-generates and returns the activation key of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersRegenerateActivationKey.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersRegenerateActivationKey() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.regenerateActivationKey( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersRegenerateActivationKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersUpdate.ts new file mode 100644 index 000000000000..abb142a49741 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersUpdate.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the StorSimple Manager. + * + * @summary Updates the StorSimple Manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersUpdate.json + */ +import { + ManagerPatch, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters: ManagerPatch = { tags: { tagName: "ForSDKTest" } }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.update( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +managersUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersUpdateExtendedInfo.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersUpdateExtendedInfo.ts new file mode 100644 index 000000000000..2ed281a16b13 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/managersUpdateExtendedInfo.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the extended info of the manager. + * + * @summary Updates the extended info of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersUpdateExtendedInfo.json + */ +import { + ManagerExtendedInfo, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersUpdateExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const ifMatch = "674ab9df-af56-4c5c-a5ca-2bddcf1b781a"; + const parameters: ManagerExtendedInfo = { + algorithm: "SHA256", + etag: "674ab9df-af56-4c5c-a5ca-2bddcf1b781a", + integrityKey: "BIl+RHqO8PZ6DRvuXTTK7g==" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.updateExtendedInfo( + resourceGroupName, + managerName, + ifMatch, + parameters + ); + console.log(result); +} + +managersUpdateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/operationsList.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/operationsList.ts new file mode 100644 index 000000000000..48e8adf84a0e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/operationsList.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.StorSimple provider + * + * @summary Lists all of the available REST API operations of the Microsoft.StorSimple provider + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/OperationsList.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsCreateOrUpdate.ts new file mode 100644 index 000000000000..533fba17a245 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsCreateOrUpdate.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the storage account credential. + * + * @summary Creates or updates the storage account credential. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsCreateOrUpdate.json + */ +import { + StorageAccountCredential, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const storageAccountCredentialName = "SACForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: StorageAccountCredential = { + accessKey: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "ATuJSkmrFk4h8r1jrZ4nd3nthLSddcguEO5QLO/NECUtTuB9kL4dNv3/jC4WOvFkeVr3x1UvfhlIeMmJBF1SMr6hR1JzD0xNU/TtQqUeXN7V3jk7I+2l67P9StuHWR6OMd3XOLwvznxOEQtEWpweDiobZU1ZiY03WafcGZFpV5j6tEoHeopoZ1J/GhPtkYmx+TqxzUN6qnir5rP3NSYiZciImP/qu8U9yUV/xpVRv39KvFc2Yr5SpKpMMRUj55XW10UnPer63M6KovF8X9Wi/fNnrZAs1Esl5XddZETGrW/e5B++VMJ6w0Q/uvPR+UBwrOU0804l0SzwdIe3qVVd0Q==" + }, + endPoint: "blob.core.windows.net", + sslStatus: "Enabled" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.storageAccountCredentials.beginCreateOrUpdateAndWait( + storageAccountCredentialName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +storageAccountCredentialsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsDelete.ts new file mode 100644 index 000000000000..325c479fee74 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsDelete.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the storage account credential. + * + * @summary Deletes the storage account credential. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const storageAccountCredentialName = "SACForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.storageAccountCredentials.beginDeleteAndWait( + storageAccountCredentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsGet.ts new file mode 100644 index 000000000000..7397fb58f0df --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsGet.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified storage account credential name. + * + * @summary Gets the properties of the specified storage account credential name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const storageAccountCredentialName = "SACForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.storageAccountCredentials.get( + storageAccountCredentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsListByManager.ts new file mode 100644 index 000000000000..ab7e9d688037 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/storageAccountCredentialsListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the storage account credentials in a manager. + * + * @summary Gets all the storage account credentials in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.storageAccountCredentials.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +storageAccountCredentialsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersCreateOrUpdate.ts new file mode 100644 index 000000000000..f4cf8c158faa --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersCreateOrUpdate.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the volume container. + * + * @summary Creates or updates the volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersCreateOrUpdate.json + */ +import { + VolumeContainer, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: VolumeContainer = { + bandwidthSettingId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/bandwidthSettings/bandwidthSetting1", + encryptionKey: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "R//pyVLx/fn58ia098JiLgZB5RY7fVT+6o8a4fmsvjy+ls2UgJphMf25XVqEQCZnsp/5uxteN1M/9ArPIICdhM7M1+b/Ur7kJ0FH0ktxfk7CrPWWJLI4q20LZoduJGI56lREav1VpuLdqw5F9fRcq7zbfgPQ3B/SD0mfumNRiV+AnwbC6msfavIuWrhVDl9iSzEPE+zU06/kpsexnrS81yYT2QlVVUbvpY4F3zfH8TQPpAROTbv2pld6JO4eGOrZ5O1iOr6XCg2TY2W/jf+Ev4z5tqC9VWXE5kh65gjBfpWN0bDWXKekqEhor2crHAxZi4dybdY8Ok1MDWd1CSU8kw==" + }, + storageAccountCredentialId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/storageAccountCredentials/safortestrecording" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumeContainers.beginCreateOrUpdateAndWait( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +volumeContainersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersDelete.ts new file mode 100644 index 000000000000..65b9c110eee1 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersDelete.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the volume container. + * + * @summary Deletes the volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumeContainers.beginDeleteAndWait( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumeContainersDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersGet.ts new file mode 100644 index 000000000000..205f30055db5 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersGet.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified volume container name. + * + * @summary Gets the properties of the specified volume container name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumeContainers.get( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumeContainersGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListByDevice.ts new file mode 100644 index 000000000000..f5badc422d6e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the volume containers in a device. + * + * @summary Gets all the volume containers in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumeContainers.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumeContainersListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListMetricDefinition.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListMetricDefinition.ts new file mode 100644 index 000000000000..6b7e07b122d5 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListMetricDefinition.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified volume container. + * + * @summary Gets the metric definitions for the specified volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListMetricDefinition.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumeContainers.listMetricDefinition( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumeContainersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListMetrics.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListMetrics.ts new file mode 100644 index 000000000000..777993357543 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumeContainersListMetrics.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified volume container. + * + * @summary Gets the metrics for the specified volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListMetrics.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'CloudConsumedStorage' and timeGrain eq 'PT1M' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumeContainers.listMetrics( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + filter + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumeContainersListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesCreateOrUpdate.ts new file mode 100644 index 000000000000..bb0c58b4e735 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesCreateOrUpdate.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the volume. + * + * @summary Creates or updates the volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesCreateOrUpdate.json + */ +import { + Volume, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const volumeName = "Volume1ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: Volume = { + accessControlRecordIds: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/accessControlRecords/ACR2" + ], + monitoringStatus: "Enabled", + sizeInBytes: 5368709120, + volumeStatus: "Offline", + volumeType: "Tiered" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumes.beginCreateOrUpdateAndWait( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +volumesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesDelete.ts new file mode 100644 index 000000000000..34eebe7362cd --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesDelete.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the volume. + * + * @summary Deletes the volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const volumeName = "Volume1ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumes.beginDeleteAndWait( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesGet.ts new file mode 100644 index 000000000000..3b0824678e53 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesGet.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified volume name. + * + * @summary Returns the properties of the specified volume name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const volumeName = "Volume1ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumes.get( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListByDevice.ts new file mode 100644 index 000000000000..7de6747b89ff --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the volumes in a device. + * + * @summary Retrieves all the volumes in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumes.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListByVolumeContainer.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListByVolumeContainer.ts new file mode 100644 index 000000000000..66dba1340936 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListByVolumeContainer.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the volumes in a volume container. + * + * @summary Retrieves all the volumes in a volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListByVolumeContainer.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesListByVolumeContainer() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "volumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumes.listByVolumeContainer( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListByVolumeContainer().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListMetricDefinition.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListMetricDefinition.ts new file mode 100644 index 000000000000..aa954922dbe2 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListMetricDefinition.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified volume. + * + * @summary Gets the metric definitions for the specified volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListMetricDefinition.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const volumeName = "CloneVolForSDKTest890836587"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumes.listMetricDefinition( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListMetrics.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListMetrics.ts new file mode 100644 index 000000000000..4db0d67a59a6 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples-dev/volumesListMetrics.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified volume. + * + * @summary Gets the metrics for the specified volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListMetrics.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const volumeName = "CloneVolForSDKTest890836587"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'PrimaryStorageTieredUsed' and timeGrain eq 'PT1H' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumes.listMetrics( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + filter + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/README.md b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/README.md new file mode 100644 index 000000000000..a6c979c8c084 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/README.md @@ -0,0 +1,232 @@ +# client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accessControlRecordsCreateOrUpdate.js][accesscontrolrecordscreateorupdate] | Creates or Updates an access control record. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsCreateOrUpdate.json | +| [accessControlRecordsDelete.js][accesscontrolrecordsdelete] | Deletes the access control record. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsDelete.json | +| [accessControlRecordsGet.js][accesscontrolrecordsget] | Returns the properties of the specified access control record name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsGet.json | +| [accessControlRecordsListByManager.js][accesscontrolrecordslistbymanager] | Retrieves all the access control records in a manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsListByManager.json | +| [alertsClear.js][alertsclear] | Clear the alerts. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsClear.json | +| [alertsListByManager.js][alertslistbymanager] | Retrieves all the alerts in a manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsListByManager.json | +| [alertsSendTestEmail.js][alertssendtestemail] | Sends a test alert email. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsSendTestEmail.json | +| [backupPoliciesBackupNow.js][backuppoliciesbackupnow] | Backup the backup policy now. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesBackupNow.json | +| [backupPoliciesCreateOrUpdate.js][backuppoliciescreateorupdate] | Creates or updates the backup policy. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesCreateOrUpdate.json | +| [backupPoliciesDelete.js][backuppoliciesdelete] | Deletes the backup policy. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesDelete.json | +| [backupPoliciesGet.js][backuppoliciesget] | Gets the properties of the specified backup policy name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesGet.json | +| [backupPoliciesListByDevice.js][backuppolicieslistbydevice] | Gets all the backup policies in a device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesListByDevice.json | +| [backupSchedulesCreateOrUpdate.js][backupschedulescreateorupdate] | Creates or updates the backup schedule. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesCreateOrUpdate.json | +| [backupSchedulesDelete.js][backupschedulesdelete] | Deletes the backup schedule. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesDelete.json | +| [backupSchedulesGet.js][backupschedulesget] | Gets the properties of the specified backup schedule name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesGet.json | +| [backupSchedulesListByBackupPolicy.js][backupscheduleslistbybackuppolicy] | Gets all the backup schedules in a backup policy. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesListByBackupPolicy.json | +| [backupsClone.js][backupsclone] | Clones the backup element as a new volume. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsClone.json | +| [backupsDelete.js][backupsdelete] | Deletes the backup. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsDelete.json | +| [backupsListByDevice.js][backupslistbydevice] | Retrieves all the backups in a device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsListByDevice.json | +| [backupsRestore.js][backupsrestore] | Restores the backup on the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsRestore.json | +| [bandwidthSettingsCreateOrUpdate.js][bandwidthsettingscreateorupdate] | Creates or updates the bandwidth setting x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsCreateOrUpdate.json | +| [bandwidthSettingsDelete.js][bandwidthsettingsdelete] | Deletes the bandwidth setting x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsDelete.json | +| [bandwidthSettingsGet.js][bandwidthsettingsget] | Returns the properties of the specified bandwidth setting name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsGet.json | +| [bandwidthSettingsListByManager.js][bandwidthsettingslistbymanager] | Retrieves all the bandwidth setting in a manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsListByManager.json | +| [cloudAppliancesListSupportedConfigurations.js][cloudapplianceslistsupportedconfigurations] | Lists supported cloud appliance models and supported configurations. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/CloudAppliancesListSupportedConfigurations.json | +| [cloudAppliancesProvision.js][cloudappliancesprovision] | Provisions cloud appliance. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/CloudAppliancesProvision.json | +| [deviceSettingsCreateOrUpdateAlertSettings.js][devicesettingscreateorupdatealertsettings] | Creates or updates the alert settings of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsCreateOrUpdateAlertSettings.json | +| [deviceSettingsCreateOrUpdateTimeSettings.js][devicesettingscreateorupdatetimesettings] | Creates or updates the time settings of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsCreateOrUpdateTimeSettings.json | +| [deviceSettingsGetAlertSettings.js][devicesettingsgetalertsettings] | Gets the alert settings of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetAlertSettings.json | +| [deviceSettingsGetNetworkSettings.js][devicesettingsgetnetworksettings] | Gets the network settings of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetNetworkSettings.json | +| [deviceSettingsGetSecuritySettings.js][devicesettingsgetsecuritysettings] | Returns the Security properties of the specified device name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetSecuritySettings.json | +| [deviceSettingsGetTimeSettings.js][devicesettingsgettimesettings] | Gets the time settings of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetTimeSettings.json | +| [deviceSettingsSyncRemotemanagementCertificate.js][devicesettingssyncremotemanagementcertificate] | sync Remote management Certificate between appliance and Service x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsSyncRemotemanagementCertificate.json | +| [deviceSettingsUpdateNetworkSettings.js][devicesettingsupdatenetworksettings] | Updates the network settings on the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsUpdateNetworkSettings.json | +| [deviceSettingsUpdateSecuritySettings.js][devicesettingsupdatesecuritysettings] | Patch Security properties of the specified device name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsUpdateSecuritySettings.json | +| [devicesAuthorizeForServiceEncryptionKeyRollover.js][devicesauthorizeforserviceencryptionkeyrollover] | Authorizes the specified device for service data encryption key rollover. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesAuthorizeForServiceEncryptionKeyRollover.json | +| [devicesConfigure.js][devicesconfigure] | Complete minimal setup before using the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesConfigure.json | +| [devicesDeactivate.js][devicesdeactivate] | Deactivates the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesDeactivate.json | +| [devicesDelete.js][devicesdelete] | Deletes the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesDelete.json | +| [devicesFailover.js][devicesfailover] | Failovers a set of volume containers from a specified source device to a target device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesFailover.json | +| [devicesGet.js][devicesget] | Returns the properties of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesGet.json | +| [devicesGetUpdateSummary.js][devicesgetupdatesummary] | Returns the update summary of the specified device name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesGetUpdateSummary.json | +| [devicesInstallUpdates.js][devicesinstallupdates] | Downloads and installs the updates on the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesInstallUpdates.json | +| [devicesListByManager.js][deviceslistbymanager] | Returns the list of devices for the specified manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListByManager.json | +| [devicesListFailoverSets.js][deviceslistfailoversets] | Returns all failover sets for a given device and their eligibility for participating in a failover. A failover set refers to a set of volume containers that need to be failed-over as a single unit to maintain data integrity. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListFailoverSets.json | +| [devicesListFailoverTargets.js][deviceslistfailovertargets] | Given a list of volume containers to be failed over from a source device, this method returns the eligibility result, as a failover target, for all devices under that resource. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListFailoverTargets.json | +| [devicesListMetricDefinition.js][deviceslistmetricdefinition] | Gets the metric definitions for the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListMetricDefinition.json | +| [devicesListMetrics.js][deviceslistmetrics] | Gets the metrics for the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListMetrics.json | +| [devicesScanForUpdates.js][devicesscanforupdates] | Scans for updates on the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesScanForUpdates.json | +| [devicesUpdate.js][devicesupdate] | Patches the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesUpdate.json | +| [hardwareComponentGroupsChangeControllerPowerState.js][hardwarecomponentgroupschangecontrollerpowerstate] | Changes the power state of the controller. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/HardwareComponentGroupsChangeControllerPowerState.json | +| [hardwareComponentGroupsListByDevice.js][hardwarecomponentgroupslistbydevice] | Lists the hardware component groups at device-level. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/HardwareComponentGroupsListByDevice.json | +| [jobsCancel.js][jobscancel] | Cancels a job on the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsCancel.json | +| [jobsGet.js][jobsget] | Gets the details of the specified job name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsGet.json | +| [jobsListByDevice.js][jobslistbydevice] | Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs is returned. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsListByDevice.json | +| [jobsListByManager.js][jobslistbymanager] | Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of jobs is returned. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsListByManager.json | +| [managersCreateExtendedInfo.js][managerscreateextendedinfo] | Creates the extended info of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersCreateExtendedInfo.json | +| [managersCreateOrUpdate.js][managerscreateorupdate] | Creates or updates the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersCreateOrUpdate.json | +| [managersDelete.js][managersdelete] | Deletes the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersDelete.json | +| [managersDeleteExtendedInfo.js][managersdeleteextendedinfo] | Deletes the extended info of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersDeleteExtendedInfo.json | +| [managersGet.js][managersget] | Returns the properties of the specified manager name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGet.json | +| [managersGetActivationKey.js][managersgetactivationkey] | Returns the activation key of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetActivationKey.json | +| [managersGetDevicePublicEncryptionKey.js][managersgetdevicepublicencryptionkey] | Returns the public encryption key of the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetDevicePublicEncryptionKey.json | +| [managersGetEncryptionSettings.js][managersgetencryptionsettings] | Returns the encryption settings of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetEncryptionSettings.json | +| [managersGetExtendedInfo.js][managersgetextendedinfo] | Returns the extended information of the specified manager name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetExtendedInfo.json | +| [managersGetPublicEncryptionKey.js][managersgetpublicencryptionkey] | Returns the symmetric encrypted public encryption key of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetPublicEncryptionKey.json | +| [managersList.js][managerslist] | Retrieves all the managers in a subscription. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersList.json | +| [managersListByResourceGroup.js][managerslistbyresourcegroup] | Retrieves all the managers in a resource group. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListByResourceGroup.json | +| [managersListFeatureSupportStatus.js][managerslistfeaturesupportstatus] | Lists the features and their support status x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListFeatureSupportStatus.json | +| [managersListMetricDefinition.js][managerslistmetricdefinition] | Gets the metric definitions for the specified manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListMetricDefinition.json | +| [managersListMetrics.js][managerslistmetrics] | Gets the metrics for the specified manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListMetrics.json | +| [managersRegenerateActivationKey.js][managersregenerateactivationkey] | Re-generates and returns the activation key of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersRegenerateActivationKey.json | +| [managersUpdate.js][managersupdate] | Updates the StorSimple Manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersUpdate.json | +| [managersUpdateExtendedInfo.js][managersupdateextendedinfo] | Updates the extended info of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersUpdateExtendedInfo.json | +| [operationsList.js][operationslist] | Lists all of the available REST API operations of the Microsoft.StorSimple provider x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/OperationsList.json | +| [storageAccountCredentialsCreateOrUpdate.js][storageaccountcredentialscreateorupdate] | Creates or updates the storage account credential. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsCreateOrUpdate.json | +| [storageAccountCredentialsDelete.js][storageaccountcredentialsdelete] | Deletes the storage account credential. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsDelete.json | +| [storageAccountCredentialsGet.js][storageaccountcredentialsget] | Gets the properties of the specified storage account credential name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsGet.json | +| [storageAccountCredentialsListByManager.js][storageaccountcredentialslistbymanager] | Gets all the storage account credentials in a manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsListByManager.json | +| [volumeContainersCreateOrUpdate.js][volumecontainerscreateorupdate] | Creates or updates the volume container. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersCreateOrUpdate.json | +| [volumeContainersDelete.js][volumecontainersdelete] | Deletes the volume container. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersDelete.json | +| [volumeContainersGet.js][volumecontainersget] | Gets the properties of the specified volume container name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersGet.json | +| [volumeContainersListByDevice.js][volumecontainerslistbydevice] | Gets all the volume containers in a device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListByDevice.json | +| [volumeContainersListMetricDefinition.js][volumecontainerslistmetricdefinition] | Gets the metric definitions for the specified volume container. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListMetricDefinition.json | +| [volumeContainersListMetrics.js][volumecontainerslistmetrics] | Gets the metrics for the specified volume container. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListMetrics.json | +| [volumesCreateOrUpdate.js][volumescreateorupdate] | Creates or updates the volume. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesCreateOrUpdate.json | +| [volumesDelete.js][volumesdelete] | Deletes the volume. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesDelete.json | +| [volumesGet.js][volumesget] | Returns the properties of the specified volume name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesGet.json | +| [volumesListByDevice.js][volumeslistbydevice] | Retrieves all the volumes in a device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListByDevice.json | +| [volumesListByVolumeContainer.js][volumeslistbyvolumecontainer] | Retrieves all the volumes in a volume container. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListByVolumeContainer.json | +| [volumesListMetricDefinition.js][volumeslistmetricdefinition] | Gets the metric definitions for the specified volume. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListMetricDefinition.json | +| [volumesListMetrics.js][volumeslistmetrics] | Gets the metrics for the specified volume. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListMetrics.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node accessControlRecordsCreateOrUpdate.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node accessControlRecordsCreateOrUpdate.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accesscontrolrecordscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsCreateOrUpdate.js +[accesscontrolrecordsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsDelete.js +[accesscontrolrecordsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsGet.js +[accesscontrolrecordslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsListByManager.js +[alertsclear]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsClear.js +[alertslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsListByManager.js +[alertssendtestemail]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsSendTestEmail.js +[backuppoliciesbackupnow]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesBackupNow.js +[backuppoliciescreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesCreateOrUpdate.js +[backuppoliciesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesDelete.js +[backuppoliciesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesGet.js +[backuppolicieslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesListByDevice.js +[backupschedulescreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesCreateOrUpdate.js +[backupschedulesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesDelete.js +[backupschedulesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesGet.js +[backupscheduleslistbybackuppolicy]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesListByBackupPolicy.js +[backupsclone]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsClone.js +[backupsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsDelete.js +[backupslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsListByDevice.js +[backupsrestore]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsRestore.js +[bandwidthsettingscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsCreateOrUpdate.js +[bandwidthsettingsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsDelete.js +[bandwidthsettingsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsGet.js +[bandwidthsettingslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsListByManager.js +[cloudapplianceslistsupportedconfigurations]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/cloudAppliancesListSupportedConfigurations.js +[cloudappliancesprovision]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/cloudAppliancesProvision.js +[devicesettingscreateorupdatealertsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsCreateOrUpdateAlertSettings.js +[devicesettingscreateorupdatetimesettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsCreateOrUpdateTimeSettings.js +[devicesettingsgetalertsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetAlertSettings.js +[devicesettingsgetnetworksettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetNetworkSettings.js +[devicesettingsgetsecuritysettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetSecuritySettings.js +[devicesettingsgettimesettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetTimeSettings.js +[devicesettingssyncremotemanagementcertificate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsSyncRemotemanagementCertificate.js +[devicesettingsupdatenetworksettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsUpdateNetworkSettings.js +[devicesettingsupdatesecuritysettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsUpdateSecuritySettings.js +[devicesauthorizeforserviceencryptionkeyrollover]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesAuthorizeForServiceEncryptionKeyRollover.js +[devicesconfigure]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesConfigure.js +[devicesdeactivate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesDeactivate.js +[devicesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesDelete.js +[devicesfailover]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesFailover.js +[devicesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesGet.js +[devicesgetupdatesummary]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesGetUpdateSummary.js +[devicesinstallupdates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesInstallUpdates.js +[deviceslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListByManager.js +[deviceslistfailoversets]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListFailoverSets.js +[deviceslistfailovertargets]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListFailoverTargets.js +[deviceslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListMetricDefinition.js +[deviceslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListMetrics.js +[devicesscanforupdates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesScanForUpdates.js +[devicesupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesUpdate.js +[hardwarecomponentgroupschangecontrollerpowerstate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/hardwareComponentGroupsChangeControllerPowerState.js +[hardwarecomponentgroupslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/hardwareComponentGroupsListByDevice.js +[jobscancel]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsCancel.js +[jobsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsGet.js +[jobslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsListByDevice.js +[jobslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsListByManager.js +[managerscreateextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersCreateExtendedInfo.js +[managerscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersCreateOrUpdate.js +[managersdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersDelete.js +[managersdeleteextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersDeleteExtendedInfo.js +[managersget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGet.js +[managersgetactivationkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetActivationKey.js +[managersgetdevicepublicencryptionkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetDevicePublicEncryptionKey.js +[managersgetencryptionsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetEncryptionSettings.js +[managersgetextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetExtendedInfo.js +[managersgetpublicencryptionkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetPublicEncryptionKey.js +[managerslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersList.js +[managerslistbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListByResourceGroup.js +[managerslistfeaturesupportstatus]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListFeatureSupportStatus.js +[managerslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListMetricDefinition.js +[managerslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListMetrics.js +[managersregenerateactivationkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersRegenerateActivationKey.js +[managersupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersUpdate.js +[managersupdateextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersUpdateExtendedInfo.js +[operationslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/operationsList.js +[storageaccountcredentialscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsCreateOrUpdate.js +[storageaccountcredentialsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsDelete.js +[storageaccountcredentialsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsGet.js +[storageaccountcredentialslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsListByManager.js +[volumecontainerscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersCreateOrUpdate.js +[volumecontainersdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersDelete.js +[volumecontainersget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersGet.js +[volumecontainerslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListByDevice.js +[volumecontainerslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListMetricDefinition.js +[volumecontainerslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListMetrics.js +[volumescreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesCreateOrUpdate.js +[volumesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesDelete.js +[volumesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesGet.js +[volumeslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListByDevice.js +[volumeslistbyvolumecontainer]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListByVolumeContainer.js +[volumeslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListMetricDefinition.js +[volumeslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListMetrics.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-storsimple8000series?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple8000series/arm-storsimple8000series/README.md diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsCreateOrUpdate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsCreateOrUpdate.js new file mode 100644 index 000000000000..cca1c0f00d2b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsCreateOrUpdate.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or Updates an access control record. + * + * @summary Creates or Updates an access control record. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsCreateOrUpdate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function accessControlRecordsCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const accessControlRecordName = "ACRForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + initiatorName: "iqn.2017-06.com.contoso:ForTest", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.beginCreateOrUpdateAndWait( + accessControlRecordName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +accessControlRecordsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsDelete.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsDelete.js new file mode 100644 index 000000000000..3840d6d1814b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsDelete.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the access control record. + * + * @summary Deletes the access control record. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsDelete.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function accessControlRecordsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const accessControlRecordName = "ACRForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.beginDeleteAndWait( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsGet.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsGet.js new file mode 100644 index 000000000000..aec050e673d0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsGet.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified access control record name. + * + * @summary Returns the properties of the specified access control record name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsGet.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function accessControlRecordsGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const accessControlRecordName = "ACRForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.accessControlRecords.get( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsListByManager.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsListByManager.js new file mode 100644 index 000000000000..8cad5e160af2 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/accessControlRecordsListByManager.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the access control records in a manager. + * + * @summary Retrieves all the access control records in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsListByManager.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function accessControlRecordsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessControlRecords.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +accessControlRecordsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsClear.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsClear.js new file mode 100644 index 000000000000..4b1b45b292bf --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsClear.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clear the alerts. + * + * @summary Clear the alerts. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsClear.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function alertsClear() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + alerts: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/alerts/308b5bd2-824b-436f-840e-44bde075ef33", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.alerts.clear(resourceGroupName, managerName, parameters); + console.log(result); +} + +alertsClear().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsListByManager.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsListByManager.js new file mode 100644 index 000000000000..93262a41b9b2 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsListByManager.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the alerts in a manager. + * + * @summary Retrieves all the alerts in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsListByManager.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function alertsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "status eq 'Active' and appearedOnTime ge '2017-06-09T18:30:00Z' and appearedOnTime le '2017-06-19T18:30:00Z' and sourceType eq 'Device' and sourceName eq 'Device05ForSDKTest'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.alerts.listByManager(resourceGroupName, managerName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +alertsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsSendTestEmail.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsSendTestEmail.js new file mode 100644 index 000000000000..1939297f975b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/alertsSendTestEmail.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Sends a test alert email. + * + * @summary Sends a test alert email. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsSendTestEmail.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function alertsSendTestEmail() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + emailList: ["testemailid@contoso.com"], + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.alerts.sendTestEmail( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +alertsSendTestEmail().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesBackupNow.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesBackupNow.js new file mode 100644 index 000000000000..0d38bf6631c4 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesBackupNow.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Backup the backup policy now. + * + * @summary Backup the backup policy now. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesBackupNow.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupPoliciesBackupNow() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupType = "CloudSnapshot"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginBackupNowAndWait( + deviceName, + backupPolicyName, + backupType, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupPoliciesBackupNow().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesCreateOrUpdate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesCreateOrUpdate.js new file mode 100644 index 000000000000..5533491ff52a --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesCreateOrUpdate.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the backup policy. + * + * @summary Creates or updates the backup policy. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesCreateOrUpdate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupPoliciesCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + kind: "Series8000", + volumeIds: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/volumeContainerForSDKTest/volumes/Clonedvolume1", + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/volumeContainerForSDKTest/volumes/volume1", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginCreateOrUpdateAndWait( + deviceName, + backupPolicyName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +backupPoliciesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesDelete.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesDelete.js new file mode 100644 index 000000000000..95d0cb53a34b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesDelete.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup policy. + * + * @summary Deletes the backup policy. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesDelete.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupPoliciesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginDeleteAndWait( + deviceName, + backupPolicyName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupPoliciesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesGet.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesGet.js new file mode 100644 index 000000000000..3d208ec25074 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesGet.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified backup policy name. + * + * @summary Gets the properties of the specified backup policy name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesGet.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupPoliciesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.get( + deviceName, + backupPolicyName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupPoliciesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesListByDevice.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesListByDevice.js new file mode 100644 index 000000000000..971ad238608e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupPoliciesListByDevice.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the backup policies in a device. + * + * @summary Gets all the backup policies in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesListByDevice.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupPoliciesListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backupPolicies.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupPoliciesListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesCreateOrUpdate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesCreateOrUpdate.js new file mode 100644 index 000000000000..adbc9a43eec1 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesCreateOrUpdate.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the backup schedule. + * + * @summary Creates or updates the backup schedule. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesCreateOrUpdate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupSchedulesCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupScheduleName = "schedule2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + backupType: "CloudSnapshot", + kind: "Series8000", + retentionCount: 1, + scheduleRecurrence: { + recurrenceType: "Weekly", + recurrenceValue: 1, + weeklyDaysList: ["Friday", "Thursday", "Monday"], + }, + scheduleStatus: "Enabled", + startTime: new Date("2017-06-24T01:00:00Z"), + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.backupSchedules.beginCreateOrUpdateAndWait( + deviceName, + backupPolicyName, + backupScheduleName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +backupSchedulesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesDelete.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesDelete.js new file mode 100644 index 000000000000..1444da2d422f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesDelete.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup schedule. + * + * @summary Deletes the backup schedule. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesDelete.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupSchedulesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupScheduleName = "schedule1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.backupSchedules.beginDeleteAndWait( + deviceName, + backupPolicyName, + backupScheduleName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupSchedulesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesGet.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesGet.js new file mode 100644 index 000000000000..493adee29975 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesGet.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified backup schedule name. + * + * @summary Gets the properties of the specified backup schedule name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesGet.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupSchedulesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupScheduleName = "schedule2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.backupSchedules.get( + deviceName, + backupPolicyName, + backupScheduleName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupSchedulesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesListByBackupPolicy.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesListByBackupPolicy.js new file mode 100644 index 000000000000..a7b8dfc8fffa --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupSchedulesListByBackupPolicy.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the backup schedules in a backup policy. + * + * @summary Gets all the backup schedules in a backup policy. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesListByBackupPolicy.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupSchedulesListByBackupPolicy() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backupSchedules.listByBackupPolicy( + deviceName, + backupPolicyName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupSchedulesListByBackupPolicy().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsClone.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsClone.js new file mode 100644 index 000000000000..06ae6debf7d3 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsClone.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clones the backup element as a new volume. + * + * @summary Clones the backup element as a new volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsClone.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupsClone() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupName = "880e1774-94a8-4f3e-85e6-a61e6b94a8b7"; + const backupElementName = "7e115577-4a3b-4921-bfd4-ee5a1b9bcbb5_0000000000000000"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + backupElement: { + elementId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/backups/880e1774-94a8-4f3e-85e6-a61e6b94a8b7/elements/7e115577-4a3b-4921-bfd4-ee5a1b9bcbb5_0000000000000000", + elementName: "7e115577-4a3b-4921-bfd4-ee5a1b9bcbb5_0000000000000000", + elementType: "managers/devices/backups/elements", + sizeInBytes: 10737418240, + volumeContainerId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/volumeContainerForSDKTest", + volumeName: "Clonedvolume1", + volumeType: "Tiered", + }, + targetAccessControlRecordIds: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/accessControlRecords/ACR2", + ], + targetDeviceId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest", + targetVolumeName: "ClonedClonedvolume1", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.backups.beginCloneAndWait( + deviceName, + backupName, + backupElementName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +backupsClone().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsDelete.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsDelete.js new file mode 100644 index 000000000000..aead042a7f84 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsDelete.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup. + * + * @summary Deletes the backup. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsDelete.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupName = "880e1774-94a8-4f3e-85e6-a61e6b94a8b7"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.backups.beginDeleteAndWait( + deviceName, + backupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsListByDevice.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsListByDevice.js new file mode 100644 index 000000000000..0c5eab21782f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsListByDevice.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backups in a device. + * + * @summary Retrieves all the backups in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsListByDevice.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupsListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "createdTime ge '2017-06-22T18:30:00Z' and backupPolicyId eq '/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/backupPolicies/BkUpPolicy01ForSDKTest'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsRestore.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsRestore.js new file mode 100644 index 000000000000..b3319d9fdb65 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/backupsRestore.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Restores the backup on the device. + * + * @summary Restores the backup on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsRestore.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function backupsRestore() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupName = "880e1774-94a8-4f3e-85e6-a61e6b94a8b7"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.backups.beginRestoreAndWait( + deviceName, + backupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupsRestore().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsCreateOrUpdate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsCreateOrUpdate.js new file mode 100644 index 000000000000..ba102e6d8436 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsCreateOrUpdate.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the bandwidth setting + * + * @summary Creates or updates the bandwidth setting + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsCreateOrUpdate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function bandwidthSettingsCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const bandwidthSettingName = "BWSForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + schedules: [ + { + days: ["Saturday", "Sunday"], + rateInMbps: 10, + start: { hours: 10, minutes: 0, seconds: 0 }, + stop: { hours: 20, minutes: 0, seconds: 0 }, + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.bandwidthSettings.beginCreateOrUpdateAndWait( + bandwidthSettingName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +bandwidthSettingsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsDelete.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsDelete.js new file mode 100644 index 000000000000..182139ab0892 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsDelete.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the bandwidth setting + * + * @summary Deletes the bandwidth setting + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsDelete.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function bandwidthSettingsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const bandwidthSettingName = "BWSForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.bandwidthSettings.beginDeleteAndWait( + bandwidthSettingName, + resourceGroupName, + managerName + ); + console.log(result); +} + +bandwidthSettingsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsGet.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsGet.js new file mode 100644 index 000000000000..59961089457c --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsGet.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified bandwidth setting name. + * + * @summary Returns the properties of the specified bandwidth setting name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsGet.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function bandwidthSettingsGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const bandwidthSettingName = "bandwidthSetting1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.bandwidthSettings.get( + bandwidthSettingName, + resourceGroupName, + managerName + ); + console.log(result); +} + +bandwidthSettingsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsListByManager.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsListByManager.js new file mode 100644 index 000000000000..cde29dd17bb5 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/bandwidthSettingsListByManager.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the bandwidth setting in a manager. + * + * @summary Retrieves all the bandwidth setting in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsListByManager.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function bandwidthSettingsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bandwidthSettings.listByManager(resourceGroupName, managerName)) { + resArray.push(item); + } + console.log(resArray); +} + +bandwidthSettingsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/cloudAppliancesListSupportedConfigurations.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/cloudAppliancesListSupportedConfigurations.js new file mode 100644 index 000000000000..2cd6bc7eafbd --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/cloudAppliancesListSupportedConfigurations.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists supported cloud appliance models and supported configurations. + * + * @summary Lists supported cloud appliance models and supported configurations. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/CloudAppliancesListSupportedConfigurations.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function cloudAppliancesListSupportedConfigurations() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudAppliances.listSupportedConfigurations( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +cloudAppliancesListSupportedConfigurations().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/cloudAppliancesProvision.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/cloudAppliancesProvision.js new file mode 100644 index 000000000000..afe0746a97ba --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/cloudAppliancesProvision.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Provisions cloud appliance. + * + * @summary Provisions cloud appliance. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/CloudAppliancesProvision.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function cloudAppliancesProvision() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + name: "sca07forsdktest", + modelNumber: "8020", + vnetRegion: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.cloudAppliances.beginProvisionAndWait( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +cloudAppliancesProvision().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsCreateOrUpdateAlertSettings.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsCreateOrUpdateAlertSettings.js new file mode 100644 index 000000000000..39c3bbe9fc81 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsCreateOrUpdateAlertSettings.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the alert settings of the specified device. + * + * @summary Creates or updates the alert settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsCreateOrUpdateAlertSettings.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deviceSettingsCreateOrUpdateAlertSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + additionalRecipientEmailList: [], + alertNotificationCulture: "en-US", + emailNotification: "Enabled", + notificationToServiceOwners: "Enabled", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.deviceSettings.beginCreateOrUpdateAlertSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsCreateOrUpdateAlertSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsCreateOrUpdateTimeSettings.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsCreateOrUpdateTimeSettings.js new file mode 100644 index 000000000000..9fa05b558e6b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsCreateOrUpdateTimeSettings.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the time settings of the specified device. + * + * @summary Creates or updates the time settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsCreateOrUpdateTimeSettings.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deviceSettingsCreateOrUpdateTimeSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + primaryTimeServer: "time.windows.com", + secondaryTimeServer: ["8.8.8.8"], + timeZone: "Pacific Standard Time", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.deviceSettings.beginCreateOrUpdateTimeSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsCreateOrUpdateTimeSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetAlertSettings.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetAlertSettings.js new file mode 100644 index 000000000000..5a3cc09d15bd --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetAlertSettings.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the alert settings of the specified device. + * + * @summary Gets the alert settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetAlertSettings.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deviceSettingsGetAlertSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.deviceSettings.getAlertSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetAlertSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetNetworkSettings.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetNetworkSettings.js new file mode 100644 index 000000000000..386bba7e19ce --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetNetworkSettings.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the network settings of the specified device. + * + * @summary Gets the network settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetNetworkSettings.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deviceSettingsGetNetworkSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.deviceSettings.getNetworkSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetNetworkSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetSecuritySettings.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetSecuritySettings.js new file mode 100644 index 000000000000..6ba7ae1e9557 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetSecuritySettings.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the Security properties of the specified device name. + * + * @summary Returns the Security properties of the specified device name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetSecuritySettings.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deviceSettingsGetSecuritySettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.deviceSettings.getSecuritySettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetSecuritySettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetTimeSettings.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetTimeSettings.js new file mode 100644 index 000000000000..d99fcefa41b7 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsGetTimeSettings.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the time settings of the specified device. + * + * @summary Gets the time settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetTimeSettings.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deviceSettingsGetTimeSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.deviceSettings.getTimeSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetTimeSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsSyncRemotemanagementCertificate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsSyncRemotemanagementCertificate.js new file mode 100644 index 000000000000..97ee3981c956 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsSyncRemotemanagementCertificate.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to sync Remote management Certificate between appliance and Service + * + * @summary sync Remote management Certificate between appliance and Service + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsSyncRemotemanagementCertificate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deviceSettingsSyncRemotemanagementCertificate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.deviceSettings.beginSyncRemotemanagementCertificateAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsSyncRemotemanagementCertificate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsUpdateNetworkSettings.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsUpdateNetworkSettings.js new file mode 100644 index 000000000000..f17c61c545e4 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsUpdateNetworkSettings.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the network settings on the specified device. + * + * @summary Updates the network settings on the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsUpdateNetworkSettings.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deviceSettingsUpdateNetworkSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + dnsSettings: { + primaryDnsServer: "10.171.65.60", + secondaryDnsServers: ["8.8.8.8"], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.deviceSettings.beginUpdateNetworkSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsUpdateNetworkSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsUpdateSecuritySettings.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsUpdateSecuritySettings.js new file mode 100644 index 000000000000..2876bd43a56e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/deviceSettingsUpdateSecuritySettings.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Patch Security properties of the specified device name. + * + * @summary Patch Security properties of the specified device name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsUpdateSecuritySettings.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deviceSettingsUpdateSecuritySettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + chapSettings: { + initiatorSecret: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "V/uVfWk5OcXfMC0HvUV89o9+cmF636jBnqhFM1pD/zHhmh8Z1KB5/LhVV3T53uGjIlKL3wjhwg+9NIQrIbYuKhl/r8jSftSSH+WqUnQHTRDWazjPAeMu6ozrL5RYzP1h5mgw7XtidZPaaV9ae/uF1KQPkK6TIARaOTdr8I/BLWUg7WdDrfARNYHnW6ezXek1M9Qhv1sL9fZY+JrGB58LF6D2aC2Xjed4K4Jk6v2T1ieneNV27uIdnt21TajuM7w90UlRiVZJZtq/KdEUfqI28C7VoUdcXluAwzR95Ho8hmyIJDqeW3/Wxymdjv+Rctwqtmcka9i2G85Hj8SVV3g4kA==", + }, + initiatorUser: "test-initiator-user", + targetSecret: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "OTR4uwVpy+pf0zthnCIAUXurC8NdSh8RpRG5GWL9TSv4WtkVmpeU/U2A4vjkrchfQOzI1x+uooWikWW9txwwQOM+/N3NG44+/dlHoaEe7AxjmItCKhNj8K2RM6D1mb45wicbF/M4uanuXnGXuT+JmZ+1Lcy2k1GXsk67ejplz2K08h37B+oIW85qMUHLdKuuQlAA/fFS+q6qMti3j2Q8Fr+Sh4U76/2AZVkKRtFeqPB1QhC12dFx6TFoZJkMFzdQz4WNvWVelIK2McKNnOiH0/Z5lAXC7164uzReAoTEfqoNU7qqqRrHhsdwWPu6jbeUn8BQnr7A/X6NWvgeax+HGA==", + }, + targetUser: "test-target-user", + }, + deviceAdminPassword: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: "", + }, + remoteManagementSettings: { remoteManagementMode: "HttpsAndHttpEnabled" }, + snapshotPassword: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: "", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.deviceSettings.beginUpdateSecuritySettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsUpdateSecuritySettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesAuthorizeForServiceEncryptionKeyRollover.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesAuthorizeForServiceEncryptionKeyRollover.js new file mode 100644 index 000000000000..2619257a2180 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesAuthorizeForServiceEncryptionKeyRollover.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Authorizes the specified device for service data encryption key rollover. + * + * @summary Authorizes the specified device for service data encryption key rollover. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesAuthorizeForServiceEncryptionKeyRollover.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesAuthorizeForServiceEncryptionKeyRollover() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.devices.authorizeForServiceEncryptionKeyRollover( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesAuthorizeForServiceEncryptionKeyRollover().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesConfigure.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesConfigure.js new file mode 100644 index 000000000000..0d3aa59432ce --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesConfigure.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Complete minimal setup before using the device. + * + * @summary Complete minimal setup before using the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesConfigure.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesConfigure() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + currentDeviceName: "Device001ForSDKTest", + friendlyName: "Device001ForSDKTest", + networkInterfaceData0Settings: { + controllerOneIp: "10.168.220.228", + controllerZeroIp: "10.168.220.227", + }, + timeZone: "Pacific Standard Time", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.devices.beginConfigureAndWait( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +devicesConfigure().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesDeactivate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesDeactivate.js new file mode 100644 index 000000000000..59564dd5d25c --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesDeactivate.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deactivates the device. + * + * @summary Deactivates the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesDeactivate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesDeactivate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.devices.beginDeactivateAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDeactivate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesDelete.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesDelete.js new file mode 100644 index 000000000000..2b61bf8e6700 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesDelete.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the device. + * + * @summary Deletes the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesDelete.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.devices.beginDeleteAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesFailover.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesFailover.js new file mode 100644 index 000000000000..d83e1491d43a --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesFailover.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Failovers a set of volume containers from a specified source device to a target device. + * + * @summary Failovers a set of volume containers from a specified source device to a target device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesFailover.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesFailover() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const sourceDeviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + targetDeviceId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/jemdeviceforsdk", + volumeContainers: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/vcforsdktest", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.devices.beginFailoverAndWait( + sourceDeviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +devicesFailover().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesGet.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesGet.js new file mode 100644 index 000000000000..e9abc3e71bba --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesGet.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified device. + * + * @summary Returns the properties of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesGet.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const expand = "details"; + const options = { expand: expand }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.devices.get(deviceName, resourceGroupName, managerName, options); + console.log(result); +} + +devicesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesGetUpdateSummary.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesGetUpdateSummary.js new file mode 100644 index 000000000000..560e6cec6a95 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesGetUpdateSummary.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the update summary of the specified device name. + * + * @summary Returns the update summary of the specified device name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesGetUpdateSummary.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesGetUpdateSummary() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.devices.getUpdateSummary(deviceName, resourceGroupName, managerName); + console.log(result); +} + +devicesGetUpdateSummary().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesInstallUpdates.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesInstallUpdates.js new file mode 100644 index 000000000000..9aa97ed17876 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesInstallUpdates.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Downloads and installs the updates on the device. + * + * @summary Downloads and installs the updates on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesInstallUpdates.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesInstallUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.devices.beginInstallUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesInstallUpdates().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListByManager.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListByManager.js new file mode 100644 index 000000000000..415f5fe3f783 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListByManager.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the list of devices for the specified manager. + * + * @summary Returns the list of devices for the specified manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListByManager.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listByManager(resourceGroupName, managerName)) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListFailoverSets.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListFailoverSets.js new file mode 100644 index 000000000000..2bfa5dc91649 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListFailoverSets.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns all failover sets for a given device and their eligibility for participating in a failover. A failover set refers to a set of volume containers that need to be failed-over as a single unit to maintain data integrity. + * + * @summary Returns all failover sets for a given device and their eligibility for participating in a failover. A failover set refers to a set of volume containers that need to be failed-over as a single unit to maintain data integrity. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListFailoverSets.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesListFailoverSets() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listFailoverSets( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListFailoverSets().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListFailoverTargets.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListFailoverTargets.js new file mode 100644 index 000000000000..a5367c13c37f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListFailoverTargets.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Given a list of volume containers to be failed over from a source device, this method returns the eligibility result, as a failover target, for all devices under that resource. + * + * @summary Given a list of volume containers to be failed over from a source device, this method returns the eligibility result, as a failover target, for all devices under that resource. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListFailoverTargets.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesListFailoverTargets() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const sourceDeviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + volumeContainers: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/vcforsdktest", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listFailoverTargets( + sourceDeviceName, + resourceGroupName, + managerName, + parameters + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListFailoverTargets().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListMetricDefinition.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListMetricDefinition.js new file mode 100644 index 000000000000..d14aa0b720ed --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListMetricDefinition.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified device. + * + * @summary Gets the metric definitions for the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListMetricDefinition.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listMetricDefinition( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListMetrics.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListMetrics.js new file mode 100644 index 000000000000..3d8f887d48b0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesListMetrics.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified device. + * + * @summary Gets the metrics for the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListMetrics.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'PrimaryStorageTieredUsed' and timeGrain eq 'PT1H' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.devices.listMetrics( + deviceName, + resourceGroupName, + managerName, + filter + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesScanForUpdates.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesScanForUpdates.js new file mode 100644 index 000000000000..291c8ab5b3d1 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesScanForUpdates.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Scans for updates on the device. + * + * @summary Scans for updates on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesScanForUpdates.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesScanForUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.devices.beginScanForUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesScanForUpdates().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesUpdate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesUpdate.js new file mode 100644 index 000000000000..a667ab8b5cdd --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/devicesUpdate.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Patches the device. + * + * @summary Patches the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesUpdate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function devicesUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + deviceDescription: "updated device description", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.devices.update( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +devicesUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/hardwareComponentGroupsChangeControllerPowerState.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/hardwareComponentGroupsChangeControllerPowerState.js new file mode 100644 index 000000000000..151da7a5debc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/hardwareComponentGroupsChangeControllerPowerState.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Changes the power state of the controller. + * + * @summary Changes the power state of the controller. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/HardwareComponentGroupsChangeControllerPowerState.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function hardwareComponentGroupsChangeControllerPowerState() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const hardwareComponentGroupName = "Controller0Components"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + action: "Start", + activeController: "Controller0", + controller0State: "Ok", + controller1State: "NotPresent", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.hardwareComponentGroups.beginChangeControllerPowerStateAndWait( + deviceName, + hardwareComponentGroupName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +hardwareComponentGroupsChangeControllerPowerState().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/hardwareComponentGroupsListByDevice.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/hardwareComponentGroupsListByDevice.js new file mode 100644 index 000000000000..f00f12d483bc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/hardwareComponentGroupsListByDevice.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists the hardware component groups at device-level. + * + * @summary Lists the hardware component groups at device-level. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/HardwareComponentGroupsListByDevice.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function hardwareComponentGroupsListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hardwareComponentGroups.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +hardwareComponentGroupsListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsCancel.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsCancel.js new file mode 100644 index 000000000000..221e852c2a3a --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsCancel.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Cancels a job on the device. + * + * @summary Cancels a job on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsCancel.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function jobsCancel() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const jobName = "993db21d-101b-41af-9e12-f593d78b99e9"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.jobs.beginCancelAndWait( + deviceName, + jobName, + resourceGroupName, + managerName + ); + console.log(result); +} + +jobsCancel().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsGet.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsGet.js new file mode 100644 index 000000000000..1d92963fb2c1 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsGet.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of the specified job name. + * + * @summary Gets the details of the specified job name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsGet.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function jobsGet() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const deviceName = "sca07forsdktest"; + const jobName = "70a29339-de6d-48e8-b24f-e25ee6769a00"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.jobs.get(deviceName, jobName, resourceGroupName, managerName); + console.log(result); +} + +jobsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsListByDevice.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsListByDevice.js new file mode 100644 index 000000000000..5326420045b3 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsListByDevice.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs is returned. + * + * @summary Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs is returned. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsListByDevice.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function jobsListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = "jobType eq 'ManualBackup'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.jobs.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsListByManager.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsListByManager.js new file mode 100644 index 000000000000..cd01812ef574 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/jobsListByManager.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of jobs is returned. + * + * @summary Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of jobs is returned. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsListByManager.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function jobsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = "jobType eq 'FailoverVolumeContainers'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.jobs.listByManager(resourceGroupName, managerName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersCreateExtendedInfo.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersCreateExtendedInfo.js new file mode 100644 index 000000000000..edd2467a0796 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersCreateExtendedInfo.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates the extended info of the manager. + * + * @summary Creates the extended info of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersCreateExtendedInfo.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersCreateExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters = { + algorithm: "None", + integrityKey: "BIl+RHqO8PZ6DRvuXTTK7g==", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.createExtendedInfo( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +managersCreateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersCreateOrUpdate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersCreateOrUpdate.js new file mode 100644 index 000000000000..1a29b2d22dd7 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersCreateOrUpdate.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the manager. + * + * @summary Creates or updates the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersCreateOrUpdate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters = { + cisIntrinsicSettings: { type: "GardaV1" }, + location: "westus", + sku: { name: "Standard" }, + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.createOrUpdate(resourceGroupName, managerName, parameters); + console.log(result); +} + +managersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersDelete.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersDelete.js new file mode 100644 index 000000000000..8eca61cd8aa8 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersDelete.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the manager. + * + * @summary Deletes the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersDelete.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.delete(resourceGroupName, managerName); + console.log(result); +} + +managersDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersDeleteExtendedInfo.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersDeleteExtendedInfo.js new file mode 100644 index 000000000000..c11861d29599 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersDeleteExtendedInfo.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the extended info of the manager. + * + * @summary Deletes the extended info of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersDeleteExtendedInfo.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersDeleteExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.deleteExtendedInfo(resourceGroupName, managerName); + console.log(result); +} + +managersDeleteExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGet.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGet.js new file mode 100644 index 000000000000..b17ae746ee0e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGet.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified manager name. + * + * @summary Returns the properties of the specified manager name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGet.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.get(resourceGroupName, managerName); + console.log(result); +} + +managersGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetActivationKey.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetActivationKey.js new file mode 100644 index 000000000000..27edd81834e4 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetActivationKey.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the activation key of the manager. + * + * @summary Returns the activation key of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetActivationKey.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersGetActivationKey() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.getActivationKey(resourceGroupName, managerName); + console.log(result); +} + +managersGetActivationKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetDevicePublicEncryptionKey.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetDevicePublicEncryptionKey.js new file mode 100644 index 000000000000..f61144a2f792 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetDevicePublicEncryptionKey.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the public encryption key of the device. + * + * @summary Returns the public encryption key of the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetDevicePublicEncryptionKey.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersGetDevicePublicEncryptionKey() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const deviceName = "sca01forsdktest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.getDevicePublicEncryptionKey( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetDevicePublicEncryptionKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetEncryptionSettings.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetEncryptionSettings.js new file mode 100644 index 000000000000..f9ef85ffbbbe --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetEncryptionSettings.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the encryption settings of the manager. + * + * @summary Returns the encryption settings of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetEncryptionSettings.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersGetEncryptionSettings() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.getEncryptionSettings(resourceGroupName, managerName); + console.log(result); +} + +managersGetEncryptionSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetExtendedInfo.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetExtendedInfo.js new file mode 100644 index 000000000000..bc46cca13b6b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetExtendedInfo.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the extended information of the specified manager name. + * + * @summary Returns the extended information of the specified manager name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetExtendedInfo.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersGetExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.getExtendedInfo(resourceGroupName, managerName); + console.log(result); +} + +managersGetExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetPublicEncryptionKey.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetPublicEncryptionKey.js new file mode 100644 index 000000000000..50dfbd36ea57 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersGetPublicEncryptionKey.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the symmetric encrypted public encryption key of the manager. + * + * @summary Returns the symmetric encrypted public encryption key of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetPublicEncryptionKey.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersGetPublicEncryptionKey() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.getPublicEncryptionKey(resourceGroupName, managerName); + console.log(result); +} + +managersGetPublicEncryptionKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersList.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersList.js new file mode 100644 index 000000000000..6d11451ca79e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersList.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a subscription. + * + * @summary Retrieves all the managers in a subscription. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersList.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersList() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +managersList().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListByResourceGroup.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListByResourceGroup.js new file mode 100644 index 000000000000..b26949edc8a8 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListByResourceGroup.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a resource group. + * + * @summary Retrieves all the managers in a resource group. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListByResourceGroup.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersListByResourceGroup() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +managersListByResourceGroup().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListFeatureSupportStatus.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListFeatureSupportStatus.js new file mode 100644 index 000000000000..610bd6f0e649 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListFeatureSupportStatus.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists the features and their support status + * + * @summary Lists the features and their support status + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListFeatureSupportStatus.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersListFeatureSupportStatus() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listFeatureSupportStatus(resourceGroupName, managerName)) { + resArray.push(item); + } + console.log(resArray); +} + +managersListFeatureSupportStatus().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListMetricDefinition.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListMetricDefinition.js new file mode 100644 index 000000000000..26417ab959a0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListMetricDefinition.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified manager. + * + * @summary Gets the metric definitions for the specified manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListMetricDefinition.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listMetricDefinition(resourceGroupName, managerName)) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListMetrics.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListMetrics.js new file mode 100644 index 000000000000..594fcc0f43fb --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersListMetrics.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified manager. + * + * @summary Gets the metrics for the specified manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListMetrics.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'PrimaryStorageTieredUsed' and timeGrain eq 'PT1H' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managers.listMetrics(resourceGroupName, managerName, filter)) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersRegenerateActivationKey.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersRegenerateActivationKey.js new file mode 100644 index 000000000000..c0b0280f0f05 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersRegenerateActivationKey.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Re-generates and returns the activation key of the manager. + * + * @summary Re-generates and returns the activation key of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersRegenerateActivationKey.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersRegenerateActivationKey() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.regenerateActivationKey(resourceGroupName, managerName); + console.log(result); +} + +managersRegenerateActivationKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersUpdate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersUpdate.js new file mode 100644 index 000000000000..bf17cfd18eab --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersUpdate.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the StorSimple Manager. + * + * @summary Updates the StorSimple Manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersUpdate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters = { tags: { tagName: "ForSDKTest" } }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.update(resourceGroupName, managerName, parameters); + console.log(result); +} + +managersUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersUpdateExtendedInfo.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersUpdateExtendedInfo.js new file mode 100644 index 000000000000..f04921ed7126 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/managersUpdateExtendedInfo.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the extended info of the manager. + * + * @summary Updates the extended info of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersUpdateExtendedInfo.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function managersUpdateExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const ifMatch = "674ab9df-af56-4c5c-a5ca-2bddcf1b781a"; + const parameters = { + algorithm: "SHA256", + etag: "674ab9df-af56-4c5c-a5ca-2bddcf1b781a", + integrityKey: "BIl+RHqO8PZ6DRvuXTTK7g==", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.managers.updateExtendedInfo( + resourceGroupName, + managerName, + ifMatch, + parameters + ); + console.log(result); +} + +managersUpdateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/operationsList.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/operationsList.js new file mode 100644 index 000000000000..0b2b7b5aeea3 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/operationsList.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.StorSimple provider + * + * @summary Lists all of the available REST API operations of the Microsoft.StorSimple provider + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/OperationsList.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/package.json b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/package.json new file mode 100644 index 000000000000..f5dbc2340b31 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "azure-arm-storsimple8000series-samples-js", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/storsimple8000series/arm-storsimple8000series" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple8000series/arm-storsimple8000series", + "dependencies": { + "@azure/arm-storsimple8000series": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/sample.env b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsCreateOrUpdate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsCreateOrUpdate.js new file mode 100644 index 000000000000..2294155860b1 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsCreateOrUpdate.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the storage account credential. + * + * @summary Creates or updates the storage account credential. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsCreateOrUpdate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageAccountCredentialsCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const storageAccountCredentialName = "SACForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + accessKey: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "ATuJSkmrFk4h8r1jrZ4nd3nthLSddcguEO5QLO/NECUtTuB9kL4dNv3/jC4WOvFkeVr3x1UvfhlIeMmJBF1SMr6hR1JzD0xNU/TtQqUeXN7V3jk7I+2l67P9StuHWR6OMd3XOLwvznxOEQtEWpweDiobZU1ZiY03WafcGZFpV5j6tEoHeopoZ1J/GhPtkYmx+TqxzUN6qnir5rP3NSYiZciImP/qu8U9yUV/xpVRv39KvFc2Yr5SpKpMMRUj55XW10UnPer63M6KovF8X9Wi/fNnrZAs1Esl5XddZETGrW/e5B++VMJ6w0Q/uvPR+UBwrOU0804l0SzwdIe3qVVd0Q==", + }, + endPoint: "blob.core.windows.net", + sslStatus: "Enabled", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.beginCreateOrUpdateAndWait( + storageAccountCredentialName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +storageAccountCredentialsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsDelete.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsDelete.js new file mode 100644 index 000000000000..352726c9883e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsDelete.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the storage account credential. + * + * @summary Deletes the storage account credential. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsDelete.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageAccountCredentialsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const storageAccountCredentialName = "SACForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.beginDeleteAndWait( + storageAccountCredentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsGet.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsGet.js new file mode 100644 index 000000000000..4b2c24c4d373 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsGet.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified storage account credential name. + * + * @summary Gets the properties of the specified storage account credential name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsGet.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageAccountCredentialsGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const storageAccountCredentialName = "SACForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.storageAccountCredentials.get( + storageAccountCredentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsListByManager.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsListByManager.js new file mode 100644 index 000000000000..f10244523d3e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/storageAccountCredentialsListByManager.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the storage account credentials in a manager. + * + * @summary Gets all the storage account credentials in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsListByManager.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function storageAccountCredentialsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageAccountCredentials.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +storageAccountCredentialsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersCreateOrUpdate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersCreateOrUpdate.js new file mode 100644 index 000000000000..ffb80e51d357 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersCreateOrUpdate.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the volume container. + * + * @summary Creates or updates the volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersCreateOrUpdate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumeContainersCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + bandwidthSettingId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/bandwidthSettings/bandwidthSetting1", + encryptionKey: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "R//pyVLx/fn58ia098JiLgZB5RY7fVT+6o8a4fmsvjy+ls2UgJphMf25XVqEQCZnsp/5uxteN1M/9ArPIICdhM7M1+b/Ur7kJ0FH0ktxfk7CrPWWJLI4q20LZoduJGI56lREav1VpuLdqw5F9fRcq7zbfgPQ3B/SD0mfumNRiV+AnwbC6msfavIuWrhVDl9iSzEPE+zU06/kpsexnrS81yYT2QlVVUbvpY4F3zfH8TQPpAROTbv2pld6JO4eGOrZ5O1iOr6XCg2TY2W/jf+Ev4z5tqC9VWXE5kh65gjBfpWN0bDWXKekqEhor2crHAxZi4dybdY8Ok1MDWd1CSU8kw==", + }, + storageAccountCredentialId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/storageAccountCredentials/safortestrecording", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.volumeContainers.beginCreateOrUpdateAndWait( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +volumeContainersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersDelete.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersDelete.js new file mode 100644 index 000000000000..9604c65f02e7 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersDelete.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the volume container. + * + * @summary Deletes the volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersDelete.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumeContainersDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.volumeContainers.beginDeleteAndWait( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumeContainersDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersGet.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersGet.js new file mode 100644 index 000000000000..247ea55a4743 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersGet.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified volume container name. + * + * @summary Gets the properties of the specified volume container name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersGet.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumeContainersGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.volumeContainers.get( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumeContainersGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListByDevice.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListByDevice.js new file mode 100644 index 000000000000..aa27debd606d --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListByDevice.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the volume containers in a device. + * + * @summary Gets all the volume containers in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListByDevice.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumeContainersListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumeContainers.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumeContainersListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListMetricDefinition.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListMetricDefinition.js new file mode 100644 index 000000000000..ff9bdb6f74f6 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListMetricDefinition.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified volume container. + * + * @summary Gets the metric definitions for the specified volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListMetricDefinition.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumeContainersListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumeContainers.listMetricDefinition( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumeContainersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListMetrics.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListMetrics.js new file mode 100644 index 000000000000..3bb0e4a3629b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumeContainersListMetrics.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified volume container. + * + * @summary Gets the metrics for the specified volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListMetrics.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumeContainersListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'CloudConsumedStorage' and timeGrain eq 'PT1M' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumeContainers.listMetrics( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + filter + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumeContainersListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesCreateOrUpdate.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesCreateOrUpdate.js new file mode 100644 index 000000000000..4a9dfc2ded70 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesCreateOrUpdate.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the volume. + * + * @summary Creates or updates the volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesCreateOrUpdate.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumesCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const volumeName = "Volume1ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters = { + accessControlRecordIds: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/accessControlRecords/ACR2", + ], + monitoringStatus: "Enabled", + sizeInBytes: 5368709120, + volumeStatus: "Offline", + volumeType: "Tiered", + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.volumes.beginCreateOrUpdateAndWait( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +volumesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesDelete.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesDelete.js new file mode 100644 index 000000000000..af7b8455fa1e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesDelete.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the volume. + * + * @summary Deletes the volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesDelete.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const volumeName = "Volume1ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.volumes.beginDeleteAndWait( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesGet.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesGet.js new file mode 100644 index 000000000000..7a559a04627e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesGet.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified volume name. + * + * @summary Returns the properties of the specified volume name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesGet.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const volumeName = "Volume1ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const result = await client.volumes.get( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListByDevice.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListByDevice.js new file mode 100644 index 000000000000..9da4336ed123 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListByDevice.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the volumes in a device. + * + * @summary Retrieves all the volumes in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListByDevice.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumesListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.listByDevice(deviceName, resourceGroupName, managerName)) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListByVolumeContainer.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListByVolumeContainer.js new file mode 100644 index 000000000000..bd04a6df9257 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListByVolumeContainer.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the volumes in a volume container. + * + * @summary Retrieves all the volumes in a volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListByVolumeContainer.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumesListByVolumeContainer() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "volumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.listByVolumeContainer( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListByVolumeContainer().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListMetricDefinition.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListMetricDefinition.js new file mode 100644 index 000000000000..18499cfb5f5a --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListMetricDefinition.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified volume. + * + * @summary Gets the metric definitions for the specified volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListMetricDefinition.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumesListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const volumeName = "CloneVolForSDKTest890836587"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.listMetricDefinition( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListMetrics.js b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListMetrics.js new file mode 100644 index 000000000000..1858996f117c --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/javascript/volumesListMetrics.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified volume. + * + * @summary Gets the metrics for the specified volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListMetrics.json + */ +const { StorSimple8000SeriesManagementClient } = require("@azure/arm-storsimple8000series"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function volumesListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const volumeName = "CloneVolForSDKTest890836587"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'PrimaryStorageTieredUsed' and timeGrain eq 'PT1H' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.listMetrics( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + filter + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/README.md b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/README.md new file mode 100644 index 000000000000..56cafa3933f6 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/README.md @@ -0,0 +1,245 @@ +# client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accessControlRecordsCreateOrUpdate.ts][accesscontrolrecordscreateorupdate] | Creates or Updates an access control record. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsCreateOrUpdate.json | +| [accessControlRecordsDelete.ts][accesscontrolrecordsdelete] | Deletes the access control record. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsDelete.json | +| [accessControlRecordsGet.ts][accesscontrolrecordsget] | Returns the properties of the specified access control record name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsGet.json | +| [accessControlRecordsListByManager.ts][accesscontrolrecordslistbymanager] | Retrieves all the access control records in a manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsListByManager.json | +| [alertsClear.ts][alertsclear] | Clear the alerts. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsClear.json | +| [alertsListByManager.ts][alertslistbymanager] | Retrieves all the alerts in a manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsListByManager.json | +| [alertsSendTestEmail.ts][alertssendtestemail] | Sends a test alert email. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsSendTestEmail.json | +| [backupPoliciesBackupNow.ts][backuppoliciesbackupnow] | Backup the backup policy now. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesBackupNow.json | +| [backupPoliciesCreateOrUpdate.ts][backuppoliciescreateorupdate] | Creates or updates the backup policy. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesCreateOrUpdate.json | +| [backupPoliciesDelete.ts][backuppoliciesdelete] | Deletes the backup policy. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesDelete.json | +| [backupPoliciesGet.ts][backuppoliciesget] | Gets the properties of the specified backup policy name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesGet.json | +| [backupPoliciesListByDevice.ts][backuppolicieslistbydevice] | Gets all the backup policies in a device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesListByDevice.json | +| [backupSchedulesCreateOrUpdate.ts][backupschedulescreateorupdate] | Creates or updates the backup schedule. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesCreateOrUpdate.json | +| [backupSchedulesDelete.ts][backupschedulesdelete] | Deletes the backup schedule. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesDelete.json | +| [backupSchedulesGet.ts][backupschedulesget] | Gets the properties of the specified backup schedule name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesGet.json | +| [backupSchedulesListByBackupPolicy.ts][backupscheduleslistbybackuppolicy] | Gets all the backup schedules in a backup policy. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesListByBackupPolicy.json | +| [backupsClone.ts][backupsclone] | Clones the backup element as a new volume. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsClone.json | +| [backupsDelete.ts][backupsdelete] | Deletes the backup. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsDelete.json | +| [backupsListByDevice.ts][backupslistbydevice] | Retrieves all the backups in a device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsListByDevice.json | +| [backupsRestore.ts][backupsrestore] | Restores the backup on the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsRestore.json | +| [bandwidthSettingsCreateOrUpdate.ts][bandwidthsettingscreateorupdate] | Creates or updates the bandwidth setting x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsCreateOrUpdate.json | +| [bandwidthSettingsDelete.ts][bandwidthsettingsdelete] | Deletes the bandwidth setting x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsDelete.json | +| [bandwidthSettingsGet.ts][bandwidthsettingsget] | Returns the properties of the specified bandwidth setting name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsGet.json | +| [bandwidthSettingsListByManager.ts][bandwidthsettingslistbymanager] | Retrieves all the bandwidth setting in a manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsListByManager.json | +| [cloudAppliancesListSupportedConfigurations.ts][cloudapplianceslistsupportedconfigurations] | Lists supported cloud appliance models and supported configurations. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/CloudAppliancesListSupportedConfigurations.json | +| [cloudAppliancesProvision.ts][cloudappliancesprovision] | Provisions cloud appliance. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/CloudAppliancesProvision.json | +| [deviceSettingsCreateOrUpdateAlertSettings.ts][devicesettingscreateorupdatealertsettings] | Creates or updates the alert settings of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsCreateOrUpdateAlertSettings.json | +| [deviceSettingsCreateOrUpdateTimeSettings.ts][devicesettingscreateorupdatetimesettings] | Creates or updates the time settings of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsCreateOrUpdateTimeSettings.json | +| [deviceSettingsGetAlertSettings.ts][devicesettingsgetalertsettings] | Gets the alert settings of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetAlertSettings.json | +| [deviceSettingsGetNetworkSettings.ts][devicesettingsgetnetworksettings] | Gets the network settings of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetNetworkSettings.json | +| [deviceSettingsGetSecuritySettings.ts][devicesettingsgetsecuritysettings] | Returns the Security properties of the specified device name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetSecuritySettings.json | +| [deviceSettingsGetTimeSettings.ts][devicesettingsgettimesettings] | Gets the time settings of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetTimeSettings.json | +| [deviceSettingsSyncRemotemanagementCertificate.ts][devicesettingssyncremotemanagementcertificate] | sync Remote management Certificate between appliance and Service x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsSyncRemotemanagementCertificate.json | +| [deviceSettingsUpdateNetworkSettings.ts][devicesettingsupdatenetworksettings] | Updates the network settings on the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsUpdateNetworkSettings.json | +| [deviceSettingsUpdateSecuritySettings.ts][devicesettingsupdatesecuritysettings] | Patch Security properties of the specified device name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsUpdateSecuritySettings.json | +| [devicesAuthorizeForServiceEncryptionKeyRollover.ts][devicesauthorizeforserviceencryptionkeyrollover] | Authorizes the specified device for service data encryption key rollover. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesAuthorizeForServiceEncryptionKeyRollover.json | +| [devicesConfigure.ts][devicesconfigure] | Complete minimal setup before using the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesConfigure.json | +| [devicesDeactivate.ts][devicesdeactivate] | Deactivates the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesDeactivate.json | +| [devicesDelete.ts][devicesdelete] | Deletes the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesDelete.json | +| [devicesFailover.ts][devicesfailover] | Failovers a set of volume containers from a specified source device to a target device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesFailover.json | +| [devicesGet.ts][devicesget] | Returns the properties of the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesGet.json | +| [devicesGetUpdateSummary.ts][devicesgetupdatesummary] | Returns the update summary of the specified device name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesGetUpdateSummary.json | +| [devicesInstallUpdates.ts][devicesinstallupdates] | Downloads and installs the updates on the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesInstallUpdates.json | +| [devicesListByManager.ts][deviceslistbymanager] | Returns the list of devices for the specified manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListByManager.json | +| [devicesListFailoverSets.ts][deviceslistfailoversets] | Returns all failover sets for a given device and their eligibility for participating in a failover. A failover set refers to a set of volume containers that need to be failed-over as a single unit to maintain data integrity. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListFailoverSets.json | +| [devicesListFailoverTargets.ts][deviceslistfailovertargets] | Given a list of volume containers to be failed over from a source device, this method returns the eligibility result, as a failover target, for all devices under that resource. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListFailoverTargets.json | +| [devicesListMetricDefinition.ts][deviceslistmetricdefinition] | Gets the metric definitions for the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListMetricDefinition.json | +| [devicesListMetrics.ts][deviceslistmetrics] | Gets the metrics for the specified device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListMetrics.json | +| [devicesScanForUpdates.ts][devicesscanforupdates] | Scans for updates on the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesScanForUpdates.json | +| [devicesUpdate.ts][devicesupdate] | Patches the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesUpdate.json | +| [hardwareComponentGroupsChangeControllerPowerState.ts][hardwarecomponentgroupschangecontrollerpowerstate] | Changes the power state of the controller. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/HardwareComponentGroupsChangeControllerPowerState.json | +| [hardwareComponentGroupsListByDevice.ts][hardwarecomponentgroupslistbydevice] | Lists the hardware component groups at device-level. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/HardwareComponentGroupsListByDevice.json | +| [jobsCancel.ts][jobscancel] | Cancels a job on the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsCancel.json | +| [jobsGet.ts][jobsget] | Gets the details of the specified job name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsGet.json | +| [jobsListByDevice.ts][jobslistbydevice] | Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs is returned. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsListByDevice.json | +| [jobsListByManager.ts][jobslistbymanager] | Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of jobs is returned. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsListByManager.json | +| [managersCreateExtendedInfo.ts][managerscreateextendedinfo] | Creates the extended info of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersCreateExtendedInfo.json | +| [managersCreateOrUpdate.ts][managerscreateorupdate] | Creates or updates the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersCreateOrUpdate.json | +| [managersDelete.ts][managersdelete] | Deletes the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersDelete.json | +| [managersDeleteExtendedInfo.ts][managersdeleteextendedinfo] | Deletes the extended info of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersDeleteExtendedInfo.json | +| [managersGet.ts][managersget] | Returns the properties of the specified manager name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGet.json | +| [managersGetActivationKey.ts][managersgetactivationkey] | Returns the activation key of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetActivationKey.json | +| [managersGetDevicePublicEncryptionKey.ts][managersgetdevicepublicencryptionkey] | Returns the public encryption key of the device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetDevicePublicEncryptionKey.json | +| [managersGetEncryptionSettings.ts][managersgetencryptionsettings] | Returns the encryption settings of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetEncryptionSettings.json | +| [managersGetExtendedInfo.ts][managersgetextendedinfo] | Returns the extended information of the specified manager name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetExtendedInfo.json | +| [managersGetPublicEncryptionKey.ts][managersgetpublicencryptionkey] | Returns the symmetric encrypted public encryption key of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetPublicEncryptionKey.json | +| [managersList.ts][managerslist] | Retrieves all the managers in a subscription. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersList.json | +| [managersListByResourceGroup.ts][managerslistbyresourcegroup] | Retrieves all the managers in a resource group. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListByResourceGroup.json | +| [managersListFeatureSupportStatus.ts][managerslistfeaturesupportstatus] | Lists the features and their support status x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListFeatureSupportStatus.json | +| [managersListMetricDefinition.ts][managerslistmetricdefinition] | Gets the metric definitions for the specified manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListMetricDefinition.json | +| [managersListMetrics.ts][managerslistmetrics] | Gets the metrics for the specified manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListMetrics.json | +| [managersRegenerateActivationKey.ts][managersregenerateactivationkey] | Re-generates and returns the activation key of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersRegenerateActivationKey.json | +| [managersUpdate.ts][managersupdate] | Updates the StorSimple Manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersUpdate.json | +| [managersUpdateExtendedInfo.ts][managersupdateextendedinfo] | Updates the extended info of the manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersUpdateExtendedInfo.json | +| [operationsList.ts][operationslist] | Lists all of the available REST API operations of the Microsoft.StorSimple provider x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/OperationsList.json | +| [storageAccountCredentialsCreateOrUpdate.ts][storageaccountcredentialscreateorupdate] | Creates or updates the storage account credential. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsCreateOrUpdate.json | +| [storageAccountCredentialsDelete.ts][storageaccountcredentialsdelete] | Deletes the storage account credential. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsDelete.json | +| [storageAccountCredentialsGet.ts][storageaccountcredentialsget] | Gets the properties of the specified storage account credential name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsGet.json | +| [storageAccountCredentialsListByManager.ts][storageaccountcredentialslistbymanager] | Gets all the storage account credentials in a manager. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsListByManager.json | +| [volumeContainersCreateOrUpdate.ts][volumecontainerscreateorupdate] | Creates or updates the volume container. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersCreateOrUpdate.json | +| [volumeContainersDelete.ts][volumecontainersdelete] | Deletes the volume container. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersDelete.json | +| [volumeContainersGet.ts][volumecontainersget] | Gets the properties of the specified volume container name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersGet.json | +| [volumeContainersListByDevice.ts][volumecontainerslistbydevice] | Gets all the volume containers in a device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListByDevice.json | +| [volumeContainersListMetricDefinition.ts][volumecontainerslistmetricdefinition] | Gets the metric definitions for the specified volume container. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListMetricDefinition.json | +| [volumeContainersListMetrics.ts][volumecontainerslistmetrics] | Gets the metrics for the specified volume container. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListMetrics.json | +| [volumesCreateOrUpdate.ts][volumescreateorupdate] | Creates or updates the volume. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesCreateOrUpdate.json | +| [volumesDelete.ts][volumesdelete] | Deletes the volume. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesDelete.json | +| [volumesGet.ts][volumesget] | Returns the properties of the specified volume name. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesGet.json | +| [volumesListByDevice.ts][volumeslistbydevice] | Retrieves all the volumes in a device. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListByDevice.json | +| [volumesListByVolumeContainer.ts][volumeslistbyvolumecontainer] | Retrieves all the volumes in a volume container. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListByVolumeContainer.json | +| [volumesListMetricDefinition.ts][volumeslistmetricdefinition] | Gets the metric definitions for the specified volume. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListMetricDefinition.json | +| [volumesListMetrics.ts][volumeslistmetrics] | Gets the metrics for the specified volume. x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListMetrics.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/accessControlRecordsCreateOrUpdate.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/accessControlRecordsCreateOrUpdate.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accesscontrolrecordscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsCreateOrUpdate.ts +[accesscontrolrecordsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsDelete.ts +[accesscontrolrecordsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsGet.ts +[accesscontrolrecordslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsListByManager.ts +[alertsclear]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsClear.ts +[alertslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsListByManager.ts +[alertssendtestemail]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsSendTestEmail.ts +[backuppoliciesbackupnow]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesBackupNow.ts +[backuppoliciescreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesCreateOrUpdate.ts +[backuppoliciesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesDelete.ts +[backuppoliciesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesGet.ts +[backuppolicieslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesListByDevice.ts +[backupschedulescreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesCreateOrUpdate.ts +[backupschedulesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesDelete.ts +[backupschedulesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesGet.ts +[backupscheduleslistbybackuppolicy]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesListByBackupPolicy.ts +[backupsclone]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsClone.ts +[backupsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsDelete.ts +[backupslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsListByDevice.ts +[backupsrestore]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsRestore.ts +[bandwidthsettingscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsCreateOrUpdate.ts +[bandwidthsettingsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsDelete.ts +[bandwidthsettingsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsGet.ts +[bandwidthsettingslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsListByManager.ts +[cloudapplianceslistsupportedconfigurations]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/cloudAppliancesListSupportedConfigurations.ts +[cloudappliancesprovision]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/cloudAppliancesProvision.ts +[devicesettingscreateorupdatealertsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsCreateOrUpdateAlertSettings.ts +[devicesettingscreateorupdatetimesettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsCreateOrUpdateTimeSettings.ts +[devicesettingsgetalertsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetAlertSettings.ts +[devicesettingsgetnetworksettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetNetworkSettings.ts +[devicesettingsgetsecuritysettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetSecuritySettings.ts +[devicesettingsgettimesettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetTimeSettings.ts +[devicesettingssyncremotemanagementcertificate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsSyncRemotemanagementCertificate.ts +[devicesettingsupdatenetworksettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsUpdateNetworkSettings.ts +[devicesettingsupdatesecuritysettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsUpdateSecuritySettings.ts +[devicesauthorizeforserviceencryptionkeyrollover]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesAuthorizeForServiceEncryptionKeyRollover.ts +[devicesconfigure]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesConfigure.ts +[devicesdeactivate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesDeactivate.ts +[devicesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesDelete.ts +[devicesfailover]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesFailover.ts +[devicesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesGet.ts +[devicesgetupdatesummary]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesGetUpdateSummary.ts +[devicesinstallupdates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesInstallUpdates.ts +[deviceslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListByManager.ts +[deviceslistfailoversets]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListFailoverSets.ts +[deviceslistfailovertargets]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListFailoverTargets.ts +[deviceslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListMetricDefinition.ts +[deviceslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListMetrics.ts +[devicesscanforupdates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesScanForUpdates.ts +[devicesupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesUpdate.ts +[hardwarecomponentgroupschangecontrollerpowerstate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/hardwareComponentGroupsChangeControllerPowerState.ts +[hardwarecomponentgroupslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/hardwareComponentGroupsListByDevice.ts +[jobscancel]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsCancel.ts +[jobsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsGet.ts +[jobslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsListByDevice.ts +[jobslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsListByManager.ts +[managerscreateextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersCreateExtendedInfo.ts +[managerscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersCreateOrUpdate.ts +[managersdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersDelete.ts +[managersdeleteextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersDeleteExtendedInfo.ts +[managersget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGet.ts +[managersgetactivationkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetActivationKey.ts +[managersgetdevicepublicencryptionkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetDevicePublicEncryptionKey.ts +[managersgetencryptionsettings]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetEncryptionSettings.ts +[managersgetextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetExtendedInfo.ts +[managersgetpublicencryptionkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetPublicEncryptionKey.ts +[managerslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersList.ts +[managerslistbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListByResourceGroup.ts +[managerslistfeaturesupportstatus]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListFeatureSupportStatus.ts +[managerslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListMetricDefinition.ts +[managerslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListMetrics.ts +[managersregenerateactivationkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersRegenerateActivationKey.ts +[managersupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersUpdate.ts +[managersupdateextendedinfo]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersUpdateExtendedInfo.ts +[operationslist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/operationsList.ts +[storageaccountcredentialscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsCreateOrUpdate.ts +[storageaccountcredentialsdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsDelete.ts +[storageaccountcredentialsget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsGet.ts +[storageaccountcredentialslistbymanager]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsListByManager.ts +[volumecontainerscreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersCreateOrUpdate.ts +[volumecontainersdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersDelete.ts +[volumecontainersget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersGet.ts +[volumecontainerslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListByDevice.ts +[volumecontainerslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListMetricDefinition.ts +[volumecontainerslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListMetrics.ts +[volumescreateorupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesCreateOrUpdate.ts +[volumesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesDelete.ts +[volumesget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesGet.ts +[volumeslistbydevice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListByDevice.ts +[volumeslistbyvolumecontainer]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListByVolumeContainer.ts +[volumeslistmetricdefinition]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListMetricDefinition.ts +[volumeslistmetrics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListMetrics.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-storsimple8000series?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple8000series/arm-storsimple8000series/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/package.json b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/package.json new file mode 100644 index 000000000000..2e34119bafe0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "azure-arm-storsimple8000series-samples-ts", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/storsimple8000series/arm-storsimple8000series" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storsimple8000series/arm-storsimple8000series", + "dependencies": { + "@azure/arm-storsimple8000series": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.4.0", + "rimraf": "latest" + } +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/sample.env b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsCreateOrUpdate.ts new file mode 100644 index 000000000000..5eaa8371a19b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsCreateOrUpdate.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or Updates an access control record. + * + * @summary Creates or Updates an access control record. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsCreateOrUpdate.json + */ +import { + AccessControlRecord, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const accessControlRecordName = "ACRForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: AccessControlRecord = { + initiatorName: "iqn.2017-06.com.contoso:ForTest" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.accessControlRecords.beginCreateOrUpdateAndWait( + accessControlRecordName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +accessControlRecordsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsDelete.ts new file mode 100644 index 000000000000..6e062016bcd8 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsDelete.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the access control record. + * + * @summary Deletes the access control record. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const accessControlRecordName = "ACRForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.accessControlRecords.beginDeleteAndWait( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsGet.ts new file mode 100644 index 000000000000..5c529001e905 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsGet.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified access control record name. + * + * @summary Returns the properties of the specified access control record name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const accessControlRecordName = "ACRForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.accessControlRecords.get( + accessControlRecordName, + resourceGroupName, + managerName + ); + console.log(result); +} + +accessControlRecordsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsListByManager.ts new file mode 100644 index 000000000000..85187728fcc9 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/accessControlRecordsListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the access control records in a manager. + * + * @summary Retrieves all the access control records in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AccessControlRecordsListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function accessControlRecordsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.accessControlRecords.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +accessControlRecordsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsClear.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsClear.ts new file mode 100644 index 000000000000..10d8df45bb1f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsClear.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clear the alerts. + * + * @summary Clear the alerts. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsClear.json + */ +import { + ClearAlertRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsClear() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: ClearAlertRequest = { + alerts: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/alerts/308b5bd2-824b-436f-840e-44bde075ef33" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.alerts.clear( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +alertsClear().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsListByManager.ts new file mode 100644 index 000000000000..c62418cf7a6b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsListByManager.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the alerts in a manager. + * + * @summary Retrieves all the alerts in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "status eq 'Active' and appearedOnTime ge '2017-06-09T18:30:00Z' and appearedOnTime le '2017-06-19T18:30:00Z' and sourceType eq 'Device' and sourceName eq 'Device05ForSDKTest'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.alerts.listByManager( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +alertsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsSendTestEmail.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsSendTestEmail.ts new file mode 100644 index 000000000000..719cac5b6770 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/alertsSendTestEmail.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Sends a test alert email. + * + * @summary Sends a test alert email. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/AlertsSendTestEmail.json + */ +import { + SendTestAlertEmailRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function alertsSendTestEmail() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: SendTestAlertEmailRequest = { + emailList: ["testemailid@contoso.com"] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.alerts.sendTestEmail( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +alertsSendTestEmail().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesBackupNow.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesBackupNow.ts new file mode 100644 index 000000000000..a343b2f65982 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesBackupNow.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Backup the backup policy now. + * + * @summary Backup the backup policy now. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesBackupNow.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupPoliciesBackupNow() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupType = "CloudSnapshot"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupPolicies.beginBackupNowAndWait( + deviceName, + backupPolicyName, + backupType, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupPoliciesBackupNow().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesCreateOrUpdate.ts new file mode 100644 index 000000000000..efb9b1ee65ba --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesCreateOrUpdate.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the backup policy. + * + * @summary Creates or updates the backup policy. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesCreateOrUpdate.json + */ +import { + BackupPolicy, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupPoliciesCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: BackupPolicy = { + kind: "Series8000", + volumeIds: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/volumeContainerForSDKTest/volumes/Clonedvolume1", + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/volumeContainerForSDKTest/volumes/volume1" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupPolicies.beginCreateOrUpdateAndWait( + deviceName, + backupPolicyName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +backupPoliciesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesDelete.ts new file mode 100644 index 000000000000..58582b5d4f2d --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesDelete.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup policy. + * + * @summary Deletes the backup policy. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupPoliciesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupPolicies.beginDeleteAndWait( + deviceName, + backupPolicyName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupPoliciesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesGet.ts new file mode 100644 index 000000000000..f212b9641fb8 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesGet.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified backup policy name. + * + * @summary Gets the properties of the specified backup policy name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupPoliciesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupPolicies.get( + deviceName, + backupPolicyName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupPoliciesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesListByDevice.ts new file mode 100644 index 000000000000..5154fbaf072f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupPoliciesListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the backup policies in a device. + * + * @summary Gets all the backup policies in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupPoliciesListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupPoliciesListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.backupPolicies.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupPoliciesListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesCreateOrUpdate.ts new file mode 100644 index 000000000000..66d7544a7d56 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesCreateOrUpdate.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the backup schedule. + * + * @summary Creates or updates the backup schedule. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesCreateOrUpdate.json + */ +import { + BackupSchedule, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupSchedulesCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupScheduleName = "schedule2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: BackupSchedule = { + backupType: "CloudSnapshot", + kind: "Series8000", + retentionCount: 1, + scheduleRecurrence: { + recurrenceType: "Weekly", + recurrenceValue: 1, + weeklyDaysList: ["Friday", "Thursday", "Monday"] + }, + scheduleStatus: "Enabled", + startTime: new Date("2017-06-24T01:00:00Z") + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupSchedules.beginCreateOrUpdateAndWait( + deviceName, + backupPolicyName, + backupScheduleName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +backupSchedulesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesDelete.ts new file mode 100644 index 000000000000..33cfe9876b49 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesDelete.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup schedule. + * + * @summary Deletes the backup schedule. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupSchedulesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupScheduleName = "schedule1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupSchedules.beginDeleteAndWait( + deviceName, + backupPolicyName, + backupScheduleName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupSchedulesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesGet.ts new file mode 100644 index 000000000000..3f08943422d7 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesGet.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified backup schedule name. + * + * @summary Gets the properties of the specified backup schedule name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupSchedulesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const backupScheduleName = "schedule2"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backupSchedules.get( + deviceName, + backupPolicyName, + backupScheduleName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupSchedulesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesListByBackupPolicy.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesListByBackupPolicy.ts new file mode 100644 index 000000000000..9cdbfc9c6bc0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupSchedulesListByBackupPolicy.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the backup schedules in a backup policy. + * + * @summary Gets all the backup schedules in a backup policy. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupSchedulesListByBackupPolicy.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupSchedulesListByBackupPolicy() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupPolicyName = "BkUpPolicy01ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.backupSchedules.listByBackupPolicy( + deviceName, + backupPolicyName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupSchedulesListByBackupPolicy().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsClone.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsClone.ts new file mode 100644 index 000000000000..e32d580ab8e0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsClone.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Clones the backup element as a new volume. + * + * @summary Clones the backup element as a new volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsClone.json + */ +import { + CloneRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsClone() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupName = "880e1774-94a8-4f3e-85e6-a61e6b94a8b7"; + const backupElementName = + "7e115577-4a3b-4921-bfd4-ee5a1b9bcbb5_0000000000000000"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: CloneRequest = { + backupElement: { + elementId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/backups/880e1774-94a8-4f3e-85e6-a61e6b94a8b7/elements/7e115577-4a3b-4921-bfd4-ee5a1b9bcbb5_0000000000000000", + elementName: "7e115577-4a3b-4921-bfd4-ee5a1b9bcbb5_0000000000000000", + elementType: "managers/devices/backups/elements", + sizeInBytes: 10737418240, + volumeContainerId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/volumeContainerForSDKTest", + volumeName: "Clonedvolume1", + volumeType: "Tiered" + }, + targetAccessControlRecordIds: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/accessControlRecords/ACR2" + ], + targetDeviceId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest", + targetVolumeName: "ClonedClonedvolume1" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backups.beginCloneAndWait( + deviceName, + backupName, + backupElementName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +backupsClone().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsDelete.ts new file mode 100644 index 000000000000..6445cb2de31b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsDelete.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the backup. + * + * @summary Deletes the backup. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupName = "880e1774-94a8-4f3e-85e6-a61e6b94a8b7"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backups.beginDeleteAndWait( + deviceName, + backupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsListByDevice.ts new file mode 100644 index 000000000000..96c25199f36e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsListByDevice.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the backups in a device. + * + * @summary Retrieves all the backups in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "createdTime ge '2017-06-22T18:30:00Z' and backupPolicyId eq '/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/backupPolicies/BkUpPolicy01ForSDKTest'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.backups.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsRestore.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsRestore.ts new file mode 100644 index 000000000000..adab04a58a8d --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/backupsRestore.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Restores the backup on the device. + * + * @summary Restores the backup on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BackupsRestore.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function backupsRestore() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const backupName = "880e1774-94a8-4f3e-85e6-a61e6b94a8b7"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.backups.beginRestoreAndWait( + deviceName, + backupName, + resourceGroupName, + managerName + ); + console.log(result); +} + +backupsRestore().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsCreateOrUpdate.ts new file mode 100644 index 000000000000..c48d8b5cc489 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsCreateOrUpdate.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the bandwidth setting + * + * @summary Creates or updates the bandwidth setting + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsCreateOrUpdate.json + */ +import { + BandwidthSetting, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function bandwidthSettingsCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const bandwidthSettingName = "BWSForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: BandwidthSetting = { + schedules: [ + { + days: ["Saturday", "Sunday"], + rateInMbps: 10, + start: { hours: 10, minutes: 0, seconds: 0 }, + stop: { hours: 20, minutes: 0, seconds: 0 } + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.bandwidthSettings.beginCreateOrUpdateAndWait( + bandwidthSettingName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +bandwidthSettingsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsDelete.ts new file mode 100644 index 000000000000..9b97a7450497 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsDelete.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the bandwidth setting + * + * @summary Deletes the bandwidth setting + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function bandwidthSettingsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const bandwidthSettingName = "BWSForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.bandwidthSettings.beginDeleteAndWait( + bandwidthSettingName, + resourceGroupName, + managerName + ); + console.log(result); +} + +bandwidthSettingsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsGet.ts new file mode 100644 index 000000000000..f54c8b9b40f7 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsGet.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified bandwidth setting name. + * + * @summary Returns the properties of the specified bandwidth setting name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function bandwidthSettingsGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const bandwidthSettingName = "bandwidthSetting1"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.bandwidthSettings.get( + bandwidthSettingName, + resourceGroupName, + managerName + ); + console.log(result); +} + +bandwidthSettingsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsListByManager.ts new file mode 100644 index 000000000000..32a5c590b541 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/bandwidthSettingsListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the bandwidth setting in a manager. + * + * @summary Retrieves all the bandwidth setting in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/BandwidthSettingsListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function bandwidthSettingsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.bandwidthSettings.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +bandwidthSettingsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/cloudAppliancesListSupportedConfigurations.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/cloudAppliancesListSupportedConfigurations.ts new file mode 100644 index 000000000000..1dc1f3b5310a --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/cloudAppliancesListSupportedConfigurations.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists supported cloud appliance models and supported configurations. + * + * @summary Lists supported cloud appliance models and supported configurations. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/CloudAppliancesListSupportedConfigurations.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function cloudAppliancesListSupportedConfigurations() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.cloudAppliances.listSupportedConfigurations( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +cloudAppliancesListSupportedConfigurations().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/cloudAppliancesProvision.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/cloudAppliancesProvision.ts new file mode 100644 index 000000000000..dc8fec502321 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/cloudAppliancesProvision.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Provisions cloud appliance. + * + * @summary Provisions cloud appliance. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/CloudAppliancesProvision.json + */ +import { + CloudAppliance, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function cloudAppliancesProvision() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: CloudAppliance = { + name: "sca07forsdktest", + modelNumber: "8020", + vnetRegion: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.cloudAppliances.beginProvisionAndWait( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +cloudAppliancesProvision().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsCreateOrUpdateAlertSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsCreateOrUpdateAlertSettings.ts new file mode 100644 index 000000000000..bd5348da77ae --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsCreateOrUpdateAlertSettings.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the alert settings of the specified device. + * + * @summary Creates or updates the alert settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsCreateOrUpdateAlertSettings.json + */ +import { + AlertSettings, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsCreateOrUpdateAlertSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: AlertSettings = { + additionalRecipientEmailList: [], + alertNotificationCulture: "en-US", + emailNotification: "Enabled", + notificationToServiceOwners: "Enabled" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.beginCreateOrUpdateAlertSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsCreateOrUpdateAlertSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsCreateOrUpdateTimeSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsCreateOrUpdateTimeSettings.ts new file mode 100644 index 000000000000..447124287298 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsCreateOrUpdateTimeSettings.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the time settings of the specified device. + * + * @summary Creates or updates the time settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsCreateOrUpdateTimeSettings.json + */ +import { + TimeSettings, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsCreateOrUpdateTimeSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: TimeSettings = { + primaryTimeServer: "time.windows.com", + secondaryTimeServer: ["8.8.8.8"], + timeZone: "Pacific Standard Time" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.beginCreateOrUpdateTimeSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsCreateOrUpdateTimeSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetAlertSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetAlertSettings.ts new file mode 100644 index 000000000000..d6591b496638 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetAlertSettings.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the alert settings of the specified device. + * + * @summary Gets the alert settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetAlertSettings.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsGetAlertSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.getAlertSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetAlertSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetNetworkSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetNetworkSettings.ts new file mode 100644 index 000000000000..14834531a36d --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetNetworkSettings.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the network settings of the specified device. + * + * @summary Gets the network settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetNetworkSettings.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsGetNetworkSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.getNetworkSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetNetworkSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetSecuritySettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetSecuritySettings.ts new file mode 100644 index 000000000000..81c19bde8a16 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetSecuritySettings.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the Security properties of the specified device name. + * + * @summary Returns the Security properties of the specified device name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetSecuritySettings.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsGetSecuritySettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.getSecuritySettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetSecuritySettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetTimeSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetTimeSettings.ts new file mode 100644 index 000000000000..d2e8b77be41a --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsGetTimeSettings.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the time settings of the specified device. + * + * @summary Gets the time settings of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsGetTimeSettings.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsGetTimeSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.getTimeSettings( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsGetTimeSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsSyncRemotemanagementCertificate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsSyncRemotemanagementCertificate.ts new file mode 100644 index 000000000000..473946dd09e1 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsSyncRemotemanagementCertificate.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to sync Remote management Certificate between appliance and Service + * + * @summary sync Remote management Certificate between appliance and Service + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsSyncRemotemanagementCertificate.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsSyncRemotemanagementCertificate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.beginSyncRemotemanagementCertificateAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +deviceSettingsSyncRemotemanagementCertificate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsUpdateNetworkSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsUpdateNetworkSettings.ts new file mode 100644 index 000000000000..929b48754380 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsUpdateNetworkSettings.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the network settings on the specified device. + * + * @summary Updates the network settings on the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsUpdateNetworkSettings.json + */ +import { + NetworkSettingsPatch, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsUpdateNetworkSettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: NetworkSettingsPatch = { + dnsSettings: { + primaryDnsServer: "10.171.65.60", + secondaryDnsServers: ["8.8.8.8"] + } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.beginUpdateNetworkSettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsUpdateNetworkSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsUpdateSecuritySettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsUpdateSecuritySettings.ts new file mode 100644 index 000000000000..2881a6457226 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/deviceSettingsUpdateSecuritySettings.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Patch Security properties of the specified device name. + * + * @summary Patch Security properties of the specified device name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DeviceSettingsUpdateSecuritySettings.json + */ +import { + SecuritySettingsPatch, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deviceSettingsUpdateSecuritySettings() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: SecuritySettingsPatch = { + chapSettings: { + initiatorSecret: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "V/uVfWk5OcXfMC0HvUV89o9+cmF636jBnqhFM1pD/zHhmh8Z1KB5/LhVV3T53uGjIlKL3wjhwg+9NIQrIbYuKhl/r8jSftSSH+WqUnQHTRDWazjPAeMu6ozrL5RYzP1h5mgw7XtidZPaaV9ae/uF1KQPkK6TIARaOTdr8I/BLWUg7WdDrfARNYHnW6ezXek1M9Qhv1sL9fZY+JrGB58LF6D2aC2Xjed4K4Jk6v2T1ieneNV27uIdnt21TajuM7w90UlRiVZJZtq/KdEUfqI28C7VoUdcXluAwzR95Ho8hmyIJDqeW3/Wxymdjv+Rctwqtmcka9i2G85Hj8SVV3g4kA==" + }, + initiatorUser: "test-initiator-user", + targetSecret: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "OTR4uwVpy+pf0zthnCIAUXurC8NdSh8RpRG5GWL9TSv4WtkVmpeU/U2A4vjkrchfQOzI1x+uooWikWW9txwwQOM+/N3NG44+/dlHoaEe7AxjmItCKhNj8K2RM6D1mb45wicbF/M4uanuXnGXuT+JmZ+1Lcy2k1GXsk67ejplz2K08h37B+oIW85qMUHLdKuuQlAA/fFS+q6qMti3j2Q8Fr+Sh4U76/2AZVkKRtFeqPB1QhC12dFx6TFoZJkMFzdQz4WNvWVelIK2McKNnOiH0/Z5lAXC7164uzReAoTEfqoNU7qqqRrHhsdwWPu6jbeUn8BQnr7A/X6NWvgeax+HGA==" + }, + targetUser: "test-target-user" + }, + deviceAdminPassword: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: "" + }, + remoteManagementSettings: { remoteManagementMode: "HttpsAndHttpEnabled" }, + snapshotPassword: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: "" + } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.deviceSettings.beginUpdateSecuritySettingsAndWait( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +deviceSettingsUpdateSecuritySettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesAuthorizeForServiceEncryptionKeyRollover.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesAuthorizeForServiceEncryptionKeyRollover.ts new file mode 100644 index 000000000000..b62caca054dc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesAuthorizeForServiceEncryptionKeyRollover.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Authorizes the specified device for service data encryption key rollover. + * + * @summary Authorizes the specified device for service data encryption key rollover. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesAuthorizeForServiceEncryptionKeyRollover.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesAuthorizeForServiceEncryptionKeyRollover() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.authorizeForServiceEncryptionKeyRollover( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesAuthorizeForServiceEncryptionKeyRollover().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesConfigure.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesConfigure.ts new file mode 100644 index 000000000000..0aab85e3063b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesConfigure.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Complete minimal setup before using the device. + * + * @summary Complete minimal setup before using the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesConfigure.json + */ +import { + ConfigureDeviceRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesConfigure() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: ConfigureDeviceRequest = { + currentDeviceName: "Device001ForSDKTest", + friendlyName: "Device001ForSDKTest", + networkInterfaceData0Settings: { + controllerOneIp: "10.168.220.228", + controllerZeroIp: "10.168.220.227" + }, + timeZone: "Pacific Standard Time" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginConfigureAndWait( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +devicesConfigure().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesDeactivate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesDeactivate.ts new file mode 100644 index 000000000000..7da9ec48c243 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesDeactivate.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deactivates the device. + * + * @summary Deactivates the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesDeactivate.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesDeactivate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginDeactivateAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDeactivate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesDelete.ts new file mode 100644 index 000000000000..80cef5b9c797 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesDelete.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the device. + * + * @summary Deletes the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginDeleteAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesFailover.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesFailover.ts new file mode 100644 index 000000000000..bc683ede5953 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesFailover.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Failovers a set of volume containers from a specified source device to a target device. + * + * @summary Failovers a set of volume containers from a specified source device to a target device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesFailover.json + */ +import { + FailoverRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesFailover() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const sourceDeviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: FailoverRequest = { + targetDeviceId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/jemdeviceforsdk", + volumeContainers: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/vcforsdktest" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginFailoverAndWait( + sourceDeviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +devicesFailover().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesGet.ts new file mode 100644 index 000000000000..035888ab4b7d --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesGet.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified device. + * + * @summary Returns the properties of the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const expand = "details"; + const options = { expand: expand }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.get( + deviceName, + resourceGroupName, + managerName, + options + ); + console.log(result); +} + +devicesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesGetUpdateSummary.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesGetUpdateSummary.ts new file mode 100644 index 000000000000..e19872432298 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesGetUpdateSummary.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the update summary of the specified device name. + * + * @summary Returns the update summary of the specified device name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesGetUpdateSummary.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesGetUpdateSummary() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.getUpdateSummary( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesGetUpdateSummary().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesInstallUpdates.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesInstallUpdates.ts new file mode 100644 index 000000000000..2cd075e054f9 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesInstallUpdates.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Downloads and installs the updates on the device. + * + * @summary Downloads and installs the updates on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesInstallUpdates.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesInstallUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginInstallUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesInstallUpdates().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListByManager.ts new file mode 100644 index 000000000000..f360a0e51ad5 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the list of devices for the specified manager. + * + * @summary Returns the list of devices for the specified manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.devices.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListFailoverSets.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListFailoverSets.ts new file mode 100644 index 000000000000..ec5abcf05afb --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListFailoverSets.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns all failover sets for a given device and their eligibility for participating in a failover. A failover set refers to a set of volume containers that need to be failed-over as a single unit to maintain data integrity. + * + * @summary Returns all failover sets for a given device and their eligibility for participating in a failover. A failover set refers to a set of volume containers that need to be failed-over as a single unit to maintain data integrity. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListFailoverSets.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListFailoverSets() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.devices.listFailoverSets( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListFailoverSets().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListFailoverTargets.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListFailoverTargets.ts new file mode 100644 index 000000000000..6a4970707390 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListFailoverTargets.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Given a list of volume containers to be failed over from a source device, this method returns the eligibility result, as a failover target, for all devices under that resource. + * + * @summary Given a list of volume containers to be failed over from a source device, this method returns the eligibility result, as a failover target, for all devices under that resource. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListFailoverTargets.json + */ +import { + ListFailoverTargetsRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListFailoverTargets() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const sourceDeviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: ListFailoverTargetsRequest = { + volumeContainers: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/devices/Device05ForSDKTest/volumeContainers/vcforsdktest" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.devices.listFailoverTargets( + sourceDeviceName, + resourceGroupName, + managerName, + parameters + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListFailoverTargets().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListMetricDefinition.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListMetricDefinition.ts new file mode 100644 index 000000000000..1d8bfd1829a3 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListMetricDefinition.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified device. + * + * @summary Gets the metric definitions for the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListMetricDefinition.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.devices.listMetricDefinition( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListMetrics.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListMetrics.ts new file mode 100644 index 000000000000..9def3d7f98cc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesListMetrics.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified device. + * + * @summary Gets the metrics for the specified device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesListMetrics.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'PrimaryStorageTieredUsed' and timeGrain eq 'PT1H' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.devices.listMetrics( + deviceName, + resourceGroupName, + managerName, + filter + )) { + resArray.push(item); + } + console.log(resArray); +} + +devicesListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesScanForUpdates.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesScanForUpdates.ts new file mode 100644 index 000000000000..5b489f5a3e16 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesScanForUpdates.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Scans for updates on the device. + * + * @summary Scans for updates on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesScanForUpdates.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesScanForUpdates() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "sugattdeviceforSDK"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.beginScanForUpdatesAndWait( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +devicesScanForUpdates().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesUpdate.ts new file mode 100644 index 000000000000..056df7e73222 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/devicesUpdate.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Patches the device. + * + * @summary Patches the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/DevicesUpdate.json + */ +import { + DevicePatch, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function devicesUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device001ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: DevicePatch = { + deviceDescription: "updated device description" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.devices.update( + deviceName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +devicesUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/hardwareComponentGroupsChangeControllerPowerState.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/hardwareComponentGroupsChangeControllerPowerState.ts new file mode 100644 index 000000000000..a2103aff4fab --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/hardwareComponentGroupsChangeControllerPowerState.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Changes the power state of the controller. + * + * @summary Changes the power state of the controller. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/HardwareComponentGroupsChangeControllerPowerState.json + */ +import { + ControllerPowerStateChangeRequest, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function hardwareComponentGroupsChangeControllerPowerState() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const hardwareComponentGroupName = "Controller0Components"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: ControllerPowerStateChangeRequest = { + action: "Start", + activeController: "Controller0", + controller0State: "Ok", + controller1State: "NotPresent" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.hardwareComponentGroups.beginChangeControllerPowerStateAndWait( + deviceName, + hardwareComponentGroupName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +hardwareComponentGroupsChangeControllerPowerState().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/hardwareComponentGroupsListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/hardwareComponentGroupsListByDevice.ts new file mode 100644 index 000000000000..72cc63580416 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/hardwareComponentGroupsListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists the hardware component groups at device-level. + * + * @summary Lists the hardware component groups at device-level. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/HardwareComponentGroupsListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function hardwareComponentGroupsListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.hardwareComponentGroups.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +hardwareComponentGroupsListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsCancel.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsCancel.ts new file mode 100644 index 000000000000..89769c535639 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsCancel.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Cancels a job on the device. + * + * @summary Cancels a job on the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsCancel.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsCancel() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const jobName = "993db21d-101b-41af-9e12-f593d78b99e9"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.jobs.beginCancelAndWait( + deviceName, + jobName, + resourceGroupName, + managerName + ); + console.log(result); +} + +jobsCancel().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsGet.ts new file mode 100644 index 000000000000..88791e82d55f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsGet.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of the specified job name. + * + * @summary Gets the details of the specified job name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsGet() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const deviceName = "sca07forsdktest"; + const jobName = "70a29339-de6d-48e8-b24f-e25ee6769a00"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.jobs.get( + deviceName, + jobName, + resourceGroupName, + managerName + ); + console.log(result); +} + +jobsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsListByDevice.ts new file mode 100644 index 000000000000..d171422ab7f9 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsListByDevice.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs is returned. + * + * @summary Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs is returned. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = "jobType eq 'ManualBackup'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.jobs.listByDevice( + deviceName, + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsListByManager.ts new file mode 100644 index 000000000000..c401be1844e8 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/jobsListByManager.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of jobs is returned. + * + * @summary Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of jobs is returned. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/JobsListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function jobsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = "jobType eq 'FailoverVolumeContainers'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.jobs.listByManager( + resourceGroupName, + managerName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +jobsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersCreateExtendedInfo.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersCreateExtendedInfo.ts new file mode 100644 index 000000000000..415a852dd815 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersCreateExtendedInfo.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates the extended info of the manager. + * + * @summary Creates the extended info of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersCreateExtendedInfo.json + */ +import { + ManagerExtendedInfo, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersCreateExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters: ManagerExtendedInfo = { + algorithm: "None", + integrityKey: "BIl+RHqO8PZ6DRvuXTTK7g==" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.createExtendedInfo( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +managersCreateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersCreateOrUpdate.ts new file mode 100644 index 000000000000..bb0322165bb6 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersCreateOrUpdate.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the manager. + * + * @summary Creates or updates the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersCreateOrUpdate.json + */ +import { + Manager, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters: Manager = { + cisIntrinsicSettings: { type: "GardaV1" }, + location: "westus", + sku: { name: "Standard" } + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.createOrUpdate( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +managersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersDelete.ts new file mode 100644 index 000000000000..cb0df97eda73 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersDelete.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the manager. + * + * @summary Deletes the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.delete(resourceGroupName, managerName); + console.log(result); +} + +managersDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersDeleteExtendedInfo.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersDeleteExtendedInfo.ts new file mode 100644 index 000000000000..343d3ad2ea15 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersDeleteExtendedInfo.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the extended info of the manager. + * + * @summary Deletes the extended info of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersDeleteExtendedInfo.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersDeleteExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.deleteExtendedInfo( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersDeleteExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGet.ts new file mode 100644 index 000000000000..6b47c673f4fc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGet.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified manager name. + * + * @summary Returns the properties of the specified manager name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.get(resourceGroupName, managerName); + console.log(result); +} + +managersGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetActivationKey.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetActivationKey.ts new file mode 100644 index 000000000000..5dfc2794963b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetActivationKey.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the activation key of the manager. + * + * @summary Returns the activation key of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetActivationKey.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetActivationKey() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.getActivationKey( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetActivationKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetDevicePublicEncryptionKey.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetDevicePublicEncryptionKey.ts new file mode 100644 index 000000000000..238b4c831d11 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetDevicePublicEncryptionKey.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the public encryption key of the device. + * + * @summary Returns the public encryption key of the device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetDevicePublicEncryptionKey.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetDevicePublicEncryptionKey() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const deviceName = "sca01forsdktest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.getDevicePublicEncryptionKey( + deviceName, + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetDevicePublicEncryptionKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetEncryptionSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetEncryptionSettings.ts new file mode 100644 index 000000000000..f157af894b4a --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetEncryptionSettings.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the encryption settings of the manager. + * + * @summary Returns the encryption settings of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetEncryptionSettings.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetEncryptionSettings() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.getEncryptionSettings( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetEncryptionSettings().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetExtendedInfo.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetExtendedInfo.ts new file mode 100644 index 000000000000..160a789c94e5 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetExtendedInfo.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the extended information of the specified manager name. + * + * @summary Returns the extended information of the specified manager name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetExtendedInfo.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.getExtendedInfo( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetPublicEncryptionKey.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetPublicEncryptionKey.ts new file mode 100644 index 000000000000..cb4bfb32c64f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersGetPublicEncryptionKey.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the symmetric encrypted public encryption key of the manager. + * + * @summary Returns the symmetric encrypted public encryption key of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersGetPublicEncryptionKey.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersGetPublicEncryptionKey() { + const subscriptionId = "d3ebfe71-b7a9-4c57-92b9-68a2afde4de5"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.getPublicEncryptionKey( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersGetPublicEncryptionKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersList.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersList.ts new file mode 100644 index 000000000000..5780224ae3bb --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersList.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a subscription. + * + * @summary Retrieves all the managers in a subscription. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersList.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersList() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.managers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +managersList().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListByResourceGroup.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListByResourceGroup.ts new file mode 100644 index 000000000000..c9565c6b7efc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListByResourceGroup.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the managers in a resource group. + * + * @summary Retrieves all the managers in a resource group. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListByResourceGroup.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListByResourceGroup() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.managers.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListByResourceGroup().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListFeatureSupportStatus.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListFeatureSupportStatus.ts new file mode 100644 index 000000000000..ca26c25f666b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListFeatureSupportStatus.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists the features and their support status + * + * @summary Lists the features and their support status + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListFeatureSupportStatus.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListFeatureSupportStatus() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.managers.listFeatureSupportStatus( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListFeatureSupportStatus().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListMetricDefinition.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListMetricDefinition.ts new file mode 100644 index 000000000000..121bcaec57f4 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListMetricDefinition.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified manager. + * + * @summary Gets the metric definitions for the specified manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListMetricDefinition.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.managers.listMetricDefinition( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListMetrics.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListMetrics.ts new file mode 100644 index 000000000000..829826ca5440 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersListMetrics.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified manager. + * + * @summary Gets the metrics for the specified manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersListMetrics.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'PrimaryStorageTieredUsed' and timeGrain eq 'PT1H' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.managers.listMetrics( + resourceGroupName, + managerName, + filter + )) { + resArray.push(item); + } + console.log(resArray); +} + +managersListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersRegenerateActivationKey.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersRegenerateActivationKey.ts new file mode 100644 index 000000000000..5a93a38da999 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersRegenerateActivationKey.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Re-generates and returns the activation key of the manager. + * + * @summary Re-generates and returns the activation key of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersRegenerateActivationKey.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersRegenerateActivationKey() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.regenerateActivationKey( + resourceGroupName, + managerName + ); + console.log(result); +} + +managersRegenerateActivationKey().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersUpdate.ts new file mode 100644 index 000000000000..abb142a49741 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersUpdate.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the StorSimple Manager. + * + * @summary Updates the StorSimple Manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersUpdate.json + */ +import { + ManagerPatch, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const parameters: ManagerPatch = { tags: { tagName: "ForSDKTest" } }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.update( + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +managersUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersUpdateExtendedInfo.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersUpdateExtendedInfo.ts new file mode 100644 index 000000000000..2ed281a16b13 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/managersUpdateExtendedInfo.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the extended info of the manager. + * + * @summary Updates the extended info of the manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/ManagersUpdateExtendedInfo.json + */ +import { + ManagerExtendedInfo, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function managersUpdateExtendedInfo() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest2"; + const ifMatch = "674ab9df-af56-4c5c-a5ca-2bddcf1b781a"; + const parameters: ManagerExtendedInfo = { + algorithm: "SHA256", + etag: "674ab9df-af56-4c5c-a5ca-2bddcf1b781a", + integrityKey: "BIl+RHqO8PZ6DRvuXTTK7g==" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.managers.updateExtendedInfo( + resourceGroupName, + managerName, + ifMatch, + parameters + ); + console.log(result); +} + +managersUpdateExtendedInfo().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/operationsList.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/operationsList.ts new file mode 100644 index 000000000000..48e8adf84a0e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/operationsList.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.StorSimple provider + * + * @summary Lists all of the available REST API operations of the Microsoft.StorSimple provider + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/OperationsList.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsCreateOrUpdate.ts new file mode 100644 index 000000000000..533fba17a245 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsCreateOrUpdate.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the storage account credential. + * + * @summary Creates or updates the storage account credential. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsCreateOrUpdate.json + */ +import { + StorageAccountCredential, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const storageAccountCredentialName = "SACForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: StorageAccountCredential = { + accessKey: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "ATuJSkmrFk4h8r1jrZ4nd3nthLSddcguEO5QLO/NECUtTuB9kL4dNv3/jC4WOvFkeVr3x1UvfhlIeMmJBF1SMr6hR1JzD0xNU/TtQqUeXN7V3jk7I+2l67P9StuHWR6OMd3XOLwvznxOEQtEWpweDiobZU1ZiY03WafcGZFpV5j6tEoHeopoZ1J/GhPtkYmx+TqxzUN6qnir5rP3NSYiZciImP/qu8U9yUV/xpVRv39KvFc2Yr5SpKpMMRUj55XW10UnPer63M6KovF8X9Wi/fNnrZAs1Esl5XddZETGrW/e5B++VMJ6w0Q/uvPR+UBwrOU0804l0SzwdIe3qVVd0Q==" + }, + endPoint: "blob.core.windows.net", + sslStatus: "Enabled" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.storageAccountCredentials.beginCreateOrUpdateAndWait( + storageAccountCredentialName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +storageAccountCredentialsCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsDelete.ts new file mode 100644 index 000000000000..325c479fee74 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsDelete.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the storage account credential. + * + * @summary Deletes the storage account credential. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const storageAccountCredentialName = "SACForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.storageAccountCredentials.beginDeleteAndWait( + storageAccountCredentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsGet.ts new file mode 100644 index 000000000000..7397fb58f0df --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsGet.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified storage account credential name. + * + * @summary Gets the properties of the specified storage account credential name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const storageAccountCredentialName = "SACForTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.storageAccountCredentials.get( + storageAccountCredentialName, + resourceGroupName, + managerName + ); + console.log(result); +} + +storageAccountCredentialsGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsListByManager.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsListByManager.ts new file mode 100644 index 000000000000..ab7e9d688037 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/storageAccountCredentialsListByManager.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the storage account credentials in a manager. + * + * @summary Gets all the storage account credentials in a manager. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/StorageAccountCredentialsListByManager.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function storageAccountCredentialsListByManager() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.storageAccountCredentials.listByManager( + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +storageAccountCredentialsListByManager().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersCreateOrUpdate.ts new file mode 100644 index 000000000000..f4cf8c158faa --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersCreateOrUpdate.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the volume container. + * + * @summary Creates or updates the volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersCreateOrUpdate.json + */ +import { + VolumeContainer, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: VolumeContainer = { + bandwidthSettingId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/bandwidthSettings/bandwidthSetting1", + encryptionKey: { + encryptionAlgorithm: "RSAES_PKCS1_v_1_5", + encryptionCertThumbprint: "A872A2DF196AC7682EE24791E7DE2E2A360F5926", + value: + "R//pyVLx/fn58ia098JiLgZB5RY7fVT+6o8a4fmsvjy+ls2UgJphMf25XVqEQCZnsp/5uxteN1M/9ArPIICdhM7M1+b/Ur7kJ0FH0ktxfk7CrPWWJLI4q20LZoduJGI56lREav1VpuLdqw5F9fRcq7zbfgPQ3B/SD0mfumNRiV+AnwbC6msfavIuWrhVDl9iSzEPE+zU06/kpsexnrS81yYT2QlVVUbvpY4F3zfH8TQPpAROTbv2pld6JO4eGOrZ5O1iOr6XCg2TY2W/jf+Ev4z5tqC9VWXE5kh65gjBfpWN0bDWXKekqEhor2crHAxZi4dybdY8Ok1MDWd1CSU8kw==" + }, + storageAccountCredentialId: + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/storageAccountCredentials/safortestrecording" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumeContainers.beginCreateOrUpdateAndWait( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +volumeContainersCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersDelete.ts new file mode 100644 index 000000000000..65b9c110eee1 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersDelete.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the volume container. + * + * @summary Deletes the volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumeContainers.beginDeleteAndWait( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumeContainersDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersGet.ts new file mode 100644 index 000000000000..205f30055db5 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersGet.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the properties of the specified volume container name. + * + * @summary Gets the properties of the specified volume container name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumeContainers.get( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumeContainersGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListByDevice.ts new file mode 100644 index 000000000000..f5badc422d6e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all the volume containers in a device. + * + * @summary Gets all the volume containers in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumeContainers.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumeContainersListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListMetricDefinition.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListMetricDefinition.ts new file mode 100644 index 000000000000..6b7e07b122d5 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListMetricDefinition.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified volume container. + * + * @summary Gets the metric definitions for the specified volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListMetricDefinition.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumeContainers.listMetricDefinition( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumeContainersListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListMetrics.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListMetrics.ts new file mode 100644 index 000000000000..777993357543 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumeContainersListMetrics.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified volume container. + * + * @summary Gets the metrics for the specified volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumeContainersListMetrics.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumeContainersListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'CloudConsumedStorage' and timeGrain eq 'PT1M' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumeContainers.listMetrics( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + filter + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumeContainersListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesCreateOrUpdate.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesCreateOrUpdate.ts new file mode 100644 index 000000000000..bb0c58b4e735 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesCreateOrUpdate.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates the volume. + * + * @summary Creates or updates the volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesCreateOrUpdate.json + */ +import { + Volume, + StorSimple8000SeriesManagementClient +} from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesCreateOrUpdate() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const volumeName = "Volume1ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const parameters: Volume = { + accessControlRecordIds: [ + "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.StorSimple/managers/ManagerForSDKTest1/accessControlRecords/ACR2" + ], + monitoringStatus: "Enabled", + sizeInBytes: 5368709120, + volumeStatus: "Offline", + volumeType: "Tiered" + }; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumes.beginCreateOrUpdateAndWait( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + parameters + ); + console.log(result); +} + +volumesCreateOrUpdate().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesDelete.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesDelete.ts new file mode 100644 index 000000000000..34eebe7362cd --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesDelete.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes the volume. + * + * @summary Deletes the volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesDelete.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesDelete() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const volumeName = "Volume1ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumes.beginDeleteAndWait( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumesDelete().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesGet.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesGet.ts new file mode 100644 index 000000000000..3b0824678e53 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesGet.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns the properties of the specified volume name. + * + * @summary Returns the properties of the specified volume name. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesGet.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesGet() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "VolumeContainerForSDKTest"; + const volumeName = "Volume1ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const result = await client.volumes.get( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName + ); + console.log(result); +} + +volumesGet().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListByDevice.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListByDevice.ts new file mode 100644 index 000000000000..7de6747b89ff --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListByDevice.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the volumes in a device. + * + * @summary Retrieves all the volumes in a device. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListByDevice.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesListByDevice() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumes.listByDevice( + deviceName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListByDevice().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListByVolumeContainer.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListByVolumeContainer.ts new file mode 100644 index 000000000000..66dba1340936 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListByVolumeContainer.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Retrieves all the volumes in a volume container. + * + * @summary Retrieves all the volumes in a volume container. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListByVolumeContainer.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesListByVolumeContainer() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "volumeContainerForSDKTest"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumes.listByVolumeContainer( + deviceName, + volumeContainerName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListByVolumeContainer().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListMetricDefinition.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListMetricDefinition.ts new file mode 100644 index 000000000000..aa954922dbe2 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListMetricDefinition.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metric definitions for the specified volume. + * + * @summary Gets the metric definitions for the specified volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListMetricDefinition.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesListMetricDefinition() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const volumeName = "CloneVolForSDKTest890836587"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumes.listMetricDefinition( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListMetricDefinition().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListMetrics.ts b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListMetrics.ts new file mode 100644 index 000000000000..4db0d67a59a6 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/src/volumesListMetrics.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the metrics for the specified volume. + * + * @summary Gets the metrics for the specified volume. + * x-ms-original-file: specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/examples/VolumesListMetrics.json + */ +import { StorSimple8000SeriesManagementClient } from "@azure/arm-storsimple8000series"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function volumesListMetrics() { + const subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const deviceName = "Device05ForSDKTest"; + const volumeContainerName = "vcForOdataFilterTest"; + const volumeName = "CloneVolForSDKTest890836587"; + const resourceGroupName = "ResourceGroupForSDKTest"; + const managerName = "ManagerForSDKTest1"; + const filter = + "name/value eq 'PrimaryStorageTieredUsed' and timeGrain eq 'PT1H' and startTime ge '2017-06-17T18:30:00Z' and endTime le '2017-06-21T18:30:00Z' and category eq 'CapacityUtilization'"; + const credential = new DefaultAzureCredential(); + const client = new StorSimple8000SeriesManagementClient( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.volumes.listMetrics( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + filter + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesListMetrics().catch(console.error); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/tsconfig.json b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/samples/v2/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/index.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/index.ts new file mode 100644 index 000000000000..cea895300e8f --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { StorSimple8000SeriesManagementClient } from "./storSimple8000SeriesManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/lroImpl.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/accessControlRecordsMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/accessControlRecordsMappers.ts deleted file mode 100644 index e2939a731260..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/accessControlRecordsMappers.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - AccessControlRecordList, - AccessControlRecord, - BaseModel, - CloudError, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/alertsMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/alertsMappers.ts deleted file mode 100644 index 251f1e857a6a..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/alertsMappers.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - AlertList, - Alert, - BaseModel, - AlertSource, - AlertErrorDetails, - CloudError, - ClearAlertRequest, - SendTestAlertEmailRequest, - AccessControlRecord, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/backupPoliciesMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/backupPoliciesMappers.ts deleted file mode 100644 index 47defcd2e9fb..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/backupPoliciesMappers.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - BackupPolicyList, - BackupPolicy, - BaseModel, - CloudError, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/backupSchedulesMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/backupSchedulesMappers.ts deleted file mode 100644 index b4aec523d6bb..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/backupSchedulesMappers.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - BackupScheduleList, - BackupSchedule, - BaseModel, - ScheduleRecurrence, - CloudError, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/backupsMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/backupsMappers.ts deleted file mode 100644 index c42318cc7c3d..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/backupsMappers.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - BackupList, - Backup, - BaseModel, - BackupElement, - CloudError, - CloneRequest, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/bandwidthSettingsMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/bandwidthSettingsMappers.ts deleted file mode 100644 index 275f1a08cd0f..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/bandwidthSettingsMappers.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - BandwidthSettingList, - BandwidthSetting, - BaseModel, - BandwidthSchedule, - Time, - CloudError, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/cloudAppliancesMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/cloudAppliancesMappers.ts deleted file mode 100644 index b7f6afeec1ab..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/cloudAppliancesMappers.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - CloudApplianceConfigurationList, - CloudApplianceConfiguration, - BaseModel, - AcsConfiguration, - VmImage, - CloudError, - CloudAppliance, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/deviceSettingsMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/deviceSettingsMappers.ts deleted file mode 100644 index 3ddcf900052a..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/deviceSettingsMappers.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - AlertSettings, - BaseModel, - CloudError, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - NetworkSettingsPatch, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - SecuritySettingsPatch, - RemoteManagementSettingsPatch, - CloudApplianceSettings, - TimeSettings, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - StorageAccountCredential, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/devicesMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/devicesMappers.ts deleted file mode 100644 index 5a3ade180912..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/devicesMappers.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - ConfigureDeviceRequest, - BaseModel, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - CloudError, - DeviceList, - Device, - DeviceDetails, - DeviceRolloverDetails, - DevicePatch, - FailoverSetsList, - FailoverSet, - VolumeContainerFailoverMetadata, - VolumeFailoverMetadata, - FailoverSetEligibilityResult, - MetricList, - Metrics, - MetricName, - MetricDimension, - MetricData, - MetricDefinitionList, - MetricDefinition, - MetricAvailablity, - Updates, - FailoverRequest, - ListFailoverTargetsRequest, - FailoverTargetsList, - FailoverTarget, - TargetEligibilityResult, - TargetEligibilityErrorMessage, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ControllerPowerStateChangeRequest, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/hardwareComponentGroupsMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/hardwareComponentGroupsMappers.ts deleted file mode 100644 index 6c78dcc93b78..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/hardwareComponentGroupsMappers.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - HardwareComponentGroupList, - HardwareComponentGroup, - BaseModel, - HardwareComponent, - CloudError, - ControllerPowerStateChangeRequest, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/index.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/index.ts index f07aee06f82d..3d02b2e5ac42 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/index.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/models/index.ts @@ -1,5033 +1,2315 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +/** List of available provider operations. */ +export interface AvailableProviderOperationList { + /** The value. */ + value: AvailableProviderOperation[]; + /** The NextLink. */ + nextLink?: string; +} +/** Represents available provider operation. */ +export interface AvailableProviderOperation { + /** The name of the operation being performed on a particular object. Name format: "{resourceProviderNamespace}/{resourceType}/{read|write|delete|action}". Eg. Microsoft.StorSimple/managers/devices/volumeContainers/read, Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action */ + name?: string; + /** Contains the localized display information for this particular operation/action. */ + display?: AvailableProviderOperationDisplay; + /** The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system" */ + origin?: string; + /** Reserved for future use. */ + properties?: Record; +} -/** - * @interface - * An interface representing BaseModel. - * Represents the base class for all other ARM object models - * - */ -export interface BaseModel { +/** Contains the localized display information for this particular operation/action. These value will be used by several clients for (a) custom role definitions for RBAC, (b) complex query filters for the event service and (c) audit history/records for management operations. */ +export interface AvailableProviderOperationDisplay { + /** The localized friendly form of the resource provider name - it is expected to also include the publisher/company responsible. It should use Title Casing and begin with 'Microsoft' for 1st party services. */ + provider?: string; + /** The localized friendly form of the resource type related to this action/operation - it should match the public documentation for the resource provider. It should use Title Casing - for examples, please refer to the 'name' section. */ + resource?: string; + /** The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing and include the entity/resource to which it applies. */ + operation?: string; + /** The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views. */ + description?: string; +} + +/** The list of StorSimple Managers. */ +export interface ManagerList { + /** The list of StorSimple managers. */ + value: Manager[]; +} + +/** Intrinsic settings which refers to the type of the StorSimple Manager. */ +export interface ManagerIntrinsicSettings { + /** The type of StorSimple Manager. */ + type: ManagerType; +} + +/** The Sku. */ +export interface ManagerSku { + /** Refers to the sku name which should be "Standard" */ + name: "Standard"; +} + +/** The Azure Resource. */ +export interface Resource { /** - * @member {string} [id] The path ID that uniquely identifies the object. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The resource ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * @member {string} [name] The name of the object. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * @member {string} [type] The hierarchical type of the object. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** - * @member {Kind} [kind] The Kind of the object. Currently only Series8000 is - * supported. Possible values include: 'Series8000' - */ - kind?: Kind; + /** The geo location of the resource. */ + location: string; + /** The tags attached to the resource. */ + tags?: { [propertyName: string]: string }; } -/** - * @interface - * An interface representing AccessControlRecord. - * The access control record. - * - * @extends BaseModel - */ -export interface AccessControlRecord extends BaseModel { - /** - * @member {string} initiatorName The iSCSI initiator name (IQN). - */ - initiatorName: string; - /** - * @member {number} [volumeCount] The number of volumes using the access - * control record. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly volumeCount?: number; +/** The StorSimple Manager patch. */ +export interface ManagerPatch { + /** The tags attached to the Manager. */ + tags?: { [propertyName: string]: string }; } -/** - * @interface - * An interface representing AcsConfiguration. - * The ACS configuration. - * - */ -export interface AcsConfiguration { +/** The collection of access control records. */ +export interface AccessControlRecordList { + /** The value. */ + value: AccessControlRecord[]; +} + +/** Represents the base class for all other ARM object models */ +export interface BaseModel { /** - * @member {string} namespace The namespace. + * The path ID that uniquely identifies the object. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - namespace: string; + readonly id?: string; /** - * @member {string} realm The realm. + * The name of the object. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - realm: string; + readonly name?: string; /** - * @member {string} serviceUrl The service URL. + * The hierarchical type of the object. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serviceUrl: string; + readonly type?: string; + /** The Kind of the object. Currently only Series8000 is supported */ + kind?: "Series8000"; } -/** - * @interface - * An interface representing AlertSource. - * The source details at which the alert was raised - * - */ +/** The collection of alerts. */ +export interface AlertList { + /** The value. */ + value: Alert[]; + /** The URI of the next page of alerts. */ + nextLink?: string; +} + +/** The source details at which the alert was raised */ export interface AlertSource { - /** - * @member {string} [name] The name of the source - */ + /** The name of the source */ name?: string; - /** - * @member {string} [timeZone] The time zone of the source - */ + /** The time zone of the source */ timeZone?: string; - /** - * @member {AlertSourceType} [alertSourceType] The source type of the alert. - * Possible values include: 'Resource', 'Device' - */ + /** The source type of the alert */ alertSourceType?: AlertSourceType; } -/** - * @interface - * An interface representing AlertErrorDetails. - * The details of the error for which the alert was raised - * - */ +/** The details of the error for which the alert was raised */ export interface AlertErrorDetails { - /** - * @member {string} [errorCode] The error code - */ + /** The error code */ errorCode?: string; - /** - * @member {string} [errorMessage] The error message - */ + /** The error message */ errorMessage?: string; - /** - * @member {number} [occurences] The number of occurences - */ + /** The number of occurrences */ occurences?: number; } -/** - * @interface - * An interface representing Alert. - * The alert. - * - * @extends BaseModel - */ -export interface Alert extends BaseModel { - /** - * @member {string} title The title of the alert - */ - title: string; - /** - * @member {AlertScope} scope The scope of the alert. Possible values - * include: 'Resource', 'Device' - */ - scope: AlertScope; - /** - * @member {string} alertType The type of the alert - */ - alertType: string; - /** - * @member {Date} appearedAtTime The UTC time at which the alert was raised - */ - appearedAtTime: Date; - /** - * @member {Date} appearedAtSourceTime The source time at which the alert was - * raised - */ - appearedAtSourceTime: Date; - /** - * @member {Date} [clearedAtTime] The UTC time at which the alert was cleared - */ - clearedAtTime?: Date; - /** - * @member {Date} [clearedAtSourceTime] The source time at which the alert - * was cleared - */ - clearedAtSourceTime?: Date; - /** - * @member {AlertSource} source The source at which the alert was raised - */ - source: AlertSource; - /** - * @member {string} [recommendation] The recommended action for the issue - * raised in the alert - */ - recommendation?: string; - /** - * @member {string} [resolutionReason] The reason for resolving the alert - */ - resolutionReason?: string; - /** - * @member {AlertSeverity} severity The severity of the alert. Possible - * values include: 'Informational', 'Warning', 'Critical' - */ - severity: AlertSeverity; - /** - * @member {AlertStatus} status The current status of the alert. Possible - * values include: 'Active', 'Cleared' - */ - status: AlertStatus; - /** - * @member {AlertErrorDetails} [errorDetails] The details of the error for - * which the alert was raised - */ - errorDetails?: AlertErrorDetails; - /** - * @member {{ [propertyName: string]: string }} [detailedInformation] More - * details about the alert - */ - detailedInformation?: { [propertyName: string]: string }; +/** The collection of bandwidth setting entities. */ +export interface BandwidthSettingList { + /** The value. */ + value: BandwidthSetting[]; } -/** - * @interface - * An interface representing AlertFilter. - * The OData filters to be used for Alert - * - */ -export interface AlertFilter { - /** - * @member {AlertStatus} [status] Specifies the status of the alerts to be - * filtered. Only 'Equality' operator is supported for this property. - * Possible values include: 'Active', 'Cleared' - */ - status?: AlertStatus; - /** - * @member {AlertSeverity} [severity] Specifies the severity of the alerts to - * be filtered. Only 'Equality' operator is supported for this property. - * Possible values include: 'Informational', 'Warning', 'Critical' - */ - severity?: AlertSeverity; - /** - * @member {AlertSourceType} [sourceType] Specifies the source type of the - * alerts to be filtered. Only 'Equality' operator is supported for this - * property. Possible values include: 'Resource', 'Device' - */ - sourceType?: AlertSourceType; - /** - * @member {string} [sourceName] Specifies the source name of the alerts to - * be filtered. Only 'Equality' operator is supported for this property. - */ - sourceName?: string; - /** - * @member {Date} [appearedOnTime] Specifies the appeared time (in UTC) of - * the alerts to be filtered. Only 'Greater-Than' and 'Lesser-Than' operators - * are supported for this property. - */ - appearedOnTime?: Date; +/** The schedule for bandwidth setting. */ +export interface BandwidthSchedule { + /** The start time of the schedule. */ + start: Time; + /** The stop time of the schedule. */ + stop: Time; + /** The rate in Mbps. */ + rateInMbps: number; + /** The days of the week when this schedule is applicable. */ + days: DayOfWeek[]; } -/** - * @interface - * An interface representing AlertSettings. - * The alert settings. - * - * @extends BaseModel - */ -export interface AlertSettings extends BaseModel { - /** - * @member {AlertEmailNotificationStatus} emailNotification Indicates whether - * email notification enabled or not. Possible values include: 'Enabled', - * 'Disabled' - */ - emailNotification: AlertEmailNotificationStatus; - /** - * @member {string} [alertNotificationCulture] The alert notification - * culture. - */ - alertNotificationCulture?: string; - /** - * @member {AlertEmailNotificationStatus} [notificationToServiceOwners] The - * value indicating whether alert notification enabled for admin or not. - * Possible values include: 'Enabled', 'Disabled' - */ - notificationToServiceOwners?: AlertEmailNotificationStatus; - /** - * @member {string[]} [additionalRecipientEmailList] The alert notification - * email list. - */ - additionalRecipientEmailList?: string[]; +/** The time. */ +export interface Time { + /** The hour. */ + hours: number; + /** The minute. */ + minutes: number; + /** The second. */ + seconds: number; } -/** - * @interface - * An interface representing AsymmetricEncryptedSecret. - * Represent the secrets intended for encryption with asymmetric key pair. - * - */ -export interface AsymmetricEncryptedSecret { - /** - * @member {string} value The value of the secret. - */ - value: string; - /** - * @member {string} [encryptionCertThumbprint] Thumbprint certificate that - * was used to encrypt "Value". If the value in unencrypted, it will be null. - */ - encryptionCertThumbprint?: string; - /** - * @member {EncryptionAlgorithm} encryptionAlgorithm The algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - */ - encryptionAlgorithm: EncryptionAlgorithm; +/** The request for clearing the alert */ +export interface ClearAlertRequest { + /** The resolution message while clearing the alert */ + resolutionMessage?: string; + /** The list of alert IDs to be cleared */ + alerts: string[]; } -/** - * @interface - * An interface representing AvailableProviderOperationDisplay. - * Contains the localized display information for this particular - * operation/action. These value will be used by several clients for (a) custom - * role definitions for RBAC, (b) complex query filters for the event service - * and (c) audit history/records for management operations. - * - */ -export interface AvailableProviderOperationDisplay { - /** - * @member {string} [provider] The localized friendly form of the resource - * provider name - it is expected to also include the publisher/company - * responsible. It should use Title Casing and begin with 'Microsoft' for 1st - * party services. - */ - provider?: string; - /** - * @member {string} [resource] The localized friendly form of the resource - * type related to this action/operation - it should match the public - * documentation for the resource provider. It should use Title Casing - for - * examples, please refer to the 'name' section. - */ - resource?: string; - /** - * @member {string} [operation] The localized friendly name for the - * operation, as it should be shown to the user. It should be concise (to fit - * in drop downs) but clear (i.e. self-documenting). It should use Title - * Casing and include the entity/resource to which it applies. - */ - operation?: string; - /** - * @member {string} [description] The localized friendly description for the - * operation, as it should be shown to the user. It should be thorough, yet - * concise - it will be used in tool tips and detailed views. - */ - description?: string; +/** The cloud appliance configuration list */ +export interface CloudApplianceConfigurationList { + /** The value. */ + value: CloudApplianceConfiguration[]; } -/** - * @interface - * An interface representing AvailableProviderOperation. - * Represents available provider operation. - * - */ -export interface AvailableProviderOperation { - /** - * @member {string} [name] The name of the operation being performed on a - * particular object. Name format: - * "{resourceProviderNamespace}/{resourceType}/{read|write|delete|action}". - * Eg. Microsoft.StorSimple/managers/devices/volumeContainers/read, - * Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action - */ - name?: string; - /** - * @member {AvailableProviderOperationDisplay} [display] Contains the - * localized display information for this particular operation/action. - */ - display?: AvailableProviderOperationDisplay; - /** - * @member {string} [origin] The intended executor of the operation; governs - * the display of the operation in the RBAC UX and the audit logs UX. Default - * value is "user,system" - */ - origin?: string; - /** - * @member {any} [properties] Reserved for future use. - */ - properties?: any; +/** The ACS configuration. */ +export interface AcsConfiguration { + /** The namespace. */ + namespace: string; + /** The realm. */ + realm: string; + /** The service URL. */ + serviceUrl: string; } -/** - * @interface - * An interface representing BackupElement. - * The backup element. - * - */ -export interface BackupElement { - /** - * @member {string} elementId The path ID that uniquely identifies the backup - * element. - */ - elementId: string; - /** - * @member {string} elementName The name of the backup element. - */ - elementName: string; - /** - * @member {string} elementType The hierarchical type of the backup element. - */ - elementType: string; - /** - * @member {number} sizeInBytes The size in bytes. - */ - sizeInBytes: number; - /** - * @member {string} volumeName The name of the volume. - */ - volumeName: string; - /** - * @member {string} volumeContainerId The path ID of the volume container. - */ - volumeContainerId: string; - /** - * @member {VolumeType} [volumeType] The volume type. Possible values - * include: 'Tiered', 'Archival', 'LocallyPinned' - */ - volumeType?: VolumeType; +/** The virtual machine image. */ +export interface VmImage { + /** The name. */ + name: string; + /** The version. */ + version: string; + /** The offer. */ + offer: string; + /** The publisher. */ + publisher: string; + /** The SKU. */ + sku: string; } -/** - * @interface - * An interface representing Backup. - * The backup. - * - * @extends BaseModel - */ -export interface Backup extends BaseModel { - /** - * @member {Date} createdOn The time when the backup was created. - */ - createdOn: Date; - /** - * @member {number} sizeInBytes The backup size in bytes. - */ - sizeInBytes: number; - /** - * @member {BackupType} [backupType] The type of the backup. Possible values - * include: 'LocalSnapshot', 'CloudSnapshot' - */ - backupType?: BackupType; - /** - * @member {BackupJobCreationType} [backupJobCreationType] The backup job - * creation type. Possible values include: 'Adhoc', 'BySchedule', 'BySSM' - */ - backupJobCreationType?: BackupJobCreationType; - /** - * @member {string} [backupPolicyId] The path ID of the backup policy. - */ - backupPolicyId?: string; - /** - * @member {string} [ssmHostName] The StorSimple Snapshot Manager host name. - */ - ssmHostName?: string; - /** - * @member {BackupElement[]} elements The backup elements. - */ - elements: BackupElement[]; +/** The secondary DNS settings. */ +export interface SecondaryDNSSettings { + /** The list of secondary DNS Server IP addresses. */ + secondaryDnsServers?: string[]; } -/** - * @interface - * An interface representing BackupFilter. - * The OData filters to be used for backups. - * - */ -export interface BackupFilter { - /** - * @member {string} [backupPolicyId] Specifies the backupPolicyId of the - * backups to be filtered. Only 'Equality' operator is supported for this - * property. - */ - backupPolicyId?: string; - /** - * @member {string} [volumeId] Specifies the volumeId of the backups to be - * filtered. Only 'Equality' operator is supported for this property. - */ - volumeId?: string; - /** - * @member {Date} [createdTime] Specifies the creation time of the backups to - * be filtered. Only 'Greater Than or Equal To' and 'Lesser Than or Equal To' - * operators are supported for this property. - */ - createdTime?: Date; +/** The 'Data 0' network interface card settings. */ +export interface NetworkInterfaceData0Settings { + /** The controller 0's IPv4 address. */ + controllerZeroIp?: string; + /** The controller 1's IPv4 address. */ + controllerOneIp?: string; } -/** - * @interface - * An interface representing BackupPolicy. - * The backup policy. - * - * @extends BaseModel - */ -export interface BackupPolicy extends BaseModel { - /** - * @member {string[]} volumeIds The path IDs of the volumes which are part of - * the backup policy. - */ - volumeIds: string[]; - /** - * @member {Date} [nextBackupTime] The time of the next backup for the backup - * policy. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly nextBackupTime?: Date; - /** - * @member {Date} [lastBackupTime] The time of the last backup for the backup - * policy. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly lastBackupTime?: Date; - /** - * @member {number} [schedulesCount] The count of schedules the backup policy - * contains. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly schedulesCount?: number; - /** - * @member {ScheduledBackupStatus} [scheduledBackupStatus] Indicates whether - * atleast one of the schedules in the backup policy is active or not. - * Possible values include: 'Disabled', 'Enabled' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly scheduledBackupStatus?: ScheduledBackupStatus; - /** - * @member {BackupPolicyCreationType} [backupPolicyCreationType] The backup - * policy creation type. Indicates whether this was created through SaaS or - * through StorSimple Snapshot Manager. Possible values include: 'BySaaS', - * 'BySSM' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly backupPolicyCreationType?: BackupPolicyCreationType; - /** - * @member {string} [ssmHostName] If the backup policy was created by - * StorSimple Snapshot Manager, then this field indicates the hostname of the - * StorSimple Snapshot Manager. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly ssmHostName?: string; +/** The collection of devices. */ +export interface DeviceList { + /** The value. */ + value: Device[]; } -/** - * @interface - * An interface representing ScheduleRecurrence. - * The schedule recurrence. - * - */ -export interface ScheduleRecurrence { - /** - * @member {RecurrenceType} recurrenceType The recurrence type. Possible - * values include: 'Minutes', 'Hourly', 'Daily', 'Weekly' - */ - recurrenceType: RecurrenceType; - /** - * @member {number} recurrenceValue The recurrence value. - */ - recurrenceValue: number; - /** - * @member {DayOfWeek[]} [weeklyDaysList] The week days list. Applicable only - * for schedules of recurrence type 'weekly'. - */ - weeklyDaysList?: DayOfWeek[]; +/** The additional device details regarding the end point count and volume container count. */ +export interface DeviceDetails { + /** The total number of endpoints that are currently on the device ( i.e. number of volumes). */ + endpointCount?: number; + /** The total number of volume containers on the device. */ + volumeContainerCount?: number; } -/** - * @interface - * An interface representing BackupSchedule. - * The backup schedule. - * - * @extends BaseModel - */ -export interface BackupSchedule extends BaseModel { - /** - * @member {ScheduleRecurrence} scheduleRecurrence The schedule recurrence. - */ - scheduleRecurrence: ScheduleRecurrence; - /** - * @member {BackupType} backupType The type of backup which needs to be - * taken. Possible values include: 'LocalSnapshot', 'CloudSnapshot' - */ - backupType: BackupType; - /** - * @member {number} retentionCount The number of backups to be retained. - */ - retentionCount: number; - /** - * @member {Date} startTime The start time of the schedule. - */ - startTime: Date; - /** - * @member {ScheduleStatus} scheduleStatus The schedule status. Possible - * values include: 'Enabled', 'Disabled' - */ - scheduleStatus: ScheduleStatus; - /** - * @member {Date} [lastSuccessfulRun] The last successful backup run which - * was triggered for the schedule. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly lastSuccessfulRun?: Date; +/** The additional device details for the service data encryption key rollover. */ +export interface DeviceRolloverDetails { + /** The eligibility status of device for service data encryption key rollover. */ + authorizationEligibility?: AuthorizationEligibility; + /** The authorization status of the device for service data encryption key rollover. */ + authorizationStatus?: AuthorizationStatus; + /** The reason for inEligibility of device, in case it's not eligible for service data encryption key rollover. */ + inEligibilityReason?: InEligibilityCategory; } -/** - * @interface - * An interface representing Time. - * The time. - * - */ -export interface Time { - /** - * @member {number} hours The hour. - */ - hours: number; - /** - * @member {number} minutes The minute. - */ - minutes: number; - /** - * @member {number} seconds The second. - */ - seconds: number; +/** The device patch. */ +export interface DevicePatch { + /** Short description given for the device */ + deviceDescription?: string; } -/** - * @interface - * An interface representing BandwidthSchedule. - * The schedule for bandwidth setting. - * - */ -export interface BandwidthSchedule { - /** - * @member {Time} start The start time of the schdule. - */ - start: Time; - /** - * @member {Time} stop The stop time of the schedule. - */ - stop: Time; - /** - * @member {number} rateInMbps The rate in Mbps. - */ - rateInMbps: number; - /** - * @member {DayOfWeek[]} days The days of the week when this schedule is - * applicable. - */ - days: DayOfWeek[]; +/** The collection of backup policies. */ +export interface BackupPolicyList { + /** The value. */ + value: BackupPolicy[]; } -/** - * @interface - * An interface representing BandwidthSetting. - * The bandwidth setting. - * - * @extends BaseModel - */ -export interface BandwidthSetting extends BaseModel { - /** - * @member {BandwidthSchedule[]} schedules The schedules. - */ - schedules: BandwidthSchedule[]; - /** - * @member {number} [volumeCount] The number of volumes that uses the - * bandwidth setting. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly volumeCount?: number; +/** The backup schedule list. */ +export interface BackupScheduleList { + /** The value. */ + value: BackupSchedule[]; } -/** - * @interface - * An interface representing ChapSettings. - * The Challenge-Handshake Authentication Protocol (CHAP) settings. - * - */ -export interface ChapSettings { - /** - * @member {string} [initiatorUser] The CHAP initiator user. - */ - initiatorUser?: string; - /** - * @member {AsymmetricEncryptedSecret} [initiatorSecret] The CHAP initiator - * secret. - */ - initiatorSecret?: AsymmetricEncryptedSecret; - /** - * @member {string} [targetUser] The CHAP target user. - */ - targetUser?: string; - /** - * @member {AsymmetricEncryptedSecret} [targetSecret] The target secret. - */ - targetSecret?: AsymmetricEncryptedSecret; +/** The schedule recurrence. */ +export interface ScheduleRecurrence { + /** The recurrence type. */ + recurrenceType: RecurrenceType; + /** The recurrence value. */ + recurrenceValue: number; + /** The week days list. Applicable only for schedules of recurrence type 'weekly'. */ + weeklyDaysList?: DayOfWeek[]; } -/** - * @interface - * An interface representing ClearAlertRequest. - * The request for clearing the alert - * - */ -export interface ClearAlertRequest { - /** - * @member {string} [resolutionMessage] The resolution message while clearing - * the alert - */ - resolutionMessage?: string; - /** - * @member {string[]} alerts The list of alert IDs to be cleared - */ - alerts: string[]; +/** The collection of backups. */ +export interface BackupList { + /** The value. */ + value: Backup[]; + /** The NextLink. */ + nextLink?: string; } -/** - * @interface - * An interface representing CloneRequest. - * The clone job request. - * - */ +/** The backup element. */ +export interface BackupElement { + /** The path ID that uniquely identifies the backup element. */ + elementId: string; + /** The name of the backup element. */ + elementName: string; + /** The hierarchical type of the backup element. */ + elementType: string; + /** The size in bytes. */ + sizeInBytes: number; + /** The name of the volume. */ + volumeName: string; + /** The path ID of the volume container. */ + volumeContainerId: string; + /** The volume type. */ + volumeType?: VolumeType; +} + +/** The clone job request. */ export interface CloneRequest { - /** - * @member {string} targetDeviceId The path ID of the device which will act - * as the clone target. - */ + /** The path ID of the device which will act as the clone target. */ targetDeviceId: string; - /** - * @member {string} targetVolumeName The name of the new volume which will be - * created and the backup will be cloned into. - */ + /** The name of the new volume which will be created and the backup will be cloned into. */ targetVolumeName: string; - /** - * @member {string[]} targetAccessControlRecordIds The list of path IDs of - * the access control records to be associated to the new cloned volume. - */ + /** The list of path IDs of the access control records to be associated to the new cloned volume. */ targetAccessControlRecordIds: string[]; - /** - * @member {BackupElement} backupElement The backup element that is cloned. - */ + /** The backup element that is cloned. */ backupElement: BackupElement; } -/** - * @interface - * An interface representing CloudAppliance. - * The cloud appliance. - * - */ -export interface CloudAppliance { - /** - * @member {string} name The name. - */ - name: string; - /** - * @member {string} [vnetName] The name of the virtual network. - */ - vnetName?: string; - /** - * @member {string} vnetRegion The virtual network region. - */ - vnetRegion: string; - /** - * @member {boolean} [isVnetDnsConfigured] Indicates whether virtual network - * used is configured with DNS or not. - */ - isVnetDnsConfigured?: boolean; - /** - * @member {boolean} [isVnetExpressConfigured] Indicates whether virtual - * network used is configured with express route or not. - */ - isVnetExpressConfigured?: boolean; - /** - * @member {string} [subnetName] The name of the subnet. - */ - subnetName?: string; - /** - * @member {string} [storageAccountName] The name of the storage account. - */ - storageAccountName?: string; - /** - * @member {string} [storageAccountType] The type of the storage account. - */ - storageAccountType?: string; - /** - * @member {string} [vmType] The type of the virtual machine. - */ - vmType?: string; - /** - * @member {string} [vmImageName] The name of the virtual machine image. - */ - vmImageName?: string; - /** - * @member {string} [modelNumber] The model number. - */ - modelNumber?: string; +/** The collection of hardware component groups. */ +export interface HardwareComponentGroupList { + /** The value. */ + value: HardwareComponentGroup[]; } -/** - * @interface - * An interface representing VmImage. - * The virtual machine image. - * - */ -export interface VmImage { - /** - * @member {string} name The name. - */ - name: string; - /** - * @member {string} version The version. - */ - version: string; - /** - * @member {string} offer The offer. - */ - offer: string; - /** - * @member {string} publisher The publisher. - */ - publisher: string; - /** - * @member {string} sku The SKU. - */ - sku: string; +/** The hardware component. */ +export interface HardwareComponent { + /** The component ID. */ + componentId: string; + /** The display name of the hardware component. */ + displayName: string; + /** The status of the hardware component. */ + status: HardwareComponentStatus; + /** The display name of the status of hardware component. */ + statusDisplayName: string; } -/** - * @interface - * An interface representing CloudApplianceConfiguration. - * The cloud appliance configuration - * - * @extends BaseModel - */ -export interface CloudApplianceConfiguration extends BaseModel { - /** - * @member {string} modelNumber The model number. - */ - modelNumber: string; - /** - * @member {string} cloudPlatform The cloud platform. - */ - cloudPlatform: string; - /** - * @member {AcsConfiguration} acsConfiguration The ACS configuration. - */ - acsConfiguration: AcsConfiguration; - /** - * @member {string[]} supportedStorageAccountTypes The supported storage - * account types. - */ - supportedStorageAccountTypes: string[]; - /** - * @member {string[]} supportedRegions The supported regions. - */ - supportedRegions: string[]; - /** - * @member {string[]} supportedVmTypes The supported virtual machine types. - */ - supportedVmTypes: string[]; - /** - * @member {VmImage[]} supportedVmImages The supported virtual machine - * images. - */ - supportedVmImages: VmImage[]; +/** The collection of jobs. */ +export interface JobList { + /** The value. */ + value: Job[]; + /** The NextLink. */ + nextLink?: string; } -/** - * @interface - * An interface representing CloudApplianceSettings. - * The cloud appliance settings. - * - */ -export interface CloudApplianceSettings { - /** - * @member {AsymmetricEncryptedSecret} [serviceDataEncryptionKey] The service - * data encryption key (encrypted with DAK). - */ - serviceDataEncryptionKey?: AsymmetricEncryptedSecret; - /** - * @member {AsymmetricEncryptedSecret} [channelIntegrityKey] The channel - * integrity key (encrypted with DAK). - */ - channelIntegrityKey?: AsymmetricEncryptedSecret; +/** The job error details. Contains list of job error items. */ +export interface JobErrorDetails { + /** The error details. */ + errorDetails?: JobErrorItem[]; + /** The error code intended for programmatic access. */ + code: string; + /** The error message intended to describe the error in detail. */ + message: string; } -/** - * @interface - * An interface representing SecondaryDNSSettings. - * The secondary DNS settings. - * - */ -export interface SecondaryDNSSettings { - /** - * @member {string[]} [secondaryDnsServers] The list of secondary DNS Server - * IP addresses. - */ - secondaryDnsServers?: string[]; +/** The job error items. */ +export interface JobErrorItem { + /** The recommended actions. */ + recommendations?: string[]; + /** The error code intended for programmatic access. */ + code: string; + /** The error message intended to describe the error in detail. */ + message: string; } -/** - * @interface - * An interface representing NetworkInterfaceData0Settings. - * The 'Data 0' network interface card settings. - * - */ -export interface NetworkInterfaceData0Settings { - /** - * @member {string} [controllerZeroIp] The controller 0's IPv4 address. - */ - controllerZeroIp?: string; - /** - * @member {string} [controllerOneIp] The controller 1's IPv4 address. - */ - controllerOneIp?: string; +/** The additional details related to the data related statistics of a job. Currently applicable only for Backup, Clone and Restore jobs. */ +export interface DataStatistics { + /** The total bytes of data to be processed, as part of the job. */ + totalData?: number; + /** The number of bytes of data processed till now, as part of the job. */ + processedData?: number; + /** The number of bytes of data written to cloud, as part of the job. */ + cloudData?: number; + /** The average throughput of data processed(bytes/sec), as part of the job. */ + throughput?: number; } -/** - * @interface - * An interface representing ConfigureDeviceRequest. - * The mandatory device configuration request. - * - * @extends BaseModel - */ -export interface ConfigureDeviceRequest extends BaseModel { - /** - * @member {string} friendlyName The friendly name for the device. - */ - friendlyName: string; - /** - * @member {string} currentDeviceName The current name of the device. - */ - currentDeviceName: string; - /** - * @member {string} timeZone The device time zone. For eg: "Pacific Standard - * Time" - */ - timeZone: string; - /** - * @member {SecondaryDNSSettings} [dnsSettings] The secondary DNS Settings of - * the device. - */ - dnsSettings?: SecondaryDNSSettings; - /** - * @member {NetworkInterfaceData0Settings} [networkInterfaceData0Settings] - * The 'Data 0' network interface card settings. - */ - networkInterfaceData0Settings?: NetworkInterfaceData0Settings; +/** The details about the specific stage of a job. */ +export interface JobStage { + /** The message of the job stage. */ + message?: string; + /** The stage status. */ + stageStatus: JobStatus; + /** The details of the stage. */ + detail?: string; + /** The error code of the stage if any. */ + errorCode?: string; } -/** - * @interface - * An interface representing ControllerPowerStateChangeRequest. - * The controller power state change request. - * - * @extends BaseModel - */ -export interface ControllerPowerStateChangeRequest extends BaseModel { - /** - * @member {ControllerPowerStateAction} action The power state that the - * request is expecting for the controller of the device. Possible values - * include: 'Start', 'Restart', 'Shutdown' - */ - action: ControllerPowerStateAction; - /** - * @member {ControllerId} activeController The active controller that the - * request is expecting on the device. Possible values include: 'Unknown', - * 'None', 'Controller0', 'Controller1' - */ - activeController: ControllerId; - /** - * @member {ControllerStatus} controller0State The controller 0's status that - * the request is expecting on the device. Possible values include: - * 'NotPresent', 'PoweredOff', 'Ok', 'Recovering', 'Warning', 'Failure' - */ - controller0State: ControllerStatus; - /** - * @member {ControllerStatus} controller1State The controller 1's status that - * the request is expecting on the device. Possible values include: - * 'NotPresent', 'PoweredOff', 'Ok', 'Recovering', 'Warning', 'Failure' - */ - controller1State: ControllerStatus; +/** The list of failover sets. */ +export interface FailoverSetsList { + /** The list of failover sets. */ + value?: FailoverSet[]; } -/** - * @interface - * An interface representing DataStatistics. - * The additional details related to the data related statistics of a job. - * Currently applicable only for Backup, Clone and Restore jobs. - * - */ -export interface DataStatistics { - /** - * @member {number} [totalData] The total bytes of data to be processed, as - * part of the job. - */ - totalData?: number; - /** - * @member {number} [processedData] The number of bytes of data processed - * till now, as part of the job. - */ - processedData?: number; - /** - * @member {number} [cloudData] The number of bytes of data written to cloud, - * as part of the job. - */ - cloudData?: number; - /** - * @member {number} [throughput] The average throughput of data - * processed(bytes/sec), as part of the job. - */ - throughput?: number; +/** The failover set on a device. */ +export interface FailoverSet { + /** The list of meta data of volume containers, which are part of the failover set. */ + volumeContainers?: VolumeContainerFailoverMetadata[]; + /** The eligibility result of the failover set, for failover. */ + eligibilityResult?: FailoverSetEligibilityResult; } -/** - * @interface - * An interface representing DeviceDetails. - * The additional device details regarding the end point count and volume - * container count. - * - */ -export interface DeviceDetails { - /** - * @member {number} [endpointCount] The total number of endpoints that are - * currently on the device ( i.e. number of volumes). - */ - endpointCount?: number; - /** - * @member {number} [volumeContainerCount] The total number of volume - * containers on the device. - */ - volumeContainerCount?: number; +/** The metadata of the volume container, that is being considered as part of a failover set. */ +export interface VolumeContainerFailoverMetadata { + /** The path ID of the volume container. */ + volumeContainerId?: string; + /** The list of metadata of volumes inside the volume container, which contains valid cloud snapshots. */ + volumes?: VolumeFailoverMetadata[]; } -/** - * @interface - * An interface representing DeviceRolloverDetails. - * The additional device details for the service data encryption key rollover. - * - */ -export interface DeviceRolloverDetails { - /** - * @member {AuthorizationEligibility} [authorizationEligibility] The - * eligibility status of device for service data encryption key rollover. - * Possible values include: 'InEligible', 'Eligible' - */ - authorizationEligibility?: AuthorizationEligibility; - /** - * @member {AuthorizationStatus} [authorizationStatus] The authorization - * status of the device for service data encryption key rollover. Possible - * values include: 'Disabled', 'Enabled' - */ - authorizationStatus?: AuthorizationStatus; - /** - * @member {InEligibilityCategory} [inEligibilityReason] The reason for - * inEligibility of device, in case it's not eligible for service data - * encryption key rollover. Possible values include: 'DeviceNotOnline', - * 'NotSupportedAppliance', 'RolloverPending' - */ - inEligibilityReason?: InEligibilityCategory; +/** The metadata of a volume that has valid cloud snapshot. */ +export interface VolumeFailoverMetadata { + /** The path ID of the volume. */ + volumeId?: string; + /** The type of the volume. */ + volumeType?: VolumeType; + /** The size of the volume in bytes at the time the snapshot was taken. */ + sizeInBytes?: number; + /** The date at which the snapshot was taken. */ + backupCreatedDate?: Date; + /** The path ID of the backup-element for this volume, inside the backup set. */ + backupElementId?: string; + /** The path ID of the backup set. */ + backupId?: string; + /** The path ID of the backup policy using which the snapshot was taken. */ + backupPolicyId?: string; } -/** - * @interface - * An interface representing Device. - * The StorSimple device. - * - * @extends BaseModel - */ -export interface Device extends BaseModel { - /** - * @member {string} friendlyName The friendly name of the device. - */ - friendlyName: string; - /** - * @member {Date} activationTime The UTC time at which the device was - * activated - */ - activationTime: Date; - /** - * @member {string} culture The language culture setting on the device. For - * eg: "en-US" - */ - culture: string; - /** - * @member {string} deviceDescription The device description. - */ - deviceDescription: string; - /** - * @member {string} deviceSoftwareVersion The version number of the software - * running on the device. - */ - deviceSoftwareVersion: string; - /** - * @member {string} [friendlySoftwareName] The friendly name of the software - * running on the device. - */ - friendlySoftwareName?: string; - /** - * @member {DeviceConfigurationStatus} deviceConfigurationStatus The current - * configuration status of the device. Possible values include: 'Complete', - * 'Pending' - */ - deviceConfigurationStatus: DeviceConfigurationStatus; - /** - * @member {string} targetIqn The target IQN. - */ - targetIqn: string; - /** - * @member {string} modelDescription The device model. - */ - modelDescription: string; - /** - * @member {DeviceStatus} status The current status of the device. Possible - * values include: 'Unknown', 'Online', 'Offline', 'Deactivated', - * 'RequiresAttention', 'MaintenanceMode', 'Creating', 'Provisioning', - * 'Deactivating', 'Deleted', 'ReadyToSetup' - */ - status: DeviceStatus; - /** - * @member {string} serialNumber The serial number. - */ - serialNumber: string; - /** - * @member {DeviceType} deviceType The type of the device. Possible values - * include: 'Invalid', 'Series8000VirtualAppliance', - * 'Series8000PhysicalAppliance' - */ - deviceType: DeviceType; - /** - * @member {ControllerId} activeController The identifier of the active - * controller of the device. Possible values include: 'Unknown', 'None', - * 'Controller0', 'Controller1' - */ - activeController: ControllerId; - /** - * @member {string} friendlySoftwareVersion The device friendly software - * version. - */ - friendlySoftwareVersion: string; - /** - * @member {number} [availableLocalStorageInBytes] The storage in bytes that - * is available locally on the device. - */ - availableLocalStorageInBytes?: number; - /** - * @member {number} [availableTieredStorageInBytes] The storage in bytes that - * is available on the device for tiered volumes. - */ - availableTieredStorageInBytes?: number; - /** - * @member {number} [provisionedTieredStorageInBytes] The storage in bytes - * that has been provisioned on the device for tiered volumes. - */ - provisionedTieredStorageInBytes?: number; - /** - * @member {number} [provisionedLocalStorageInBytes] The storage in bytes - * used for locally pinned volumes on the device (including additional local - * reservation). - */ - provisionedLocalStorageInBytes?: number; - /** - * @member {number} [provisionedVolumeSizeInBytes] Total capacity in bytes of - * tiered and locally pinned volumes on the device - */ - provisionedVolumeSizeInBytes?: number; - /** - * @member {number} [usingStorageInBytes] The storage in bytes that is - * currently being used on the device, including both local and cloud. - */ - usingStorageInBytes?: number; - /** - * @member {number} [totalTieredStorageInBytes] The total tiered storage - * available on the device in bytes. - */ - totalTieredStorageInBytes?: number; - /** - * @member {number} [agentGroupVersion] The device agent group version. - */ - agentGroupVersion?: number; - /** - * @member {number} [networkInterfaceCardCount] The number of network - * interface cards - */ - networkInterfaceCardCount?: number; - /** - * @member {string} [deviceLocation] The location of the virtual appliance. - */ - deviceLocation?: string; - /** - * @member {VirtualMachineApiType} [virtualMachineApiType] The virtual - * machine API type. Possible values include: 'Classic', 'Arm' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly virtualMachineApiType?: VirtualMachineApiType; - /** - * @member {DeviceDetails} [details] The additional device details regarding - * the end point count and volume container count. - */ - details?: DeviceDetails; - /** - * @member {DeviceRolloverDetails} [rolloverDetails] The additional device - * details for the service data encryption key rollover. - */ - rolloverDetails?: DeviceRolloverDetails; +/** The eligibility result of failover set, for failover. */ +export interface FailoverSetEligibilityResult { + /** Represents if this failover set is eligible for failover or not. */ + isEligibleForFailover?: boolean; + /** The error message, if the failover set is not eligible for failover. */ + errorMessage?: string; } -/** - * @interface - * An interface representing DevicePatch. - * The device patch. - * - */ -export interface DevicePatch { - /** - * @member {string} [deviceDescription] Short description given for the - * device - */ - deviceDescription?: string; +/** The metric list. */ +export interface MetricList { + /** The value. */ + value?: Metrics[]; } -/** - * @interface - * An interface representing DimensionFilter. - * The dimension filter. - * - */ -export interface DimensionFilter { - /** - * @member {string} [name] Specifies the dimension name. E.g., - * NetworkInterface. Valid values are the ones specified in the field - * "dimensions" in the ListMetricDefinitions call. Only 'Equality' operator - * is supported for this property. - */ - name?: string; - /** - * @member {string} [values] Specifies the dimension value. E.g., Data0. - * Valid values are the ones returned in the field "dimensions" in the - * ListMetricDefinitions call. Only 'Equality' operator is supported for this - * property. - */ - values?: string; +/** The monitoring metric. */ +export interface Metrics { + /** The ID of metric source. */ + resourceId?: string; + /** The start time of the metric data. */ + startTime?: Date; + /** The end time of the metric data. */ + endTime?: Date; + /** The time granularity of the metric data. */ + timeGrain?: string; + /** The metric aggregation type. */ + primaryAggregation?: MetricAggregationType; + /** The name of the metric. */ + name?: MetricName; + /** The metric dimensions. */ + dimensions?: MetricDimension[]; + /** The unit of the metric data. */ + unit?: MetricUnit; + /** The type of the metric data. */ + type?: string; + /** The list of the metric data. */ + values?: MetricData[]; } -/** - * @interface - * An interface representing DNSSettings. - * The DNS(Domain Name Server) settings of a device. - * - */ -export interface DNSSettings { - /** - * @member {string} [primaryDnsServer] The primary IPv4 DNS server for the - * device - */ - primaryDnsServer?: string; - /** - * @member {string} [primaryIpv6DnsServer] The primary IPv6 DNS server for - * the device - */ - primaryIpv6DnsServer?: string; - /** - * @member {string[]} [secondaryDnsServers] The secondary IPv4 DNS server for - * the device - */ - secondaryDnsServers?: string[]; - /** - * @member {string[]} [secondaryIpv6DnsServers] The secondary IPv6 DNS server - * for the device - */ - secondaryIpv6DnsServers?: string[]; +/** The metric name. */ +export interface MetricName { + /** The metric name. */ + value?: string; + /** The localized metric name. */ + localizedValue?: string; } -/** - * @interface - * An interface representing EncryptionSettings. - * The encryption settings. - * - * @extends BaseModel - */ -export interface EncryptionSettings extends BaseModel { - /** - * @member {EncryptionStatus} encryptionStatus The encryption status to - * indicates if encryption is enabled or not. Possible values include: - * 'Enabled', 'Disabled' - */ - encryptionStatus: EncryptionStatus; - /** - * @member {KeyRolloverStatus} keyRolloverStatus The key rollover status to - * indicates if key rollover is required or not. If secret's encryption has - * been upgraded, then it requires key rollover. Possible values include: - * 'Required', 'NotRequired' - */ - keyRolloverStatus: KeyRolloverStatus; +/** The metric dimension. It indicates the source of the metric. */ +export interface MetricDimension { + /** The metric dimension name. */ + name?: string; + /** The metric dimension values. */ + value?: string; } -/** - * @interface - * An interface representing FailoverRequest. - * The request object for triggering a failover of volume containers, from a - * source device to a target device. - * - */ -export interface FailoverRequest { - /** - * @member {string} [targetDeviceId] The ARM path ID of the device which will - * act as the failover target. - */ - targetDeviceId?: string; - /** - * @member {string[]} [volumeContainers] The list of path IDs of the volume - * containers which needs to be failed-over to the target device. - */ - volumeContainers?: string[]; +/** The metric data. */ +export interface MetricData { + /** The time stamp of the metric data. */ + timeStamp?: Date; + /** The sum of all samples at the time stamp. */ + sum?: number; + /** The count of all samples at the time stamp. */ + count?: number; + /** The average of all samples at the time stamp. */ + average?: number; + /** The minimum of all samples at the time stamp. */ + minimum?: number; + /** The maximum of all samples at the time stamp. */ + maximum?: number; } -/** - * @interface - * An interface representing VolumeFailoverMetadata. - * The metadata of a volume that has valid cloud snapshot. - * - */ -export interface VolumeFailoverMetadata { - /** - * @member {string} [volumeId] The path ID of the volume. - */ - volumeId?: string; - /** - * @member {VolumeType} [volumeType] The type of the volume. Possible values - * include: 'Tiered', 'Archival', 'LocallyPinned' - */ - volumeType?: VolumeType; - /** - * @member {number} [sizeInBytes] The size of the volume in bytes at the time - * the snapshot was taken. - */ - sizeInBytes?: number; - /** - * @member {Date} [backupCreatedDate] The date at which the snapshot was - * taken. - */ - backupCreatedDate?: Date; - /** - * @member {string} [backupElementId] The path ID of the backup-element for - * this volume, inside the backup set. - */ - backupElementId?: string; - /** - * @member {string} [backupId] The path ID of the backup set. - */ - backupId?: string; - /** - * @member {string} [backupPolicyId] The path ID of the backup policy using - * which the snapshot was taken. - */ - backupPolicyId?: string; +/** The list of metric definitions. */ +export interface MetricDefinitionList { + /** The list of metric definitions. */ + value?: MetricDefinition[]; } -/** - * @interface - * An interface representing VolumeContainerFailoverMetadata. - * The metadata of the volume container, that is being considered as part of a - * failover set. - * - */ -export interface VolumeContainerFailoverMetadata { - /** - * @member {string} [volumeContainerId] The path ID of the volume container. - */ - volumeContainerId?: string; - /** - * @member {VolumeFailoverMetadata[]} [volumes] The list of metadata of - * volumes inside the volume container, which contains valid cloud snapshots. - */ - volumes?: VolumeFailoverMetadata[]; +/** The monitoring metric definition. */ +export interface MetricDefinition { + /** The metric name. */ + name?: MetricName; + /** The metric unit. */ + unit?: MetricUnit; + /** The metric aggregation type. */ + primaryAggregationType?: MetricAggregationType; + /** The metric source ID. */ + resourceId?: string; + /** The available metric granularities. */ + metricAvailabilities?: MetricAvailablity[]; + /** The available metric dimensions. */ + dimensions?: MetricDimension[]; + /** The category of the metric. */ + category?: string; + /** The metric definition type. */ + type?: string; } -/** - * @interface - * An interface representing FailoverSetEligibilityResult. - * The eligibility result of failover set, for failover. - * - */ -export interface FailoverSetEligibilityResult { - /** - * @member {boolean} [isEligibleForFailover] Represents if this failover set - * is eligible for failover or not. - */ - isEligibleForFailover?: boolean; - /** - * @member {string} [errorMessage] The error message, if the failover set is - * not eligible for failover. - */ - errorMessage?: string; +/** The metric availability. */ +export interface MetricAvailablity { + /** The aggregation interval for the metric. */ + timeGrain?: string; + /** The retention period for the metric at the specified timegrain. */ + retention?: string; } -/** - * @interface - * An interface representing FailoverSet. - * The failover set on a device. - * - */ -export interface FailoverSet { - /** - * @member {VolumeContainerFailoverMetadata[]} [volumeContainers] The list of - * meta data of volume containers, which are part of the failover set. - */ - volumeContainers?: VolumeContainerFailoverMetadata[]; - /** - * @member {FailoverSetEligibilityResult} [eligibilityResult] The eligibility - * result of the failover set, for failover. - */ - eligibilityResult?: FailoverSetEligibilityResult; +/** The DNS(Domain Name Server) settings of a device. */ +export interface DNSSettings { + /** The primary IPv4 DNS server for the device */ + primaryDnsServer?: string; + /** The primary IPv6 DNS server for the device */ + primaryIpv6DnsServer?: string; + /** The secondary IPv4 DNS server for the device */ + secondaryDnsServers?: string[]; + /** The secondary IPv6 DNS server for the device */ + secondaryIpv6DnsServers?: string[]; } -/** - * @interface - * An interface representing TargetEligibilityErrorMessage. - * The error/warning message due to which the device is ineligible as a - * failover target device. - * - */ -export interface TargetEligibilityErrorMessage { - /** - * @member {string} [message] The localized error message stating the reason - * why the device is not eligible as a target device. - */ - message?: string; - /** - * @member {string} [resolution] The localized resolution message for the - * error. - */ - resolution?: string; - /** - * @member {TargetEligibilityResultCode} [resultCode] The result code for the - * error, due to which the device does not qualify as a failover target - * device. Possible values include: 'TargetAndSourceCannotBeSameError', - * 'TargetIsNotOnlineError', 'TargetSourceIncompatibleVersionError', - * 'LocalToTieredVolumesConversionWarning', - * 'TargetInsufficientCapacityError', - * 'TargetInsufficientLocalVolumeMemoryError', - * 'TargetInsufficientTieredVolumeMemoryError' - */ - resultCode?: TargetEligibilityResultCode; +/** The collection of network adapters on the device. */ +export interface NetworkAdapterList { + /** The value. */ + value: NetworkAdapters[]; } -/** - * @interface - * An interface representing TargetEligibilityResult. - * The eligibility result of device, as a failover target device. - * - */ -export interface TargetEligibilityResult { - /** - * @member {TargetEligibilityStatus} [eligibilityStatus] The eligibility - * status of device, as a failover target device. Possible values include: - * 'NotEligible', 'Eligible' - */ - eligibilityStatus?: TargetEligibilityStatus; - /** - * @member {TargetEligibilityErrorMessage[]} [messages] The list of error - * messages, if a device does not qualify as a failover target device. - */ - messages?: TargetEligibilityErrorMessage[]; +/** Represents the network adapter on device. */ +export interface NetworkAdapters { + /** The ID of the network adapter. */ + interfaceId: NetInterfaceId; + /** Value indicating status of network adapter. */ + netInterfaceStatus: NetInterfaceStatus; + /** Value indicating whether this instance is default. */ + isDefault?: boolean; + /** Value indicating cloud and ISCSI status of network adapter. */ + iscsiAndCloudStatus: IscsiAndCloudStatus; + /** The speed of the network adapter. */ + speed?: number; + /** The mode of network adapter, either IPv4, IPv6 or both. */ + mode: NetworkMode; + /** The IPv4 configuration of the network adapter. */ + nicIpv4Settings?: NicIPv4; + /** The IPv6 configuration of the network adapter. */ + nicIpv6Settings?: NicIPv6; } -/** - * @interface - * An interface representing FailoverTarget. - * Represents the eligibility of a device as a failover target device. - * - */ -export interface FailoverTarget { - /** - * @member {string} [deviceId] The path ID of the device. - */ - deviceId?: string; - /** - * @member {DeviceStatus} [deviceStatus] The status of the device. Possible - * values include: 'Unknown', 'Online', 'Offline', 'Deactivated', - * 'RequiresAttention', 'MaintenanceMode', 'Creating', 'Provisioning', - * 'Deactivating', 'Deleted', 'ReadyToSetup' - */ - deviceStatus?: DeviceStatus; - /** - * @member {string} [modelDescription] The model number of the device. - */ - modelDescription?: string; - /** - * @member {string} [deviceSoftwareVersion] The software version of the - * device. - */ - deviceSoftwareVersion?: string; - /** - * @member {number} [dataContainersCount] The count of datacontainers on the - * device. - */ - dataContainersCount?: number; - /** - * @member {number} [volumesCount] The count of volumes on the device. - */ - volumesCount?: number; - /** - * @member {number} [availableLocalStorageInBytes] The amount of free local - * storage available on the device in bytes. - */ - availableLocalStorageInBytes?: number; - /** - * @member {number} [availableTieredStorageInBytes] The amount of free tiered - * storage available for the device in bytes. - */ - availableTieredStorageInBytes?: number; - /** - * @member {string} [deviceLocation] The geo location (applicable only for - * cloud appliances) of the device. - */ - deviceLocation?: string; - /** - * @member {string} [friendlyDeviceSoftwareVersion] The friendly name for the - * current version of software on the device. - */ - friendlyDeviceSoftwareVersion?: string; - /** - * @member {TargetEligibilityResult} [eligibilityResult] The eligibility - * result of the device, as a failover target device. - */ - eligibilityResult?: TargetEligibilityResult; +/** Details related to the IPv4 address configuration. */ +export interface NicIPv4 { + /** The IPv4 address of the network adapter. */ + ipv4Address?: string; + /** The IPv4 netmask of the network adapter. */ + ipv4Netmask?: string; + /** The IPv4 gateway of the network adapter. */ + ipv4Gateway?: string; + /** The IPv4 address of Controller0. */ + controller0Ipv4Address?: string; + /** The IPv4 address of Controller1. */ + controller1Ipv4Address?: string; } -/** - * @interface - * An interface representing Feature. - * The feature. - * - */ -export interface Feature { - /** - * @member {string} name The name of the feature. - */ - name: string; - /** - * @member {FeatureSupportStatus} status The feature support status. Possible - * values include: 'NotAvailable', 'UnsupportedDeviceVersion', 'Supported' - */ - status: FeatureSupportStatus; +/** Details related to the IPv6 address configuration. */ +export interface NicIPv6 { + /** The IPv6 address of the network adapter. */ + ipv6Address?: string; + /** The IPv6 prefix of the network adapter. */ + ipv6Prefix?: string; + /** The IPv6 gateway of the network adapter. */ + ipv6Gateway?: string; + /** The IPv6 address of Controller0. */ + controller0Ipv6Address?: string; + /** The IPv6 address of Controller1. */ + controller1Ipv6Address?: string; } -/** - * @interface - * An interface representing FeatureFilter. - * The OData filter to be used for features. - * - */ -export interface FeatureFilter { - /** - * @member {string} [deviceId] Specifies the device ID for which the features - * are required. Only 'Equality' operator is supported for this property. - */ - deviceId?: string; +/** The web proxy settings on the device. */ +export interface WebproxySettings { + /** The connection URI. */ + connectionUri?: string; + /** The authentication type. */ + authentication: AuthenticationType; + /** The webproxy username. */ + username: string; } -/** - * @interface - * An interface representing HardwareComponent. - * The hardware component. - * - */ -export interface HardwareComponent { - /** - * @member {string} componentId The component ID. - */ - componentId: string; - /** - * @member {string} displayName The display name of the hardware component. - */ - displayName: string; - /** - * @member {HardwareComponentStatus} status The status of the hardware - * component. Possible values include: 'Unknown', 'NotPresent', 'PoweredOff', - * 'Ok', 'Recovering', 'Warning', 'Failure' - */ - status: HardwareComponentStatus; - /** - * @member {string} statusDisplayName The display name of the status of - * hardware component. - */ - statusDisplayName: string; +/** Represents the patch request for the network settings of a device. */ +export interface NetworkSettingsPatch { + /** The DNS (Domain Name System) settings of device. */ + dnsSettings?: DNSSettings; + /** The network adapter list of device. */ + networkAdapters?: NetworkAdapterList; } -/** - * @interface - * An interface representing HardwareComponentGroup. - * The hardware component group. - * - * @extends BaseModel - */ -export interface HardwareComponentGroup extends BaseModel { - /** - * @member {string} displayName The display name the hardware component - * group. - */ - displayName: string; - /** - * @member {Date} lastUpdatedTime The last updated time. - */ - lastUpdatedTime: Date; - /** - * @member {HardwareComponent[]} components The list of hardware components. - */ - components: HardwareComponent[]; +/** The public key. */ +export interface PublicKey { + /** The key. */ + key: string; } -/** - * @interface - * An interface representing JobErrorItem. - * The job error items. - * - */ -export interface JobErrorItem { - /** - * @member {string[]} [recommendations] The recommended actions. - */ - recommendations?: string[]; - /** - * @member {string} code The error code intended for programmatic access. - */ - code: string; - /** - * @member {string} message The error message intended to describe the error - * in detail. - */ - message: string; +/** The settings for remote management of a device. */ +export interface RemoteManagementSettings { + /** The remote management mode. */ + remoteManagementMode: RemoteManagementModeConfiguration; + /** The remote management certificates. */ + remoteManagementCertificate?: string; } -/** - * @interface - * An interface representing JobErrorDetails. - * The job error details. Contains list of job error items. - * - */ -export interface JobErrorDetails { - /** - * @member {JobErrorItem[]} [errorDetails] The error details. - */ - errorDetails?: JobErrorItem[]; - /** - * @member {string} code The error code intended for programmatic access. - */ - code: string; - /** - * @member {string} message The error message intended to describe the error - * in detail. - */ - message: string; +/** The Challenge-Handshake Authentication Protocol (CHAP) settings. */ +export interface ChapSettings { + /** The CHAP initiator user. */ + initiatorUser?: string; + /** The CHAP initiator secret. */ + initiatorSecret?: AsymmetricEncryptedSecret; + /** The CHAP target user. */ + targetUser?: string; + /** The target secret. */ + targetSecret?: AsymmetricEncryptedSecret; } -/** - * @interface - * An interface representing JobStage. - * The details about the specific stage of a job. - * - */ -export interface JobStage { - /** - * @member {string} [message] The message of the job stage. - */ - message?: string; - /** - * @member {JobStatus} stageStatus The stage status. Possible values include: - * 'Running', 'Succeeded', 'Failed', 'Canceled' - */ - stageStatus: JobStatus; - /** - * @member {string} [detail] The details of the stage. - */ - detail?: string; - /** - * @member {string} [errorCode] The error code of the stage if any. - */ - errorCode?: string; +/** Represent the secrets intended for encryption with asymmetric key pair. */ +export interface AsymmetricEncryptedSecret { + /** The value of the secret. */ + value: string; + /** Thumbprint certificate that was used to encrypt "Value". If the value in unencrypted, it will be null. */ + encryptionCertThumbprint?: string; + /** The algorithm used to encrypt "Value". */ + encryptionAlgorithm: EncryptionAlgorithm; +} + +/** Represents the patch request for the security settings of a device. */ +export interface SecuritySettingsPatch { + /** The remote management settings. */ + remoteManagementSettings?: RemoteManagementSettingsPatch; + /** The device administrator password. */ + deviceAdminPassword?: AsymmetricEncryptedSecret; + /** The snapshot manager password. */ + snapshotPassword?: AsymmetricEncryptedSecret; + /** The device CHAP and reverse-CHAP settings. */ + chapSettings?: ChapSettings; + /** The cloud appliance settings. */ + cloudApplianceSettings?: CloudApplianceSettings; } -/** - * @interface - * An interface representing Job. - * The job. - * - * @extends BaseModel - */ -export interface Job extends BaseModel { - /** - * @member {JobStatus} status The current status of the job. Possible values - * include: 'Running', 'Succeeded', 'Failed', 'Canceled' - */ - status: JobStatus; - /** - * @member {Date} [startTime] The UTC time at which the job was started. - */ - startTime?: Date; - /** - * @member {Date} [endTime] The UTC time at which the job completed. - */ - endTime?: Date; - /** - * @member {number} percentComplete The percentage of the job that is already - * complete. - */ - percentComplete: number; - /** - * @member {JobErrorDetails} [error] The error details, if any, for the job. - */ - error?: JobErrorDetails; - /** - * @member {JobType} jobType The type of the job. Possible values include: - * 'ScheduledBackup', 'ManualBackup', 'RestoreBackup', 'CloneVolume', - * 'FailoverVolumeContainers', 'CreateLocallyPinnedVolume', 'ModifyVolume', - * 'InstallUpdates', 'SupportPackageLogs', 'CreateCloudAppliance' - */ - jobType: JobType; - /** - * @member {DataStatistics} [dataStats] The data statistics properties of the - * job. - */ - dataStats?: DataStatistics; - /** - * @member {string} [entityLabel] The entity identifier for which the job - * ran. - */ - entityLabel?: string; - /** - * @member {string} [entityType] The entity type for which the job ran. - */ - entityType?: string; - /** - * @member {JobStage[]} [jobStages] The job stages. - */ - jobStages?: JobStage[]; - /** - * @member {string} [deviceId] The device ID in which the job ran. - */ - deviceId?: string; - /** - * @member {boolean} [isCancellable] Represents whether the job is - * cancellable or not. - */ - isCancellable?: boolean; - /** - * @member {BackupType} [backupType] The backup type (CloudSnapshot | - * LocalSnapshot). Applicable only for backup jobs. Possible values include: - * 'LocalSnapshot', 'CloudSnapshot' - */ - backupType?: BackupType; - /** - * @member {string} [sourceDeviceId] The source device ID of the failover - * job. - */ - sourceDeviceId?: string; - /** - * @member {Date} [backupPointInTime] The time of the backup used for the - * failover. - */ - backupPointInTime?: Date; +/** The settings for updating remote management mode of the device. */ +export interface RemoteManagementSettingsPatch { + /** The remote management mode. */ + remoteManagementMode: RemoteManagementModeConfiguration; } -/** - * @interface - * An interface representing JobFilter. - * The OData filter to be used for jobs. - * - */ -export interface JobFilter { - /** - * @member {string} [status] Specifies the status of the jobs to be filtered. - * For e.g., "Running", "Succeeded", "Failed" or "Canceled". Only 'Equality' - * operator is supported for this property. - */ - status?: string; - /** - * @member {string} [jobType] Specifies the type of the jobs to be filtered. - * For e.g., "ScheduledBackup", "ManualBackup", "RestoreBackup", - * "CloneVolume", "FailoverVolumeContainers", "CreateLocallyPinnedVolume", - * "ModifyVolume", "InstallUpdates", "SupportPackageLogs", or - * "CreateCloudAppliance". Only 'Equality' operator can be used for this - * property. - */ - jobType?: string; - /** - * @member {Date} [startTime] Specifies the start time of the jobs to be - * filtered. Only 'Greater Than or Equal To' and 'Lesser Than or Equal To' - * operators are supported for this property. - */ - startTime?: Date; +/** The cloud appliance settings. */ +export interface CloudApplianceSettings { + /** The service data encryption key (encrypted with DAK). */ + serviceDataEncryptionKey?: AsymmetricEncryptedSecret; + /** The channel integrity key (encrypted with DAK). */ + channelIntegrityKey?: AsymmetricEncryptedSecret; } -/** - * @interface - * An interface representing Key. - * The key. - * - */ -export interface Key { - /** - * @member {string} activationKey The activation key for the device. - */ - activationKey: string; +/** The request for sending test alert email */ +export interface SendTestAlertEmailRequest { + /** The list of email IDs to send the test alert email */ + emailList: string[]; } -/** - * @interface - * An interface representing ListFailoverTargetsRequest. - * The request object for fetching the list of failover targets (eligible - * devices for failover). - * - */ +/** The collection of volume container entities. */ +export interface VolumeContainerList { + /** The value. */ + value: VolumeContainer[]; +} + +/** The collection of volumes. */ +export interface VolumeList { + /** The value. */ + value: Volume[]; +} + +/** The request object for triggering a failover of volume containers, from a source device to a target device. */ +export interface FailoverRequest { + /** The ARM path ID of the device which will act as the failover target. */ + targetDeviceId?: string; + /** The list of path IDs of the volume containers which needs to be failed-over to the target device. */ + volumeContainers?: string[]; +} + +/** The request object for fetching the list of failover targets (eligible devices for failover). */ export interface ListFailoverTargetsRequest { - /** - * @member {string[]} [volumeContainers] The list of path IDs of the volume - * containers that needs to be failed-over, for which we want to fetch the - * eligible targets. - */ + /** The list of path IDs of the volume containers that needs to be failed-over, for which we want to fetch the eligible targets. */ volumeContainers?: string[]; } -/** - * @interface - * An interface representing ManagerIntrinsicSettings. - * Intrinsic settings which refers to the type of the Storsimple Manager. - * - */ -export interface ManagerIntrinsicSettings { - /** - * @member {ManagerType} type The type of StorSimple Manager. Possible values - * include: 'GardaV1', 'HelsinkiV1' - */ - type: ManagerType; +/** The list of all devices in a resource and their eligibility status as a failover target device. */ +export interface FailoverTargetsList { + /** The list of all the failover targets. */ + value?: FailoverTarget[]; } -/** - * @interface - * An interface representing ManagerSku. - * The Sku. - * - */ -export interface ManagerSku { +/** Represents the eligibility of a device as a failover target device. */ +export interface FailoverTarget { + /** The path ID of the device. */ + deviceId?: string; + /** The status of the device. */ + deviceStatus?: DeviceStatus; + /** The model number of the device. */ + modelDescription?: string; + /** The software version of the device. */ + deviceSoftwareVersion?: string; + /** The count of data containers on the device. */ + dataContainersCount?: number; + /** The count of volumes on the device. */ + volumesCount?: number; + /** The amount of free local storage available on the device in bytes. */ + availableLocalStorageInBytes?: number; + /** The amount of free tiered storage available for the device in bytes. */ + availableTieredStorageInBytes?: number; + /** The geo location (applicable only for cloud appliances) of the device. */ + deviceLocation?: string; + /** The friendly name for the current version of software on the device. */ + friendlyDeviceSoftwareVersion?: string; + /** The eligibility result of the device, as a failover target device. */ + eligibilityResult?: TargetEligibilityResult; } -/** - * @interface - * An interface representing Resource. - * The Azure Resource. - * - * @extends BaseResource - */ -export interface Resource extends BaseResource { - /** - * @member {string} [id] The resource ID. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly id?: string; - /** - * @member {string} [name] The resource name. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly name?: string; - /** - * @member {string} [type] The resource type. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly type?: string; - /** - * @member {string} location The geo location of the resource. - */ - location: string; - /** - * @member {{ [propertyName: string]: string }} [tags] The tags attached to - * the resource. - */ - tags?: { [propertyName: string]: string }; +/** The eligibility result of device, as a failover target device. */ +export interface TargetEligibilityResult { + /** The eligibility status of device, as a failover target device. */ + eligibilityStatus?: TargetEligibilityStatus; + /** The list of error messages, if a device does not qualify as a failover target device. */ + messages?: TargetEligibilityErrorMessage[]; } -/** - * @interface - * An interface representing Manager. - * The StorSimple Manager. - * - * @extends Resource - */ -export interface Manager extends Resource { - /** - * @member {ManagerIntrinsicSettings} [cisIntrinsicSettings] Represents the - * type of StorSimple Manager. - */ - cisIntrinsicSettings?: ManagerIntrinsicSettings; - /** - * @member {string} [provisioningState] Specifies the state of the resource - * as it is getting provisioned. Value of "Succeeded" means the Manager was - * successfully created. - */ - provisioningState?: string; - /** - * @member {string} [etag] The etag of the manager. - */ - etag?: string; +/** The error/warning message due to which the device is ineligible as a failover target device. */ +export interface TargetEligibilityErrorMessage { + /** The localized error message stating the reason why the device is not eligible as a target device. */ + message?: string; + /** The localized resolution message for the error. */ + resolution?: string; + /** The result code for the error, due to which the device does not qualify as a failover target device. */ + resultCode?: TargetEligibilityResultCode; } -/** - * @interface - * An interface representing ManagerExtendedInfo. - * The extended info of the manager. - * - * @extends BaseModel - */ -export interface ManagerExtendedInfo extends BaseModel { - /** - * @member {string} [version] The version of the extended info being - * persisted. - */ - version?: string; - /** - * @member {string} integrityKey Represents the CIK of the resource. - */ - integrityKey: string; - /** - * @member {string} [encryptionKey] Represents the CEK of the resource. - */ - encryptionKey?: string; - /** - * @member {string} [encryptionKeyThumbprint] Represents the Cert thumbprint - * that was used to encrypt the CEK. - */ - encryptionKeyThumbprint?: string; - /** - * @member {string} [portalCertificateThumbprint] Represents the portal - * thumbprint which can be used optionally to encrypt the entire data before - * storing it. - */ - portalCertificateThumbprint?: string; - /** - * @member {string} algorithm Represents the encryption algorithm used to - * encrypt the keys. None - if Key is saved in plain text format. Algorithm - * name - if key is encrypted - */ - algorithm: string; - /** - * @member {string} [etag] The etag of the resource. - */ - etag?: string; +/** The collections of features. */ +export interface FeatureList { + /** The value. */ + value: Feature[]; } -/** - * @interface - * An interface representing ManagerPatch. - * The StorSimple Manager patch. - * - */ -export interface ManagerPatch { - /** - * @member {{ [propertyName: string]: string }} [tags] The tags attached to - * the Manager. - */ - tags?: { [propertyName: string]: string }; +/** The feature. */ +export interface Feature { + /** The name of the feature. */ + name: string; + /** The feature support status. */ + status: FeatureSupportStatus; } -/** - * @interface - * An interface representing MetricAvailablity. - * The metric availability. - * - */ -export interface MetricAvailablity { - /** - * @member {string} [timeGrain] The aggregation interval for the metric. - */ - timeGrain?: string; - /** - * @member {string} [retention] The retention period for the metric at the - * specified timegrain. - */ - retention?: string; +/** The key. */ +export interface Key { + /** The activation key for the device. */ + activationKey: string; } -/** - * @interface - * An interface representing MetricData. - * The metric data. - * - */ -export interface MetricData { - /** - * @member {Date} [timeStamp] The time stamp of the metric data. - */ - timeStamp?: Date; - /** - * @member {number} [sum] The sum of all samples at the time stamp. - */ - sum?: number; - /** - * @member {number} [count] The count of all samples at the time stamp. - */ - count?: number; - /** - * @member {number} [average] The average of all samples at the time stamp. - */ - average?: number; - /** - * @member {number} [minimum] The minimum of all samples at the time stamp. - */ - minimum?: number; - /** - * @member {number} [maximum] The maximum of all samples at the time stamp. - */ - maximum?: number; +/** Represents the secrets encrypted using Symmetric Encryption Key. */ +export interface SymmetricEncryptedSecret { + /** The value of the secret itself. If the secret is in plaintext or null then EncryptionAlgorithm will be none. */ + value: string; + /** The thumbprint of the cert that was used to encrypt "Value". */ + valueCertificateThumbprint?: string; + /** The algorithm used to encrypt the "Value". */ + encryptionAlgorithm: EncryptionAlgorithm; } -/** - * @interface - * An interface representing MetricName. - * The metric name. - * - */ -export interface MetricName { - /** - * @member {string} [value] The metric name. - */ - value?: string; - /** - * @member {string} [localizedValue] The localized metric name. - */ - localizedValue?: string; +/** The cloud appliance. */ +export interface CloudAppliance { + /** The name. */ + name: string; + /** The name of the virtual network. */ + vnetName?: string; + /** The virtual network region. */ + vnetRegion: string; + /** Indicates whether virtual network used is configured with DNS or not. */ + isVnetDnsConfigured?: boolean; + /** Indicates whether virtual network used is configured with express route or not. */ + isVnetExpressConfigured?: boolean; + /** The name of the subnet. */ + subnetName?: string; + /** The name of the storage account. */ + storageAccountName?: string; + /** The type of the storage account. */ + storageAccountType?: string; + /** The type of the virtual machine. */ + vmType?: string; + /** The name of the virtual machine image. */ + vmImageName?: string; + /** The model number. */ + modelNumber?: string; } -/** - * @interface - * An interface representing MetricDimension. - * The metric dimension. It indicates the source of the metric. - * - */ -export interface MetricDimension { - /** - * @member {string} [name] The metric dimension name. - */ +/** The collection of storage account credential entities. */ +export interface StorageAccountCredentialList { + /** The value. */ + value: StorageAccountCredential[]; +} + +/** The OData filters to be used for Alert */ +export interface AlertFilter { + /** Specifies the status of the alerts to be filtered. Only 'Equality' operator is supported for this property. */ + status?: AlertStatus; + /** Specifies the severity of the alerts to be filtered. Only 'Equality' operator is supported for this property. */ + severity?: AlertSeverity; + /** Specifies the source type of the alerts to be filtered. Only 'Equality' operator is supported for this property. */ + sourceType?: AlertSourceType; + /** Specifies the source name of the alerts to be filtered. Only 'Equality' operator is supported for this property. */ + sourceName?: string; + /** Specifies the appeared time (in UTC) of the alerts to be filtered. Only 'Greater-Than' and 'Lesser-Than' operators are supported for this property. */ + appearedOnTime?: Date; +} + +/** The OData filters to be used for backups. */ +export interface BackupFilter { + /** Specifies the backupPolicyId of the backups to be filtered. Only 'Equality' operator is supported for this property. */ + backupPolicyId?: string; + /** Specifies the volumeId of the backups to be filtered. Only 'Equality' operator is supported for this property. */ + volumeId?: string; + /** Specifies the creation time of the backups to be filtered. Only 'Greater Than or Equal To' and 'Lesser Than or Equal To' operators are supported for this property. */ + createdTime?: Date; +} + +/** The dimension filter. */ +export interface DimensionFilter { + /** Specifies the dimension name. E.g., NetworkInterface. Valid values are the ones specified in the field "dimensions" in the ListMetricDefinitions call. Only 'Equality' operator is supported for this property. */ name?: string; - /** - * @member {string} [value] The metric dimension values. - */ - value?: string; + /** Specifies the dimension value. E.g., Data0. Valid values are the ones returned in the field "dimensions" in the ListMetricDefinitions call. Only 'Equality' operator is supported for this property. */ + values?: string; } -/** - * @interface - * An interface representing MetricDefinition. - * The monitoring metric definition. - * - */ -export interface MetricDefinition { - /** - * @member {MetricName} [name] The metric name. - */ - name?: MetricName; - /** - * @member {MetricUnit} [unit] The metric unit. Possible values include: - * 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds' - */ - unit?: MetricUnit; - /** - * @member {MetricAggregationType} [primaryAggregationType] The metric - * aggregation type. Possible values include: 'Average', 'Last', 'Maximum', - * 'Minimum', 'None', 'Total' - */ - primaryAggregationType?: MetricAggregationType; - /** - * @member {string} [resourceId] The metric source ID. - */ - resourceId?: string; - /** - * @member {MetricAvailablity[]} [metricAvailabilities] The available metric - * granularities. - */ - metricAvailabilities?: MetricAvailablity[]; - /** - * @member {MetricDimension[]} [dimensions] The available metric dimensions. - */ - dimensions?: MetricDimension[]; - /** - * @member {string} [category] The category of the metric. - */ - category?: string; - /** - * @member {string} [type] The metric definition type. - */ - type?: string; +/** The OData filter to be used for features. */ +export interface FeatureFilter { + /** Specifies the device ID for which the features are required. Only 'Equality' operator is supported for this property. */ + deviceId?: string; } -/** - * @interface - * An interface representing MetricNameFilter. - * The metric name filter, specifying the name of the metric to be filtered on. - * - */ -export interface MetricNameFilter { - /** - * @member {string} [value] Specifies the metric name to be filtered on. - * E.g., CloudStorageUsed. Valid values are the ones returned in the field - * "name" in the ListMetricDefinitions call. Only 'Equality' operator is - * supported for this property. - */ - value?: string; +/** The OData filter to be used for jobs. */ +export interface JobFilter { + /** Specifies the status of the jobs to be filtered. For e.g., "Running", "Succeeded", "Failed" or "Canceled". Only 'Equality' operator is supported for this property. */ + status?: string; + /** Specifies the type of the jobs to be filtered. For e.g., "ScheduledBackup", "ManualBackup", "RestoreBackup", "CloneVolume", "FailoverVolumeContainers", "CreateLocallyPinnedVolume", "ModifyVolume", "InstallUpdates", "SupportPackageLogs", or "CreateCloudAppliance". Only 'Equality' operator can be used for this property. */ + jobType?: string; + /** Specifies the start time of the jobs to be filtered. Only 'Greater Than or Equal To' and 'Lesser Than or Equal To' operators are supported for this property. */ + startTime?: Date; } -/** - * @interface - * An interface representing MetricFilter. - * The OData filters to be used for metrics. - * - */ +/** The OData filters to be used for metrics. */ export interface MetricFilter { - /** - * @member {MetricNameFilter} [name] Specifies the metric name filter - * specifying the name of the metric to be filtered on. Only 'Equality' - * operator is supported for this property. - */ + /** Specifies the metric name filter specifying the name of the metric to be filtered on. Only 'Equality' operator is supported for this property. */ name?: MetricNameFilter; - /** - * @member {Date} [startTime] Specifies the start time of the time range to - * be queried. Only 'Greater Than Or Equal To' operator is supported for this - * property. - */ + /** Specifies the start time of the time range to be queried. Only 'Greater Than Or Equal To' operator is supported for this property. */ startTime?: Date; - /** - * @member {Date} [endTime] Specifies the end time of the time range to be - * queried. Only 'Less Than Or Equal To' operator is supported for this - * property. - */ + /** Specifies the end time of the time range to be queried. Only 'Less Than Or Equal To' operator is supported for this property. */ endTime?: Date; - /** - * @member {string} [timeGrain] Specifies the time granularity of the metrics - * to be returned. E.g., "P1D". Valid values are the ones returned as the - * field "timeGrain" in the ListMetricDefinitions call. Only 'Equality' - * operator is supported for this property. - */ + /** Specifies the time granularity of the metrics to be returned. E.g., "P1D". Valid values are the ones returned as the field "timeGrain" in the ListMetricDefinitions call. Only 'Equality' operator is supported for this property. */ timeGrain?: string; - /** - * @member {string} category Specifies the category of the metrics to be - * filtered. E.g., "CapacityUtilization". Valid values are the ones returned - * as the field "category" in the ListMetricDefinitions call. Only 'Equality' - * operator is supported for this property. - */ + /** Specifies the category of the metrics to be filtered. E.g., "CapacityUtilization". Valid values are the ones returned as the field "category" in the ListMetricDefinitions call. Only 'Equality' operator is supported for this property. */ category: string; - /** - * @member {DimensionFilter} [dimensions] Specifies the source(the dimension) - * of the metrics to be filtered. Only 'Equality' operator is supported for - * this property. - */ + /** Specifies the source(the dimension) of the metrics to be filtered. Only 'Equality' operator is supported for this property. */ dimensions?: DimensionFilter; } -/** - * @interface - * An interface representing Metrics. - * The monitoring metric. - * - */ -export interface Metrics { - /** - * @member {string} [resourceId] The ID of metric source. - */ - resourceId?: string; - /** - * @member {Date} [startTime] The start time of the metric data. - */ - startTime?: Date; - /** - * @member {Date} [endTime] The end time of the metric data. - */ - endTime?: Date; - /** - * @member {string} [timeGrain] The time granularity of the metric data. - */ - timeGrain?: string; - /** - * @member {MetricAggregationType} [primaryAggregation] The metric - * aggregation type. Possible values include: 'Average', 'Last', 'Maximum', - * 'Minimum', 'None', 'Total' - */ - primaryAggregation?: MetricAggregationType; - /** - * @member {MetricName} [name] The name of the metric. - */ - name?: MetricName; - /** - * @member {MetricDimension[]} [dimensions] The metric dimensions. - */ - dimensions?: MetricDimension[]; - /** - * @member {MetricUnit} [unit] The unit of the metric data. Possible values - * include: 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', - * 'Seconds' - */ - unit?: MetricUnit; - /** - * @member {string} [type] The type of the metric data. - */ - type?: string; - /** - * @member {MetricData[]} [values] The list of the metric data. - */ - values?: MetricData[]; -} - -/** - * @interface - * An interface representing NicIPv4. - * Details related to the IPv4 address configuration. - * - */ -export interface NicIPv4 { - /** - * @member {string} [ipv4Address] The IPv4 address of the network adapter. - */ - ipv4Address?: string; - /** - * @member {string} [ipv4Netmask] The IPv4 netmask of the network adapter. - */ - ipv4Netmask?: string; - /** - * @member {string} [ipv4Gateway] The IPv4 gateway of the network adapter. - */ - ipv4Gateway?: string; - /** - * @member {string} [controller0Ipv4Address] The IPv4 address of Controller0. - */ - controller0Ipv4Address?: string; - /** - * @member {string} [controller1Ipv4Address] The IPv4 address of Controller1. - */ - controller1Ipv4Address?: string; -} - -/** - * @interface - * An interface representing NicIPv6. - * Details related to the IPv6 address configuration. - * - */ -export interface NicIPv6 { - /** - * @member {string} [ipv6Address] The IPv6 address of the network adapter. - */ - ipv6Address?: string; - /** - * @member {string} [ipv6Prefix] The IPv6 prefix of the network adapter. - */ - ipv6Prefix?: string; - /** - * @member {string} [ipv6Gateway] The IPv6 gateway of the network adapter. - */ - ipv6Gateway?: string; - /** - * @member {string} [controller0Ipv6Address] The IPv6 address of Controller0. - */ - controller0Ipv6Address?: string; - /** - * @member {string} [controller1Ipv6Address] The IPv6 address of Controller1. - */ - controller1Ipv6Address?: string; +/** The metric name filter, specifying the name of the metric to be filtered on. */ +export interface MetricNameFilter { + /** Specifies the metric name to be filtered on. E.g., CloudStorageUsed. Valid values are the ones returned in the field "name" in the ListMetricDefinitions call. Only 'Equality' operator is supported for this property. */ + value?: string; } -/** - * @interface - * An interface representing NetworkAdapters. - * Represents the network adapter on device. - * - */ -export interface NetworkAdapters { - /** - * @member {NetInterfaceId} interfaceId The ID of the network adapter. - * Possible values include: 'Invalid', 'Data0', 'Data1', 'Data2', 'Data3', - * 'Data4', 'Data5' - */ - interfaceId: NetInterfaceId; - /** - * @member {NetInterfaceStatus} netInterfaceStatus Value indicating status of - * network adapter. Possible values include: 'Enabled', 'Disabled' - */ - netInterfaceStatus: NetInterfaceStatus; - /** - * @member {boolean} [isDefault] Value indicating whether this instance is - * default. - */ - isDefault?: boolean; - /** - * @member {ISCSIAndCloudStatus} iscsiAndCloudStatus Value indicating cloud - * and ISCSI status of network adapter. Possible values include: 'Disabled', - * 'IscsiEnabled', 'CloudEnabled', 'IscsiAndCloudEnabled' - */ - iscsiAndCloudStatus: ISCSIAndCloudStatus; - /** - * @member {number} [speed] The speed of the network adapter. - */ - speed?: number; - /** - * @member {NetworkMode} mode The mode of network adapter, either IPv4, IPv6 - * or both. Possible values include: 'Invalid', 'IPV4', 'IPV6', 'BOTH' - */ - mode: NetworkMode; - /** - * @member {NicIPv4} [nicIpv4Settings] The IPv4 configuration of the network - * adapter. - */ - nicIpv4Settings?: NicIPv4; - /** - * @member {NicIPv6} [nicIpv6Settings] The IPv6 configuration of the network - * adapter. - */ - nicIpv6Settings?: NicIPv6; -} +/** The StorSimple Manager. */ +export type Manager = Resource & { + /** The etag of the manager. */ + etag?: string; + /** Represents the type of StorSimple Manager. */ + cisIntrinsicSettings?: ManagerIntrinsicSettings; + /** Specifies the Sku. */ + sku?: ManagerSku; + /** Specifies the state of the resource as it is getting provisioned. Value of "Succeeded" means the Manager was successfully created. */ + provisioningState?: string; +}; -/** - * @interface - * An interface representing NetworkAdapterList. - * The collection of network adapters on the device. - * - */ -export interface NetworkAdapterList { +/** The access control record. */ +export type AccessControlRecord = BaseModel & { + /** The iSCSI initiator name (IQN). */ + initiatorName: string; /** - * @member {NetworkAdapters[]} value The value. + * The number of volumes using the access control record. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - value: NetworkAdapters[]; -} + readonly volumeCount?: number; +}; -/** - * @interface - * An interface representing WebproxySettings. - * The web proxy settings on the device. - * - */ -export interface WebproxySettings { - /** - * @member {string} [connectionUri] The connection URI. - */ - connectionUri?: string; - /** - * @member {AuthenticationType} authentication The authentication type. - * Possible values include: 'Invalid', 'None', 'Basic', 'NTLM' - */ - authentication: AuthenticationType; - /** - * @member {string} username The webproxy username. - */ - username: string; -} +/** The alert. */ +export type Alert = BaseModel & { + /** The title of the alert */ + title: string; + /** The scope of the alert */ + scope: AlertScope; + /** The type of the alert */ + alertType: string; + /** The UTC time at which the alert was raised */ + appearedAtTime: Date; + /** The source time at which the alert was raised */ + appearedAtSourceTime: Date; + /** The UTC time at which the alert was cleared */ + clearedAtTime?: Date; + /** The source time at which the alert was cleared */ + clearedAtSourceTime?: Date; + /** The source at which the alert was raised */ + source: AlertSource; + /** The recommended action for the issue raised in the alert */ + recommendation?: string; + /** The reason for resolving the alert */ + resolutionReason?: string; + /** The severity of the alert */ + severity: AlertSeverity; + /** The current status of the alert */ + status: AlertStatus; + /** The details of the error for which the alert was raised */ + errorDetails?: AlertErrorDetails; + /** More details about the alert */ + detailedInformation?: { [propertyName: string]: string }; +}; -/** - * @interface - * An interface representing NetworkSettings. - * Represents the network settings of a device. - * - * @extends BaseModel - */ -export interface NetworkSettings extends BaseModel { - /** - * @member {DNSSettings} dnsSettings The DNS (Domain Name System) settings of - * device. - */ - dnsSettings: DNSSettings; - /** - * @member {NetworkAdapterList} networkAdapters The network adapter list of - * device. - */ - networkAdapters: NetworkAdapterList; +/** The bandwidth setting. */ +export type BandwidthSetting = BaseModel & { + /** The schedules. */ + schedules: BandwidthSchedule[]; /** - * @member {WebproxySettings} webproxySettings The webproxy settings of - * device. + * The number of volumes that uses the bandwidth setting. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - webproxySettings: WebproxySettings; -} + readonly volumeCount?: number; +}; -/** - * @interface - * An interface representing NetworkSettingsPatch. - * Represents the patch request for the network settings of a device. - * - */ -export interface NetworkSettingsPatch { - /** - * @member {DNSSettings} [dnsSettings] The DNS (Domain Name System) settings - * of device. - */ - dnsSettings?: DNSSettings; - /** - * @member {NetworkAdapterList} [networkAdapters] The network adapter list of - * device. - */ - networkAdapters?: NetworkAdapterList; -} +/** The cloud appliance configuration */ +export type CloudApplianceConfiguration = BaseModel & { + /** The model number. */ + modelNumber: string; + /** The cloud platform. */ + cloudPlatform: string; + /** The ACS configuration. */ + acsConfiguration: AcsConfiguration; + /** The supported storage account types. */ + supportedStorageAccountTypes: string[]; + /** The supported regions. */ + supportedRegions: string[]; + /** The supported virtual machine types. */ + supportedVmTypes: string[]; + /** The supported virtual machine images. */ + supportedVmImages: VmImage[]; +}; -/** - * @interface - * An interface representing PublicKey. - * The public key. - * - */ -export interface PublicKey { - /** - * @member {string} key The key. - */ - key: string; -} +/** The mandatory device configuration request. */ +export type ConfigureDeviceRequest = BaseModel & { + /** The friendly name for the device. */ + friendlyName: string; + /** The current name of the device. */ + currentDeviceName: string; + /** The device time zone. For eg: "Pacific Standard Time" */ + timeZone: string; + /** The secondary DNS Settings of the device. */ + dnsSettings?: SecondaryDNSSettings; + /** The 'Data 0' network interface card settings. */ + networkInterfaceData0Settings?: NetworkInterfaceData0Settings; +}; -/** - * @interface - * An interface representing RemoteManagementSettings. - * The settings for remote management of a device. - * - */ -export interface RemoteManagementSettings { - /** - * @member {RemoteManagementModeConfiguration} remoteManagementMode The - * remote management mode. Possible values include: 'Unknown', 'Disabled', - * 'HttpsEnabled', 'HttpsAndHttpEnabled' - */ - remoteManagementMode: RemoteManagementModeConfiguration; +/** The StorSimple device. */ +export type Device = BaseModel & { + /** The friendly name of the device. */ + friendlyName: string; + /** The UTC time at which the device was activated */ + activationTime: Date; + /** The language culture setting on the device. For eg: "en-US" */ + culture: string; + /** The device description. */ + deviceDescription: string; + /** The version number of the software running on the device. */ + deviceSoftwareVersion: string; + /** The friendly name of the software running on the device. */ + friendlySoftwareName?: string; + /** The current configuration status of the device. */ + deviceConfigurationStatus: DeviceConfigurationStatus; + /** The target IQN. */ + targetIqn: string; + /** The device model. */ + modelDescription: string; + /** The current status of the device. */ + status: DeviceStatus; + /** The serial number. */ + serialNumber: string; + /** The type of the device. */ + deviceType: DeviceType; + /** The identifier of the active controller of the device. */ + activeController: ControllerId; + /** The device friendly software version. */ + friendlySoftwareVersion: string; + /** The storage in bytes that is available locally on the device. */ + availableLocalStorageInBytes?: number; + /** The storage in bytes that is available on the device for tiered volumes. */ + availableTieredStorageInBytes?: number; + /** The storage in bytes that has been provisioned on the device for tiered volumes. */ + provisionedTieredStorageInBytes?: number; + /** The storage in bytes used for locally pinned volumes on the device (including additional local reservation). */ + provisionedLocalStorageInBytes?: number; + /** Total capacity in bytes of tiered and locally pinned volumes on the device */ + provisionedVolumeSizeInBytes?: number; + /** The storage in bytes that is currently being used on the device, including both local and cloud. */ + usingStorageInBytes?: number; + /** The total tiered storage available on the device in bytes. */ + totalTieredStorageInBytes?: number; + /** The device agent group version. */ + agentGroupVersion?: number; + /** The number of network interface cards */ + networkInterfaceCardCount?: number; + /** The location of the virtual appliance. */ + deviceLocation?: string; /** - * @member {string} [remoteManagementCertificate] The remote management - * certificates. + * The virtual machine API type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - remoteManagementCertificate?: string; -} + readonly virtualMachineApiType?: VirtualMachineApiType; + /** The additional device details regarding the end point count and volume container count. */ + details?: DeviceDetails; + /** The additional device details for the service data encryption key rollover. */ + rolloverDetails?: DeviceRolloverDetails; +}; -/** - * @interface - * An interface representing RemoteManagementSettingsPatch. - * The settings for updating remote management mode of the device. - * - */ -export interface RemoteManagementSettingsPatch { - /** - * @member {RemoteManagementModeConfiguration} remoteManagementMode The - * remote management mode. Possible values include: 'Unknown', 'Disabled', - * 'HttpsEnabled', 'HttpsAndHttpEnabled' - */ - remoteManagementMode: RemoteManagementModeConfiguration; -} +/** The alert settings. */ +export type AlertSettings = BaseModel & { + /** Indicates whether email notification enabled or not. */ + emailNotification: AlertEmailNotificationStatus; + /** The alert notification culture. */ + alertNotificationCulture?: string; + /** The value indicating whether alert notification enabled for admin or not. */ + notificationToServiceOwners?: AlertEmailNotificationStatus; + /** The alert notification email list. */ + additionalRecipientEmailList?: string[]; +}; -/** - * @interface - * An interface representing SecuritySettings. - * The security settings of a device. - * - * @extends BaseModel - */ -export interface SecuritySettings extends BaseModel { - /** - * @member {RemoteManagementSettings} remoteManagementSettings The settings - * for remote management of a device. - */ - remoteManagementSettings: RemoteManagementSettings; +/** The backup policy. */ +export type BackupPolicy = BaseModel & { + /** The path IDs of the volumes which are part of the backup policy. */ + volumeIds: string[]; /** - * @member {ChapSettings} chapSettings The Challenge-Handshake Authentication - * Protocol (CHAP) settings. + * The time of the next backup for the backup policy. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - chapSettings: ChapSettings; -} - -/** - * @interface - * An interface representing SecuritySettingsPatch. - * Represents the patch request for the security settings of a device. - * - */ -export interface SecuritySettingsPatch { + readonly nextBackupTime?: Date; /** - * @member {RemoteManagementSettingsPatch} [remoteManagementSettings] The - * remote management settings. + * The time of the last backup for the backup policy. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - remoteManagementSettings?: RemoteManagementSettingsPatch; + readonly lastBackupTime?: Date; /** - * @member {AsymmetricEncryptedSecret} [deviceAdminPassword] The device - * administrator password. + * The count of schedules the backup policy contains. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - deviceAdminPassword?: AsymmetricEncryptedSecret; + readonly schedulesCount?: number; /** - * @member {AsymmetricEncryptedSecret} [snapshotPassword] The snapshot - * manager password. + * Indicates whether at least one of the schedules in the backup policy is active or not. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - snapshotPassword?: AsymmetricEncryptedSecret; + readonly scheduledBackupStatus?: ScheduledBackupStatus; /** - * @member {ChapSettings} [chapSettings] The device CHAP and reverse-CHAP - * settings. + * The backup policy creation type. Indicates whether this was created through SaaS or through StorSimple Snapshot Manager. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - chapSettings?: ChapSettings; + readonly backupPolicyCreationType?: BackupPolicyCreationType; /** - * @member {CloudApplianceSettings} [cloudApplianceSettings] The cloud - * appliance settings. + * If the backup policy was created by StorSimple Snapshot Manager, then this field indicates the hostname of the StorSimple Snapshot Manager. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - cloudApplianceSettings?: CloudApplianceSettings; -} + readonly ssmHostName?: string; +}; -/** - * @interface - * An interface representing SendTestAlertEmailRequest. - * The request for sending test alert email - * - */ -export interface SendTestAlertEmailRequest { +/** The backup schedule. */ +export type BackupSchedule = BaseModel & { + /** The schedule recurrence. */ + scheduleRecurrence: ScheduleRecurrence; + /** The type of backup which needs to be taken. */ + backupType: BackupType; + /** The number of backups to be retained. */ + retentionCount: number; + /** The start time of the schedule. */ + startTime: Date; + /** The schedule status. */ + scheduleStatus: ScheduleStatus; /** - * @member {string[]} emailList The list of email IDs to send the test alert - * email + * The last successful backup run which was triggered for the schedule. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - emailList: string[]; -} + readonly lastSuccessfulRun?: Date; +}; -/** - * @interface - * An interface representing StorageAccountCredential. - * The storage account credential. - * - * @extends BaseModel - */ -export interface StorageAccountCredential extends BaseModel { - /** - * @member {string} endPoint The storage endpoint - */ - endPoint: string; - /** - * @member {SslStatus} sslStatus Signifies whether SSL needs to be enabled or - * not. Possible values include: 'Enabled', 'Disabled' - */ - sslStatus: SslStatus; - /** - * @member {AsymmetricEncryptedSecret} [accessKey] The details of the storage - * account password. - */ - accessKey?: AsymmetricEncryptedSecret; - /** - * @member {number} [volumesCount] The count of volumes using this storage - * account credential. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly volumesCount?: number; -} +/** The backup. */ +export type Backup = BaseModel & { + /** The time when the backup was created. */ + createdOn: Date; + /** The backup size in bytes. */ + sizeInBytes: number; + /** The type of the backup. */ + backupType?: BackupType; + /** The backup job creation type. */ + backupJobCreationType?: BackupJobCreationType; + /** The path ID of the backup policy. */ + backupPolicyId?: string; + /** The StorSimple Snapshot Manager host name. */ + ssmHostName?: string; + /** The backup elements. */ + elements: BackupElement[]; +}; -/** - * @interface - * An interface representing SymmetricEncryptedSecret. - * Represents the secrets encrypted using Symmetric Encryption Key. - * - */ -export interface SymmetricEncryptedSecret { - /** - * @member {string} value The value of the secret itself. If the secret is in - * plaintext or null then EncryptionAlgorithm will be none. - */ - value: string; - /** - * @member {string} [valueCertificateThumbprint] The thumbprint of the cert - * that was used to encrypt "Value". - */ - valueCertificateThumbprint?: string; - /** - * @member {EncryptionAlgorithm} encryptionAlgorithm The algorithm used to - * encrypt the "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - */ - encryptionAlgorithm: EncryptionAlgorithm; -} +/** The hardware component group. */ +export type HardwareComponentGroup = BaseModel & { + /** The display name the hardware component group. */ + displayName: string; + /** The last updated time. */ + lastUpdatedTime: Date; + /** The list of hardware components. */ + components: HardwareComponent[]; +}; -/** - * @interface - * An interface representing TimeSettings. - * The time settings of a device. - * - * @extends BaseModel - */ -export interface TimeSettings extends BaseModel { - /** - * @member {string} timeZone The timezone of device, like '(UTC -06:00) - * Central America' - */ +/** The controller power state change request. */ +export type ControllerPowerStateChangeRequest = BaseModel & { + /** The power state that the request is expecting for the controller of the device. */ + action: ControllerPowerStateAction; + /** The active controller that the request is expecting on the device. */ + activeController: ControllerId; + /** The controller 0's status that the request is expecting on the device. */ + controller0State: ControllerStatus; + /** The controller 1's status that the request is expecting on the device. */ + controller1State: ControllerStatus; +}; + +/** The job. */ +export type Job = BaseModel & { + /** The current status of the job. */ + status: JobStatus; + /** The UTC time at which the job was started. */ + startTime?: Date; + /** The UTC time at which the job completed. */ + endTime?: Date; + /** The percentage of the job that is already complete. */ + percentComplete: number; + /** The error details, if any, for the job. */ + error?: JobErrorDetails; + /** The type of the job. */ + jobType?: JobType; + /** The data statistics properties of the job. */ + dataStats?: DataStatistics; + /** The entity identifier for which the job ran. */ + entityLabel?: string; + /** The entity type for which the job ran. */ + entityType?: string; + /** The job stages. */ + jobStages?: JobStage[]; + /** The device ID in which the job ran. */ + deviceId?: string; + /** Represents whether the job is cancellable or not. */ + isCancellable?: boolean; + /** The backup type (CloudSnapshot | LocalSnapshot). Applicable only for backup jobs. */ + backupType?: BackupType; + /** The source device ID of the failover job. */ + sourceDeviceId?: string; + /** The time of the backup used for the failover. */ + backupPointInTime?: Date; +}; + +/** Represents the network settings of a device. */ +export type NetworkSettings = BaseModel & { + /** The DNS (Domain Name System) settings of device. */ + dnsSettings: DNSSettings; + /** The network adapter list of device. */ + networkAdapters: NetworkAdapterList; + /** The webproxy settings of device. */ + webproxySettings: WebproxySettings; +}; + +/** The security settings of a device. */ +export type SecuritySettings = BaseModel & { + /** The settings for remote management of a device. */ + remoteManagementSettings: RemoteManagementSettings; + /** The Challenge-Handshake Authentication Protocol (CHAP) settings. */ + chapSettings: ChapSettings; +}; + +/** The time settings of a device. */ +export type TimeSettings = BaseModel & { + /** The timezone of device, like '(UTC -06:00) Central America' */ timeZone: string; - /** - * @member {string} [primaryTimeServer] The primary Network Time Protocol - * (NTP) server name, like 'time.windows.com'. - */ + /** The primary Network Time Protocol (NTP) server name, like 'time.windows.com'. */ primaryTimeServer?: string; - /** - * @member {string[]} [secondaryTimeServer] The secondary Network Time - * Protocol (NTP) server name, like 'time.contoso.com'. It's optional. - */ + /** The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional. */ secondaryTimeServer?: string[]; -} +}; -/** - * @interface - * An interface representing Updates. - * The updates profile of a device. - * - * @extends BaseModel - */ -export interface Updates extends BaseModel { - /** - * @member {boolean} [regularUpdatesAvailable] Set to 'true' if regular - * updates are available for the device. - */ +/** The updates profile of a device. */ +export type Updates = BaseModel & { + /** Set to 'true' if regular updates are available for the device. */ regularUpdatesAvailable?: boolean; - /** - * @member {boolean} [maintenanceModeUpdatesAvailable] Set to 'true' if - * maintenance mode update available. - */ + /** Set to 'true' if maintenance mode update available. */ maintenanceModeUpdatesAvailable?: boolean; - /** - * @member {boolean} [isUpdateInProgress] Indicates whether an update is in - * progress or not. - */ + /** Indicates whether an update is in progress or not. */ isUpdateInProgress?: boolean; - /** - * @member {Date} [lastUpdatedTime] The time when the last update was - * completed. - */ + /** The time when the last update was completed. */ lastUpdatedTime?: Date; -} - -/** - * @interface - * An interface representing Volume. - * The volume. - * - * @extends BaseModel - */ -export interface Volume extends BaseModel { - /** - * @member {number} sizeInBytes The size of the volume in bytes. - */ - sizeInBytes: number; - /** - * @member {VolumeType} volumeType The type of the volume. Possible values - * include: 'Tiered', 'Archival', 'LocallyPinned' - */ - volumeType: VolumeType; - /** - * @member {string} [volumeContainerId] The ID of the volume container, in - * which this volume is created. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly volumeContainerId?: string; - /** - * @member {string[]} accessControlRecordIds The IDs of the access control - * records, associated with the volume. - */ - accessControlRecordIds: string[]; - /** - * @member {VolumeStatus} volumeStatus The volume status. Possible values - * include: 'Online', 'Offline' - */ - volumeStatus: VolumeStatus; - /** - * @member {OperationStatus} [operationStatus] The operation status on the - * volume. Possible values include: 'None', 'Updating', 'Deleting', - * 'Restoring' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly operationStatus?: OperationStatus; - /** - * @member {BackupStatus} [backupStatus] The backup status of the volume. - * Possible values include: 'Enabled', 'Disabled' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly backupStatus?: BackupStatus; - /** - * @member {MonitoringStatus} monitoringStatus The monitoring status of the - * volume. Possible values include: 'Enabled', 'Disabled' - */ - monitoringStatus: MonitoringStatus; - /** - * @member {string[]} [backupPolicyIds] The IDs of the backup policies, in - * which this volume is part of. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly backupPolicyIds?: string[]; -} +}; -/** - * @interface - * An interface representing VolumeContainer. - * The volume container. - * - * @extends BaseModel - */ -export interface VolumeContainer extends BaseModel { - /** - * @member {AsymmetricEncryptedSecret} [encryptionKey] The key used to - * encrypt data in the volume container. It is required when property - * 'EncryptionStatus' is "Enabled". - */ +/** The volume container. */ +export type VolumeContainer = BaseModel & { + /** The key used to encrypt data in the volume container. It is required when property 'EncryptionStatus' is "Enabled". */ encryptionKey?: AsymmetricEncryptedSecret; /** - * @member {EncryptionStatus} [encryptionStatus] The flag to denote whether - * encryption is enabled or not. Possible values include: 'Enabled', - * 'Disabled' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The flag to denote whether encryption is enabled or not. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly encryptionStatus?: EncryptionStatus; /** - * @member {number} [volumeCount] The number of volumes in the volume - * Container. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The number of volumes in the volume Container. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly volumeCount?: number; - /** - * @member {string} storageAccountCredentialId The path ID of storage account - * associated with the volume container. - */ + /** The path ID of storage account associated with the volume container. */ storageAccountCredentialId: string; /** - * @member {OwnerShipStatus} [ownerShipStatus] The owner ship status of the - * volume container. Only when the status is "NotOwned", the delete operation - * on the volume container is permitted. Possible values include: 'Owned', - * 'NotOwned' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The owner ship status of the volume container. Only when the status is "NotOwned", the delete operation on the volume container is permitted. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly ownerShipStatus?: OwnerShipStatus; - /** - * @member {number} [bandWidthRateInMbps] The bandwidth-rate set on the - * volume container. - */ + /** The bandwidth-rate set on the volume container. */ bandWidthRateInMbps?: number; - /** - * @member {string} [bandwidthSettingId] The ID of the bandwidth setting - * associated with the volume container. - */ + /** The ID of the bandwidth setting associated with the volume container. */ bandwidthSettingId?: string; /** - * @member {number} [totalCloudStorageUsageInBytes] The total cloud storage - * for the volume container. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The total cloud storage for the volume container. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly totalCloudStorageUsageInBytes?: number; -} - -/** - * @interface - * An interface representing ManagersListFeatureSupportStatusOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface ManagersListFeatureSupportStatusOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +}; -/** - * @interface - * An interface representing AlertsListByManagerOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface AlertsListByManagerOptionalParams extends msRest.RequestOptionsBase { +/** The volume. */ +export type Volume = BaseModel & { + /** The size of the volume in bytes. */ + sizeInBytes: number; + /** The type of the volume. */ + volumeType: VolumeType; /** - * @member {string} [filter] OData Filter options + * The ID of the volume container, in which this volume is created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * @interface - * An interface representing DevicesListByManagerOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface DevicesListByManagerOptionalParams extends msRest.RequestOptionsBase { + readonly volumeContainerId?: string; + /** The IDs of the access control records, associated with the volume. */ + accessControlRecordIds: string[]; + /** The volume status. */ + volumeStatus: VolumeStatus; /** - * @member {string} [expand] Specify $expand=details to populate additional - * fields related to the device or $expand=rolloverdetails to populate - * additional fields related to the service data encryption key rollover on - * device + * The operation status on the volume. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; -} - -/** - * @interface - * An interface representing DevicesGetOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface DevicesGetOptionalParams extends msRest.RequestOptionsBase { + readonly operationStatus?: OperationStatus; /** - * @member {string} [expand] Specify $expand=details to populate additional - * fields related to the device or $expand=rolloverdetails to populate - * additional fields related to the service data encryption key rollover on - * device + * The backup status of the volume. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expand?: string; -} - -/** - * @interface - * An interface representing BackupsListByDeviceOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface BackupsListByDeviceOptionalParams extends msRest.RequestOptionsBase { + readonly backupStatus?: BackupStatus; + /** The monitoring status of the volume. */ + monitoringStatus: MonitoringStatus; /** - * @member {string} [filter] OData Filter options + * The IDs of the backup policies, in which this volume is part of. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} + readonly backupPolicyIds?: string[]; +}; -/** - * @interface - * An interface representing JobsListByDeviceOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface JobsListByDeviceOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** The encryption settings. */ +export type EncryptionSettings = BaseModel & { + /** The encryption status to indicates if encryption is enabled or not. */ + encryptionStatus: EncryptionStatus; + /** The key rollover status to indicates if key rollover is required or not. If secret's encryption has been upgraded, then it requires key rollover. */ + keyRolloverStatus: KeyRolloverStatus; +}; -/** - * @interface - * An interface representing JobsListByManagerOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface JobsListByManagerOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [filter] OData Filter options - */ - filter?: string; -} +/** The extended info of the manager. */ +export type ManagerExtendedInfo = BaseModel & { + /** The etag of the resource. */ + etag?: string; + /** The version of the extended info being persisted. */ + version?: string; + /** Represents the CIK of the resource. */ + integrityKey?: string; + /** Represents the CEK of the resource. */ + encryptionKey?: string; + /** Represents the Cert thumbprint that was used to encrypt the CEK. */ + encryptionKeyThumbprint?: string; + /** Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. */ + portalCertificateThumbprint?: string; + /** Represents the encryption algorithm used to encrypt the keys. None - if Key is saved in plain text format. Algorithm name - if key is encrypted */ + algorithm?: string; +}; -/** - * @interface - * An interface representing StorSimple8000SeriesManagementClientOptions. - * @extends AzureServiceClientOptions - */ -export interface StorSimple8000SeriesManagementClientOptions extends AzureServiceClientOptions { +/** The storage account credential. */ +export type StorageAccountCredential = BaseModel & { + /** The storage endpoint */ + endPoint: string; + /** Signifies whether SSL needs to be enabled or not. */ + sslStatus: SslStatus; + /** The details of the storage account password. */ + accessKey?: AsymmetricEncryptedSecret; /** - * @member {string} [baseUri] + * The count of volumes using this storage account credential. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - baseUri?: string; -} + readonly volumesCount?: number; +}; +/** Defines values for ManagerType. */ +export type ManagerType = "GardaV1" | "HelsinkiV1"; +/** Defines values for AlertScope. */ +export type AlertScope = "Resource" | "Device"; +/** Defines values for AlertSourceType. */ +export type AlertSourceType = "Resource" | "Device"; +/** Defines values for AlertSeverity. */ +export type AlertSeverity = "Informational" | "Warning" | "Critical"; +/** Defines values for AlertStatus. */ +export type AlertStatus = "Active" | "Cleared"; +/** Defines values for DayOfWeek. */ +export type DayOfWeek = + | "Sunday" + | "Monday" + | "Tuesday" + | "Wednesday" + | "Thursday" + | "Friday" + | "Saturday"; +/** Defines values for DeviceConfigurationStatus. */ +export type DeviceConfigurationStatus = "Complete" | "Pending"; +/** Defines values for DeviceStatus. */ +export type DeviceStatus = + | "Unknown" + | "Online" + | "Offline" + | "Deactivated" + | "RequiresAttention" + | "MaintenanceMode" + | "Creating" + | "Provisioning" + | "Deactivating" + | "Deleted" + | "ReadyToSetup"; +/** Defines values for DeviceType. */ +export type DeviceType = + | "Invalid" + | "Series8000VirtualAppliance" + | "Series8000PhysicalAppliance"; +/** Defines values for ControllerId. */ +export type ControllerId = "Unknown" | "None" | "Controller0" | "Controller1"; +/** Defines values for VirtualMachineApiType. */ +export type VirtualMachineApiType = "Classic" | "Arm"; +/** Defines values for AuthorizationEligibility. */ +export type AuthorizationEligibility = "InEligible" | "Eligible"; +/** Defines values for AuthorizationStatus. */ +export type AuthorizationStatus = "Disabled" | "Enabled"; +/** Defines values for InEligibilityCategory. */ +export type InEligibilityCategory = + | "DeviceNotOnline" + | "NotSupportedAppliance" + | "RolloverPending"; +/** Defines values for AlertEmailNotificationStatus. */ +export type AlertEmailNotificationStatus = "Enabled" | "Disabled"; +/** Defines values for ScheduledBackupStatus. */ +export type ScheduledBackupStatus = "Disabled" | "Enabled"; +/** Defines values for BackupPolicyCreationType. */ +export type BackupPolicyCreationType = "BySaaS" | "BySSM"; +/** Defines values for RecurrenceType. */ +export type RecurrenceType = "Minutes" | "Hourly" | "Daily" | "Weekly"; +/** Defines values for BackupType. */ +export type BackupType = "LocalSnapshot" | "CloudSnapshot"; +/** Defines values for ScheduleStatus. */ +export type ScheduleStatus = "Enabled" | "Disabled"; +/** Defines values for BackupJobCreationType. */ +export type BackupJobCreationType = "Adhoc" | "BySchedule" | "BySSM"; +/** Defines values for VolumeType. */ +export type VolumeType = "Tiered" | "Archival" | "LocallyPinned"; +/** Defines values for HardwareComponentStatus. */ +export type HardwareComponentStatus = + | "Unknown" + | "NotPresent" + | "PoweredOff" + | "Ok" + | "Recovering" + | "Warning" + | "Failure"; +/** Defines values for ControllerPowerStateAction. */ +export type ControllerPowerStateAction = "Start" | "Restart" | "Shutdown"; +/** Defines values for ControllerStatus. */ +export type ControllerStatus = + | "NotPresent" + | "PoweredOff" + | "Ok" + | "Recovering" + | "Warning" + | "Failure"; +/** Defines values for JobStatus. */ +export type JobStatus = "Running" | "Succeeded" | "Failed" | "Canceled"; +/** Defines values for JobType. */ +export type JobType = + | "ScheduledBackup" + | "ManualBackup" + | "RestoreBackup" + | "CloneVolume" + | "FailoverVolumeContainers" + | "CreateLocallyPinnedVolume" + | "ModifyVolume" + | "InstallUpdates" + | "SupportPackageLogs" + | "CreateCloudAppliance"; +/** Defines values for MetricAggregationType. */ +export type MetricAggregationType = + | "Average" + | "Last" + | "Maximum" + | "Minimum" + | "None" + | "Total"; +/** Defines values for MetricUnit. */ +export type MetricUnit = + | "Bytes" + | "BytesPerSecond" + | "Count" + | "CountPerSecond" + | "Percent" + | "Seconds"; +/** Defines values for NetInterfaceId. */ +export type NetInterfaceId = + | "Invalid" + | "Data0" + | "Data1" + | "Data2" + | "Data3" + | "Data4" + | "Data5"; +/** Defines values for NetInterfaceStatus. */ +export type NetInterfaceStatus = "Enabled" | "Disabled"; +/** Defines values for IscsiAndCloudStatus. */ +export type IscsiAndCloudStatus = + | "Disabled" + | "IscsiEnabled" + | "CloudEnabled" + | "IscsiAndCloudEnabled"; +/** Defines values for NetworkMode. */ +export type NetworkMode = "Invalid" | "IPV4" | "IPV6" | "BOTH"; +/** Defines values for AuthenticationType. */ +export type AuthenticationType = "Invalid" | "None" | "Basic" | "NTLM"; +/** Defines values for RemoteManagementModeConfiguration. */ +export type RemoteManagementModeConfiguration = + | "Unknown" + | "Disabled" + | "HttpsEnabled" + | "HttpsAndHttpEnabled"; +/** Defines values for EncryptionAlgorithm. */ +export type EncryptionAlgorithm = "None" | "AES256" | "RSAES_PKCS1_v_1_5"; +/** Defines values for EncryptionStatus. */ +export type EncryptionStatus = "Enabled" | "Disabled"; +/** Defines values for OwnerShipStatus. */ +export type OwnerShipStatus = "Owned" | "NotOwned"; +/** Defines values for VolumeStatus. */ +export type VolumeStatus = "Online" | "Offline"; +/** Defines values for OperationStatus. */ +export type OperationStatus = "None" | "Updating" | "Deleting" | "Restoring"; +/** Defines values for BackupStatus. */ +export type BackupStatus = "Enabled" | "Disabled"; +/** Defines values for MonitoringStatus. */ +export type MonitoringStatus = "Enabled" | "Disabled"; +/** Defines values for TargetEligibilityStatus. */ +export type TargetEligibilityStatus = "NotEligible" | "Eligible"; +/** Defines values for TargetEligibilityResultCode. */ +export type TargetEligibilityResultCode = + | "TargetAndSourceCannotBeSameError" + | "TargetIsNotOnlineError" + | "TargetSourceIncompatibleVersionError" + | "LocalToTieredVolumesConversionWarning" + | "TargetInsufficientCapacityError" + | "TargetInsufficientLocalVolumeMemoryError" + | "TargetInsufficientTieredVolumeMemoryError"; +/** Defines values for KeyRolloverStatus. */ +export type KeyRolloverStatus = "Required" | "NotRequired"; +/** Defines values for FeatureSupportStatus. */ +export type FeatureSupportStatus = + | "NotAvailable" + | "UnsupportedDeviceVersion" + | "Supported"; +/** Defines values for SslStatus. */ +export type SslStatus = "Enabled" | "Disabled"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = AvailableProviderOperationList; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = AvailableProviderOperationList; + +/** Optional parameters. */ +export interface ManagersListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ManagersListResponse = ManagerList; + +/** Optional parameters. */ +export interface ManagersListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ManagersListByResourceGroupResponse = ManagerList; + +/** Optional parameters. */ +export interface ManagersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ManagersGetResponse = Manager; + +/** Optional parameters. */ +export interface ManagersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ManagersCreateOrUpdateResponse = Manager; + +/** Optional parameters. */ +export interface ManagersDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ManagersUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ManagersUpdateResponse = Manager; + +/** Optional parameters. */ +export interface ManagersGetDevicePublicEncryptionKeyOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getDevicePublicEncryptionKey operation. */ +export type ManagersGetDevicePublicEncryptionKeyResponse = PublicKey; + +/** Optional parameters. */ +export interface ManagersGetEncryptionSettingsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getEncryptionSettings operation. */ +export type ManagersGetEncryptionSettingsResponse = EncryptionSettings; + +/** Optional parameters. */ +export interface ManagersGetExtendedInfoOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getExtendedInfo operation. */ +export type ManagersGetExtendedInfoResponse = ManagerExtendedInfo; + +/** Optional parameters. */ +export interface ManagersCreateExtendedInfoOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createExtendedInfo operation. */ +export type ManagersCreateExtendedInfoResponse = ManagerExtendedInfo; + +/** Optional parameters. */ +export interface ManagersDeleteExtendedInfoOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ManagersUpdateExtendedInfoOptionalParams + extends coreClient.OperationOptions {} +/** Contains response data for the updateExtendedInfo operation. */ +export type ManagersUpdateExtendedInfoResponse = ManagerExtendedInfo; -/** - * @interface - * An interface representing the AvailableProviderOperationList. - * List of available provider operations. - * - * @extends Array - */ -export interface AvailableProviderOperationList extends Array { - /** - * @member {string} [nextLink] The NextLink. - */ - nextLink?: string; +/** Optional parameters. */ +export interface ManagersListFeatureSupportStatusOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; } -/** - * @interface - * An interface representing the ManagerList. - * The list of StorSimple Managers. - * - * @extends Array - */ -export interface ManagerList extends Array { -} +/** Contains response data for the listFeatureSupportStatus operation. */ +export type ManagersListFeatureSupportStatusResponse = FeatureList; -/** - * @interface - * An interface representing the FeatureList. - * The collections of features. - * - * @extends Array - */ -export interface FeatureList extends Array { -} +/** Optional parameters. */ +export interface ManagersGetActivationKeyOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the MetricList. - * The metric list. - * - * @extends Array - */ -export interface MetricList extends Array { -} +/** Contains response data for the getActivationKey operation. */ +export type ManagersGetActivationKeyResponse = Key; -/** - * @interface - * An interface representing the MetricDefinitionList. - * The list of metric definitions. - * - * @extends Array - */ -export interface MetricDefinitionList extends Array { -} +/** Optional parameters. */ +export interface ManagersGetPublicEncryptionKeyOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the AccessControlRecordList. - * The collection of access control records. - * - * @extends Array - */ -export interface AccessControlRecordList extends Array { -} +/** Contains response data for the getPublicEncryptionKey operation. */ +export type ManagersGetPublicEncryptionKeyResponse = SymmetricEncryptedSecret; -/** - * @interface - * An interface representing the AlertList. - * The collection of alerts. - * - * @extends Array - */ -export interface AlertList extends Array { - /** - * @member {string} [nextLink] The URI of the next page of alerts. - */ - nextLink?: string; -} +/** Optional parameters. */ +export interface ManagersListMetricsOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the BandwidthSettingList. - * The collection of bandwidth setting entities. - * - * @extends Array - */ -export interface BandwidthSettingList extends Array { -} +/** Contains response data for the listMetrics operation. */ +export type ManagersListMetricsResponse = MetricList; -/** - * @interface - * An interface representing the CloudApplianceConfigurationList. - * The cloud appliance configuration list - * - * @extends Array - */ -export interface CloudApplianceConfigurationList extends Array { -} +/** Optional parameters. */ +export interface ManagersListMetricDefinitionOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the DeviceList. - * The collection of devices. - * - * @extends Array - */ -export interface DeviceList extends Array { -} +/** Contains response data for the listMetricDefinition operation. */ +export type ManagersListMetricDefinitionResponse = MetricDefinitionList; -/** - * @interface - * An interface representing the FailoverSetsList. - * The list of failover sets. - * - * @extends Array - */ -export interface FailoverSetsList extends Array { -} +/** Optional parameters. */ +export interface ManagersRegenerateActivationKeyOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the FailoverTargetsList. - * The list of all devices in a resource and their eligibility status as a - * failover target device. - * - * @extends Array - */ -export interface FailoverTargetsList extends Array { -} +/** Contains response data for the regenerateActivationKey operation. */ +export type ManagersRegenerateActivationKeyResponse = Key; -/** - * @interface - * An interface representing the BackupPolicyList. - * The collection of backup policies. - * - * @extends Array - */ -export interface BackupPolicyList extends Array { -} +/** Optional parameters. */ +export interface AccessControlRecordsListByManagerOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the BackupScheduleList. - * The backup schedule list. - * - * @extends Array - */ -export interface BackupScheduleList extends Array { -} +/** Contains response data for the listByManager operation. */ +export type AccessControlRecordsListByManagerResponse = AccessControlRecordList; -/** - * @interface - * An interface representing the BackupList. - * The collection of backups. - * - * @extends Array - */ -export interface BackupList extends Array { - /** - * @member {string} [nextLink] The NextLink. - */ - nextLink?: string; -} +/** Optional parameters. */ +export interface AccessControlRecordsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the HardwareComponentGroupList. - * The collection of hardware component groups. - * - * @extends Array - */ -export interface HardwareComponentGroupList extends Array { -} +/** Contains response data for the get operation. */ +export type AccessControlRecordsGetResponse = AccessControlRecord; -/** - * @interface - * An interface representing the JobList. - * The collection of jobs. - * - * @extends Array - */ -export interface JobList extends Array { - /** - * @member {string} [nextLink] The NextLink. - */ - nextLink?: string; +/** Optional parameters. */ +export interface AccessControlRecordsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * An interface representing the VolumeContainerList. - * The collection of volume container entities. - * - * @extends Array - */ -export interface VolumeContainerList extends Array { -} +/** Contains response data for the createOrUpdate operation. */ +export type AccessControlRecordsCreateOrUpdateResponse = AccessControlRecord; -/** - * @interface - * An interface representing the VolumeList. - * The collection of volumes. - * - * @extends Array - */ -export interface VolumeList extends Array { +/** Optional parameters. */ +export interface AccessControlRecordsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * An interface representing the StorageAccountCredentialList. - * The collection of storage account credential entities. - * - * @extends Array - */ -export interface StorageAccountCredentialList extends Array { +/** Optional parameters. */ +export interface AlertsListByManagerOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; } -/** - * Defines values for AlertScope. - * Possible values include: 'Resource', 'Device' - * @readonly - * @enum {string} - */ -export type AlertScope = 'Resource' | 'Device'; - -/** - * Defines values for AlertSourceType. - * Possible values include: 'Resource', 'Device' - * @readonly - * @enum {string} - */ -export type AlertSourceType = 'Resource' | 'Device'; - -/** - * Defines values for AlertSeverity. - * Possible values include: 'Informational', 'Warning', 'Critical' - * @readonly - * @enum {string} - */ -export type AlertSeverity = 'Informational' | 'Warning' | 'Critical'; - -/** - * Defines values for AlertStatus. - * Possible values include: 'Active', 'Cleared' - * @readonly - * @enum {string} - */ -export type AlertStatus = 'Active' | 'Cleared'; +/** Contains response data for the listByManager operation. */ +export type AlertsListByManagerResponse = AlertList; -/** - * Defines values for AlertEmailNotificationStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type AlertEmailNotificationStatus = 'Enabled' | 'Disabled'; +/** Optional parameters. */ +export interface AlertsClearOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for EncryptionAlgorithm. - * Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' - * @readonly - * @enum {string} - */ -export type EncryptionAlgorithm = 'None' | 'AES256' | 'RSAES_PKCS1_v_1_5'; +/** Optional parameters. */ +export interface AlertsSendTestEmailOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for BackupType. - * Possible values include: 'LocalSnapshot', 'CloudSnapshot' - * @readonly - * @enum {string} - */ -export type BackupType = 'LocalSnapshot' | 'CloudSnapshot'; +/** Optional parameters. */ +export interface AlertsListByManagerNextOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Defines values for BackupJobCreationType. - * Possible values include: 'Adhoc', 'BySchedule', 'BySSM' - * @readonly - * @enum {string} - */ -export type BackupJobCreationType = 'Adhoc' | 'BySchedule' | 'BySSM'; +/** Contains response data for the listByManagerNext operation. */ +export type AlertsListByManagerNextResponse = AlertList; -/** - * Defines values for VolumeType. - * Possible values include: 'Tiered', 'Archival', 'LocallyPinned' - * @readonly - * @enum {string} - */ -export type VolumeType = 'Tiered' | 'Archival' | 'LocallyPinned'; +/** Optional parameters. */ +export interface BandwidthSettingsListByManagerOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ScheduledBackupStatus. - * Possible values include: 'Disabled', 'Enabled' - * @readonly - * @enum {string} - */ -export type ScheduledBackupStatus = 'Disabled' | 'Enabled'; +/** Contains response data for the listByManager operation. */ +export type BandwidthSettingsListByManagerResponse = BandwidthSettingList; -/** - * Defines values for BackupPolicyCreationType. - * Possible values include: 'BySaaS', 'BySSM' - * @readonly - * @enum {string} - */ -export type BackupPolicyCreationType = 'BySaaS' | 'BySSM'; +/** Optional parameters. */ +export interface BandwidthSettingsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for RecurrenceType. - * Possible values include: 'Minutes', 'Hourly', 'Daily', 'Weekly' - * @readonly - * @enum {string} - */ -export type RecurrenceType = 'Minutes' | 'Hourly' | 'Daily' | 'Weekly'; - -/** - * Defines values for DayOfWeek. - * Possible values include: 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', - * 'Saturday' - * @readonly - * @enum {string} - */ -export type DayOfWeek = 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday'; +/** Contains response data for the get operation. */ +export type BandwidthSettingsGetResponse = BandwidthSetting; -/** - * Defines values for ScheduleStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type ScheduleStatus = 'Enabled' | 'Disabled'; +/** Optional parameters. */ +export interface BandwidthSettingsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for Kind. - * Possible values include: 'Series8000' - * @readonly - * @enum {string} - */ -export type Kind = 'Series8000'; +/** Contains response data for the createOrUpdate operation. */ +export type BandwidthSettingsCreateOrUpdateResponse = BandwidthSetting; -/** - * Defines values for ControllerPowerStateAction. - * Possible values include: 'Start', 'Restart', 'Shutdown' - * @readonly - * @enum {string} - */ -export type ControllerPowerStateAction = 'Start' | 'Restart' | 'Shutdown'; +/** Optional parameters. */ +export interface BandwidthSettingsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for ControllerId. - * Possible values include: 'Unknown', 'None', 'Controller0', 'Controller1' - * @readonly - * @enum {string} - */ -export type ControllerId = 'Unknown' | 'None' | 'Controller0' | 'Controller1'; +/** Optional parameters. */ +export interface CloudAppliancesListSupportedConfigurationsOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ControllerStatus. - * Possible values include: 'NotPresent', 'PoweredOff', 'Ok', 'Recovering', 'Warning', 'Failure' - * @readonly - * @enum {string} - */ -export type ControllerStatus = 'NotPresent' | 'PoweredOff' | 'Ok' | 'Recovering' | 'Warning' | 'Failure'; +/** Contains response data for the listSupportedConfigurations operation. */ +export type CloudAppliancesListSupportedConfigurationsResponse = CloudApplianceConfigurationList; -/** - * Defines values for DeviceConfigurationStatus. - * Possible values include: 'Complete', 'Pending' - * @readonly - * @enum {string} - */ -export type DeviceConfigurationStatus = 'Complete' | 'Pending'; - -/** - * Defines values for DeviceStatus. - * Possible values include: 'Unknown', 'Online', 'Offline', 'Deactivated', 'RequiresAttention', - * 'MaintenanceMode', 'Creating', 'Provisioning', 'Deactivating', 'Deleted', 'ReadyToSetup' - * @readonly - * @enum {string} - */ -export type DeviceStatus = 'Unknown' | 'Online' | 'Offline' | 'Deactivated' | 'RequiresAttention' | 'MaintenanceMode' | 'Creating' | 'Provisioning' | 'Deactivating' | 'Deleted' | 'ReadyToSetup'; +/** Optional parameters. */ +export interface CloudAppliancesProvisionOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for DeviceType. - * Possible values include: 'Invalid', 'Series8000VirtualAppliance', 'Series8000PhysicalAppliance' - * @readonly - * @enum {string} - */ -export type DeviceType = 'Invalid' | 'Series8000VirtualAppliance' | 'Series8000PhysicalAppliance'; +/** Optional parameters. */ +export interface DevicesConfigureOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for VirtualMachineApiType. - * Possible values include: 'Classic', 'Arm' - * @readonly - * @enum {string} - */ -export type VirtualMachineApiType = 'Classic' | 'Arm'; +/** Optional parameters. */ +export interface DevicesListByManagerOptionalParams + extends coreClient.OperationOptions { + /** Specify $expand=details to populate additional fields related to the device or $expand=rolloverdetails to populate additional fields related to the service data encryption key rollover on device */ + expand?: string; +} -/** - * Defines values for AuthorizationEligibility. - * Possible values include: 'InEligible', 'Eligible' - * @readonly - * @enum {string} - */ -export type AuthorizationEligibility = 'InEligible' | 'Eligible'; +/** Contains response data for the listByManager operation. */ +export type DevicesListByManagerResponse = DeviceList; -/** - * Defines values for AuthorizationStatus. - * Possible values include: 'Disabled', 'Enabled' - * @readonly - * @enum {string} - */ -export type AuthorizationStatus = 'Disabled' | 'Enabled'; +/** Optional parameters. */ +export interface DevicesGetOptionalParams extends coreClient.OperationOptions { + /** Specify $expand=details to populate additional fields related to the device or $expand=rolloverdetails to populate additional fields related to the service data encryption key rollover on device */ + expand?: string; +} -/** - * Defines values for InEligibilityCategory. - * Possible values include: 'DeviceNotOnline', 'NotSupportedAppliance', 'RolloverPending' - * @readonly - * @enum {string} - */ -export type InEligibilityCategory = 'DeviceNotOnline' | 'NotSupportedAppliance' | 'RolloverPending'; +/** Contains response data for the get operation. */ +export type DevicesGetResponse = Device; -/** - * Defines values for EncryptionStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type EncryptionStatus = 'Enabled' | 'Disabled'; +/** Optional parameters. */ +export interface DevicesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for KeyRolloverStatus. - * Possible values include: 'Required', 'NotRequired' - * @readonly - * @enum {string} - */ -export type KeyRolloverStatus = 'Required' | 'NotRequired'; +/** Optional parameters. */ +export interface DevicesUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for TargetEligibilityStatus. - * Possible values include: 'NotEligible', 'Eligible' - * @readonly - * @enum {string} - */ -export type TargetEligibilityStatus = 'NotEligible' | 'Eligible'; - -/** - * Defines values for TargetEligibilityResultCode. - * Possible values include: 'TargetAndSourceCannotBeSameError', 'TargetIsNotOnlineError', - * 'TargetSourceIncompatibleVersionError', 'LocalToTieredVolumesConversionWarning', - * 'TargetInsufficientCapacityError', 'TargetInsufficientLocalVolumeMemoryError', - * 'TargetInsufficientTieredVolumeMemoryError' - * @readonly - * @enum {string} - */ -export type TargetEligibilityResultCode = 'TargetAndSourceCannotBeSameError' | 'TargetIsNotOnlineError' | 'TargetSourceIncompatibleVersionError' | 'LocalToTieredVolumesConversionWarning' | 'TargetInsufficientCapacityError' | 'TargetInsufficientLocalVolumeMemoryError' | 'TargetInsufficientTieredVolumeMemoryError'; +/** Contains response data for the update operation. */ +export type DevicesUpdateResponse = Device; -/** - * Defines values for FeatureSupportStatus. - * Possible values include: 'NotAvailable', 'UnsupportedDeviceVersion', 'Supported' - * @readonly - * @enum {string} - */ -export type FeatureSupportStatus = 'NotAvailable' | 'UnsupportedDeviceVersion' | 'Supported'; - -/** - * Defines values for HardwareComponentStatus. - * Possible values include: 'Unknown', 'NotPresent', 'PoweredOff', 'Ok', 'Recovering', 'Warning', - * 'Failure' - * @readonly - * @enum {string} - */ -export type HardwareComponentStatus = 'Unknown' | 'NotPresent' | 'PoweredOff' | 'Ok' | 'Recovering' | 'Warning' | 'Failure'; +/** Optional parameters. */ +export interface DevicesAuthorizeForServiceEncryptionKeyRolloverOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for JobStatus. - * Possible values include: 'Running', 'Succeeded', 'Failed', 'Canceled' - * @readonly - * @enum {string} - */ -export type JobStatus = 'Running' | 'Succeeded' | 'Failed' | 'Canceled'; - -/** - * Defines values for JobType. - * Possible values include: 'ScheduledBackup', 'ManualBackup', 'RestoreBackup', 'CloneVolume', - * 'FailoverVolumeContainers', 'CreateLocallyPinnedVolume', 'ModifyVolume', 'InstallUpdates', - * 'SupportPackageLogs', 'CreateCloudAppliance' - * @readonly - * @enum {string} - */ -export type JobType = 'ScheduledBackup' | 'ManualBackup' | 'RestoreBackup' | 'CloneVolume' | 'FailoverVolumeContainers' | 'CreateLocallyPinnedVolume' | 'ModifyVolume' | 'InstallUpdates' | 'SupportPackageLogs' | 'CreateCloudAppliance'; +/** Optional parameters. */ +export interface DevicesDeactivateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for ManagerType. - * Possible values include: 'GardaV1', 'HelsinkiV1' - * @readonly - * @enum {string} - */ -export type ManagerType = 'GardaV1' | 'HelsinkiV1'; - -/** - * Defines values for MetricUnit. - * Possible values include: 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', - * 'Seconds' - * @readonly - * @enum {string} - */ -export type MetricUnit = 'Bytes' | 'BytesPerSecond' | 'Count' | 'CountPerSecond' | 'Percent' | 'Seconds'; +/** Optional parameters. */ +export interface DevicesInstallUpdatesOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for MetricAggregationType. - * Possible values include: 'Average', 'Last', 'Maximum', 'Minimum', 'None', 'Total' - * @readonly - * @enum {string} - */ -export type MetricAggregationType = 'Average' | 'Last' | 'Maximum' | 'Minimum' | 'None' | 'Total'; +/** Optional parameters. */ +export interface DevicesListFailoverSetsOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for NetInterfaceId. - * Possible values include: 'Invalid', 'Data0', 'Data1', 'Data2', 'Data3', 'Data4', 'Data5' - * @readonly - * @enum {string} - */ -export type NetInterfaceId = 'Invalid' | 'Data0' | 'Data1' | 'Data2' | 'Data3' | 'Data4' | 'Data5'; +/** Contains response data for the listFailoverSets operation. */ +export type DevicesListFailoverSetsResponse = FailoverSetsList; -/** - * Defines values for NetInterfaceStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type NetInterfaceStatus = 'Enabled' | 'Disabled'; +/** Optional parameters. */ +export interface DevicesListMetricsOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ISCSIAndCloudStatus. - * Possible values include: 'Disabled', 'IscsiEnabled', 'CloudEnabled', 'IscsiAndCloudEnabled' - * @readonly - * @enum {string} - */ -export type ISCSIAndCloudStatus = 'Disabled' | 'IscsiEnabled' | 'CloudEnabled' | 'IscsiAndCloudEnabled'; +/** Contains response data for the listMetrics operation. */ +export type DevicesListMetricsResponse = MetricList; -/** - * Defines values for NetworkMode. - * Possible values include: 'Invalid', 'IPV4', 'IPV6', 'BOTH' - * @readonly - * @enum {string} - */ -export type NetworkMode = 'Invalid' | 'IPV4' | 'IPV6' | 'BOTH'; +/** Optional parameters. */ +export interface DevicesListMetricDefinitionOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for AuthenticationType. - * Possible values include: 'Invalid', 'None', 'Basic', 'NTLM' - * @readonly - * @enum {string} - */ -export type AuthenticationType = 'Invalid' | 'None' | 'Basic' | 'NTLM'; +/** Contains response data for the listMetricDefinition operation. */ +export type DevicesListMetricDefinitionResponse = MetricDefinitionList; -/** - * Defines values for RemoteManagementModeConfiguration. - * Possible values include: 'Unknown', 'Disabled', 'HttpsEnabled', 'HttpsAndHttpEnabled' - * @readonly - * @enum {string} - */ -export type RemoteManagementModeConfiguration = 'Unknown' | 'Disabled' | 'HttpsEnabled' | 'HttpsAndHttpEnabled'; +/** Optional parameters. */ +export interface DevicesScanForUpdatesOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for SslStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type SslStatus = 'Enabled' | 'Disabled'; +/** Optional parameters. */ +export interface DevicesGetUpdateSummaryOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for VolumeStatus. - * Possible values include: 'Online', 'Offline' - * @readonly - * @enum {string} - */ -export type VolumeStatus = 'Online' | 'Offline'; +/** Contains response data for the getUpdateSummary operation. */ +export type DevicesGetUpdateSummaryResponse = Updates; -/** - * Defines values for OperationStatus. - * Possible values include: 'None', 'Updating', 'Deleting', 'Restoring' - * @readonly - * @enum {string} - */ -export type OperationStatus = 'None' | 'Updating' | 'Deleting' | 'Restoring'; +/** Optional parameters. */ +export interface DevicesFailoverOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for BackupStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type BackupStatus = 'Enabled' | 'Disabled'; +/** Optional parameters. */ +export interface DevicesListFailoverTargetsOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for MonitoringStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type MonitoringStatus = 'Enabled' | 'Disabled'; +/** Contains response data for the listFailoverTargets operation. */ +export type DevicesListFailoverTargetsResponse = FailoverTargetsList; -/** - * Defines values for OwnerShipStatus. - * Possible values include: 'Owned', 'NotOwned' - * @readonly - * @enum {string} - */ -export type OwnerShipStatus = 'Owned' | 'NotOwned'; +/** Optional parameters. */ +export interface DeviceSettingsGetAlertSettingsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = AvailableProviderOperationList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AvailableProviderOperationList; - }; -}; +/** Contains response data for the getAlertSettings operation. */ +export type DeviceSettingsGetAlertSettingsResponse = AlertSettings; -/** - * Contains response data for the listNext operation. - */ -export type OperationsListNextResponse = AvailableProviderOperationList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AvailableProviderOperationList; - }; -}; +/** Optional parameters. */ +export interface DeviceSettingsCreateOrUpdateAlertSettingsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the list operation. - */ -export type ManagersListResponse = ManagerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagerList; - }; -}; +/** Contains response data for the createOrUpdateAlertSettings operation. */ +export type DeviceSettingsCreateOrUpdateAlertSettingsResponse = AlertSettings; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ManagersListByResourceGroupResponse = ManagerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagerList; - }; -}; +/** Optional parameters. */ +export interface DeviceSettingsGetNetworkSettingsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ManagersGetResponse = Manager & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Manager; - }; -}; +/** Contains response data for the getNetworkSettings operation. */ +export type DeviceSettingsGetNetworkSettingsResponse = NetworkSettings; -/** - * Contains response data for the createOrUpdate operation. - */ -export type ManagersCreateOrUpdateResponse = Manager & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Manager; - }; -}; +/** Optional parameters. */ +export interface DeviceSettingsUpdateNetworkSettingsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the update operation. - */ -export type ManagersUpdateResponse = Manager & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Manager; - }; -}; +/** Contains response data for the updateNetworkSettings operation. */ +export type DeviceSettingsUpdateNetworkSettingsResponse = NetworkSettings; -/** - * Contains response data for the getDevicePublicEncryptionKey operation. - */ -export type ManagersGetDevicePublicEncryptionKeyResponse = PublicKey & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PublicKey; - }; -}; +/** Optional parameters. */ +export interface DeviceSettingsGetSecuritySettingsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getEncryptionSettings operation. - */ -export type ManagersGetEncryptionSettingsResponse = EncryptionSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: EncryptionSettings; - }; -}; +/** Contains response data for the getSecuritySettings operation. */ +export type DeviceSettingsGetSecuritySettingsResponse = SecuritySettings; -/** - * Contains response data for the getExtendedInfo operation. - */ -export type ManagersGetExtendedInfoResponse = ManagerExtendedInfo & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagerExtendedInfo; - }; -}; +/** Optional parameters. */ +export interface DeviceSettingsUpdateSecuritySettingsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the createExtendedInfo operation. - */ -export type ManagersCreateExtendedInfoResponse = ManagerExtendedInfo & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagerExtendedInfo; - }; -}; +/** Contains response data for the updateSecuritySettings operation. */ +export type DeviceSettingsUpdateSecuritySettingsResponse = SecuritySettings; -/** - * Contains response data for the updateExtendedInfo operation. - */ -export type ManagersUpdateExtendedInfoResponse = ManagerExtendedInfo & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ManagerExtendedInfo; - }; -}; +/** Optional parameters. */ +export interface DeviceSettingsSyncRemotemanagementCertificateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listFeatureSupportStatus operation. - */ -export type ManagersListFeatureSupportStatusResponse = FeatureList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FeatureList; - }; -}; +/** Optional parameters. */ +export interface DeviceSettingsGetTimeSettingsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getActivationKey operation. - */ -export type ManagersGetActivationKeyResponse = Key & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Key; - }; -}; +/** Contains response data for the getTimeSettings operation. */ +export type DeviceSettingsGetTimeSettingsResponse = TimeSettings; -/** - * Contains response data for the getPublicEncryptionKey operation. - */ -export type ManagersGetPublicEncryptionKeyResponse = SymmetricEncryptedSecret & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SymmetricEncryptedSecret; - }; -}; +/** Optional parameters. */ +export interface DeviceSettingsCreateOrUpdateTimeSettingsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listMetrics operation. - */ -export type ManagersListMetricsResponse = MetricList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricList; - }; -}; +/** Contains response data for the createOrUpdateTimeSettings operation. */ +export type DeviceSettingsCreateOrUpdateTimeSettingsResponse = TimeSettings; -/** - * Contains response data for the listMetricDefinition operation. - */ -export type ManagersListMetricDefinitionResponse = MetricDefinitionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricDefinitionList; - }; -}; +/** Optional parameters. */ +export interface BackupPoliciesListByDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the regenerateActivationKey operation. - */ -export type ManagersRegenerateActivationKeyResponse = Key & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Key; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type BackupPoliciesListByDeviceResponse = BackupPolicyList; -/** - * Contains response data for the listByManager operation. - */ -export type AccessControlRecordsListByManagerResponse = AccessControlRecordList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessControlRecordList; - }; -}; +/** Optional parameters. */ +export interface BackupPoliciesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type AccessControlRecordsGetResponse = AccessControlRecord & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessControlRecord; - }; -}; +/** Contains response data for the get operation. */ +export type BackupPoliciesGetResponse = BackupPolicy; -/** - * Contains response data for the createOrUpdate operation. - */ -export type AccessControlRecordsCreateOrUpdateResponse = AccessControlRecord & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessControlRecord; - }; -}; +/** Optional parameters. */ +export interface BackupPoliciesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type AccessControlRecordsBeginCreateOrUpdateResponse = AccessControlRecord & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessControlRecord; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type BackupPoliciesCreateOrUpdateResponse = BackupPolicy; -/** - * Contains response data for the listByManager operation. - */ -export type AlertsListByManagerResponse = AlertList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertList; - }; -}; +/** Optional parameters. */ +export interface BackupPoliciesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByManagerNext operation. - */ -export type AlertsListByManagerNextResponse = AlertList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertList; - }; -}; +/** Optional parameters. */ +export interface BackupPoliciesBackupNowOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByManager operation. - */ -export type BandwidthSettingsListByManagerResponse = BandwidthSettingList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BandwidthSettingList; - }; -}; +/** Optional parameters. */ +export interface BackupSchedulesListByBackupPolicyOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type BandwidthSettingsGetResponse = BandwidthSetting & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BandwidthSetting; - }; -}; +/** Contains response data for the listByBackupPolicy operation. */ +export type BackupSchedulesListByBackupPolicyResponse = BackupScheduleList; -/** - * Contains response data for the createOrUpdate operation. - */ -export type BandwidthSettingsCreateOrUpdateResponse = BandwidthSetting & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BandwidthSetting; - }; -}; +/** Optional parameters. */ +export interface BackupSchedulesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type BandwidthSettingsBeginCreateOrUpdateResponse = BandwidthSetting & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BandwidthSetting; - }; -}; +/** Contains response data for the get operation. */ +export type BackupSchedulesGetResponse = BackupSchedule; -/** - * Contains response data for the listSupportedConfigurations operation. - */ -export type CloudAppliancesListSupportedConfigurationsResponse = CloudApplianceConfigurationList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CloudApplianceConfigurationList; - }; -}; +/** Optional parameters. */ +export interface BackupSchedulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByManager operation. - */ -export type DevicesListByManagerResponse = DeviceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: DeviceList; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type BackupSchedulesCreateOrUpdateResponse = BackupSchedule; -/** - * Contains response data for the get operation. - */ -export type DevicesGetResponse = Device & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Device; - }; -}; +/** Optional parameters. */ +export interface BackupSchedulesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the update operation. - */ -export type DevicesUpdateResponse = Device & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Device; - }; -}; +/** Optional parameters. */ +export interface BackupsListByDeviceOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the listFailoverSets operation. - */ -export type DevicesListFailoverSetsResponse = FailoverSetsList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FailoverSetsList; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type BackupsListByDeviceResponse = BackupList; -/** - * Contains response data for the listMetrics operation. - */ -export type DevicesListMetricsResponse = MetricList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricList; - }; -}; +/** Optional parameters. */ +export interface BackupsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listMetricDefinition operation. - */ -export type DevicesListMetricDefinitionResponse = MetricDefinitionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricDefinitionList; - }; -}; +/** Optional parameters. */ +export interface BackupsCloneOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the getUpdateSummary operation. - */ -export type DevicesGetUpdateSummaryResponse = Updates & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Updates; - }; -}; +/** Optional parameters. */ +export interface BackupsRestoreOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listFailoverTargets operation. - */ -export type DevicesListFailoverTargetsResponse = FailoverTargetsList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: FailoverTargetsList; - }; -}; +/** Optional parameters. */ +export interface BackupsListByDeviceNextOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the getAlertSettings operation. - */ -export type DeviceSettingsGetAlertSettingsResponse = AlertSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertSettings; - }; -}; +/** Contains response data for the listByDeviceNext operation. */ +export type BackupsListByDeviceNextResponse = BackupList; -/** - * Contains response data for the createOrUpdateAlertSettings operation. - */ -export type DeviceSettingsCreateOrUpdateAlertSettingsResponse = AlertSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertSettings; - }; -}; +/** Optional parameters. */ +export interface HardwareComponentGroupsListByDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getNetworkSettings operation. - */ -export type DeviceSettingsGetNetworkSettingsResponse = NetworkSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: NetworkSettings; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type HardwareComponentGroupsListByDeviceResponse = HardwareComponentGroupList; -/** - * Contains response data for the updateNetworkSettings operation. - */ -export type DeviceSettingsUpdateNetworkSettingsResponse = NetworkSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: NetworkSettings; - }; -}; +/** Optional parameters. */ +export interface HardwareComponentGroupsChangeControllerPowerStateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the getSecuritySettings operation. - */ -export type DeviceSettingsGetSecuritySettingsResponse = SecuritySettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SecuritySettings; - }; -}; +/** Optional parameters. */ +export interface JobsListByDeviceOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the updateSecuritySettings operation. - */ -export type DeviceSettingsUpdateSecuritySettingsResponse = SecuritySettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SecuritySettings; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type JobsListByDeviceResponse = JobList; -/** - * Contains response data for the getTimeSettings operation. - */ -export type DeviceSettingsGetTimeSettingsResponse = TimeSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TimeSettings; - }; -}; +/** Optional parameters. */ +export interface JobsGetOptionalParams extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdateTimeSettings operation. - */ -export type DeviceSettingsCreateOrUpdateTimeSettingsResponse = TimeSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TimeSettings; - }; -}; +/** Contains response data for the get operation. */ +export type JobsGetResponse = Job; -/** - * Contains response data for the beginCreateOrUpdateAlertSettings operation. - */ -export type DeviceSettingsBeginCreateOrUpdateAlertSettingsResponse = AlertSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertSettings; - }; -}; +/** Optional parameters. */ +export interface JobsCancelOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the beginUpdateNetworkSettings operation. - */ -export type DeviceSettingsBeginUpdateNetworkSettingsResponse = NetworkSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: NetworkSettings; - }; -}; +/** Optional parameters. */ +export interface JobsListByManagerOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the beginUpdateSecuritySettings operation. - */ -export type DeviceSettingsBeginUpdateSecuritySettingsResponse = SecuritySettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SecuritySettings; - }; -}; +/** Contains response data for the listByManager operation. */ +export type JobsListByManagerResponse = JobList; -/** - * Contains response data for the beginCreateOrUpdateTimeSettings operation. - */ -export type DeviceSettingsBeginCreateOrUpdateTimeSettingsResponse = TimeSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TimeSettings; - }; -}; +/** Optional parameters. */ +export interface JobsListByDeviceNextOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the listByDevice operation. - */ -export type BackupPoliciesListByDeviceResponse = BackupPolicyList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupPolicyList; - }; -}; +/** Contains response data for the listByDeviceNext operation. */ +export type JobsListByDeviceNextResponse = JobList; -/** - * Contains response data for the get operation. - */ -export type BackupPoliciesGetResponse = BackupPolicy & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupPolicy; - }; -}; +/** Optional parameters. */ +export interface JobsListByManagerNextOptionalParams + extends coreClient.OperationOptions { + /** OData Filter options */ + filter?: string; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type BackupPoliciesCreateOrUpdateResponse = BackupPolicy & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupPolicy; - }; -}; +/** Contains response data for the listByManagerNext operation. */ +export type JobsListByManagerNextResponse = JobList; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type BackupPoliciesBeginCreateOrUpdateResponse = BackupPolicy & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupPolicy; - }; -}; +/** Optional parameters. */ +export interface VolumeContainersListByDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByBackupPolicy operation. - */ -export type BackupSchedulesListByBackupPolicyResponse = BackupScheduleList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupScheduleList; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type VolumeContainersListByDeviceResponse = VolumeContainerList; -/** - * Contains response data for the get operation. - */ -export type BackupSchedulesGetResponse = BackupSchedule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupSchedule; - }; -}; +/** Optional parameters. */ +export interface VolumeContainersGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type BackupSchedulesCreateOrUpdateResponse = BackupSchedule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupSchedule; - }; -}; +/** Contains response data for the get operation. */ +export type VolumeContainersGetResponse = VolumeContainer; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type BackupSchedulesBeginCreateOrUpdateResponse = BackupSchedule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupSchedule; - }; -}; +/** Optional parameters. */ +export interface VolumeContainersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByDevice operation. - */ -export type BackupsListByDeviceResponse = BackupList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupList; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type VolumeContainersCreateOrUpdateResponse = VolumeContainer; -/** - * Contains response data for the listByDeviceNext operation. - */ -export type BackupsListByDeviceNextResponse = BackupList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupList; - }; -}; +/** Optional parameters. */ +export interface VolumeContainersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByDevice operation. - */ -export type HardwareComponentGroupsListByDeviceResponse = HardwareComponentGroupList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: HardwareComponentGroupList; - }; -}; +/** Optional parameters. */ +export interface VolumeContainersListMetricsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByDevice operation. - */ -export type JobsListByDeviceResponse = JobList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobList; - }; -}; +/** Contains response data for the listMetrics operation. */ +export type VolumeContainersListMetricsResponse = MetricList; -/** - * Contains response data for the get operation. - */ -export type JobsGetResponse = Job & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Job; - }; -}; +/** Optional parameters. */ +export interface VolumeContainersListMetricDefinitionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByManager operation. - */ -export type JobsListByManagerResponse = JobList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobList; - }; -}; +/** Contains response data for the listMetricDefinition operation. */ +export type VolumeContainersListMetricDefinitionResponse = MetricDefinitionList; -/** - * Contains response data for the listByDeviceNext operation. - */ -export type JobsListByDeviceNextResponse = JobList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobList; - }; -}; +/** Optional parameters. */ +export interface VolumesListByVolumeContainerOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByManagerNext operation. - */ -export type JobsListByManagerNextResponse = JobList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobList; - }; -}; +/** Contains response data for the listByVolumeContainer operation. */ +export type VolumesListByVolumeContainerResponse = VolumeList; -/** - * Contains response data for the listByDevice operation. - */ -export type VolumeContainersListByDeviceResponse = VolumeContainerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: VolumeContainerList; - }; -}; +/** Optional parameters. */ +export interface VolumesGetOptionalParams extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type VolumeContainersGetResponse = VolumeContainer & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: VolumeContainer; - }; -}; +/** Contains response data for the get operation. */ +export type VolumesGetResponse = Volume; -/** - * Contains response data for the createOrUpdate operation. - */ -export type VolumeContainersCreateOrUpdateResponse = VolumeContainer & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: VolumeContainer; - }; -}; +/** Optional parameters. */ +export interface VolumesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listMetrics operation. - */ -export type VolumeContainersListMetricsResponse = MetricList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricList; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type VolumesCreateOrUpdateResponse = Volume; -/** - * Contains response data for the listMetricDefinition operation. - */ -export type VolumeContainersListMetricDefinitionResponse = MetricDefinitionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricDefinitionList; - }; -}; +/** Optional parameters. */ +export interface VolumesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type VolumeContainersBeginCreateOrUpdateResponse = VolumeContainer & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: VolumeContainer; - }; -}; +/** Optional parameters. */ +export interface VolumesListMetricsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByVolumeContainer operation. - */ -export type VolumesListByVolumeContainerResponse = VolumeList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: VolumeList; - }; -}; +/** Contains response data for the listMetrics operation. */ +export type VolumesListMetricsResponse = MetricList; -/** - * Contains response data for the get operation. - */ -export type VolumesGetResponse = Volume & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Volume; - }; -}; +/** Optional parameters. */ +export interface VolumesListMetricDefinitionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type VolumesCreateOrUpdateResponse = Volume & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Volume; - }; -}; +/** Contains response data for the listMetricDefinition operation. */ +export type VolumesListMetricDefinitionResponse = MetricDefinitionList; -/** - * Contains response data for the listMetrics operation. - */ -export type VolumesListMetricsResponse = MetricList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricList; - }; -}; +/** Optional parameters. */ +export interface VolumesListByDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listMetricDefinition operation. - */ -export type VolumesListMetricDefinitionResponse = MetricDefinitionList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricDefinitionList; - }; -}; +/** Contains response data for the listByDevice operation. */ +export type VolumesListByDeviceResponse = VolumeList; -/** - * Contains response data for the listByDevice operation. - */ -export type VolumesListByDeviceResponse = VolumeList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: VolumeList; - }; -}; +/** Optional parameters. */ +export interface StorageAccountCredentialsListByManagerOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type VolumesBeginCreateOrUpdateResponse = Volume & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Volume; - }; -}; +/** Contains response data for the listByManager operation. */ +export type StorageAccountCredentialsListByManagerResponse = StorageAccountCredentialList; -/** - * Contains response data for the listByManager operation. - */ -export type StorageAccountCredentialsListByManagerResponse = StorageAccountCredentialList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredentialList; - }; -}; +/** Optional parameters. */ +export interface StorageAccountCredentialsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type StorageAccountCredentialsGetResponse = StorageAccountCredential & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredential; - }; -}; +/** Contains response data for the get operation. */ +export type StorageAccountCredentialsGetResponse = StorageAccountCredential; -/** - * Contains response data for the createOrUpdate operation. - */ -export type StorageAccountCredentialsCreateOrUpdateResponse = StorageAccountCredential & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredential; - }; -}; +/** Optional parameters. */ +export interface StorageAccountCredentialsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type StorageAccountCredentialsBeginCreateOrUpdateResponse = StorageAccountCredential & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredential; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type StorageAccountCredentialsCreateOrUpdateResponse = StorageAccountCredential; + +/** Optional parameters. */ +export interface StorageAccountCredentialsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface StorSimple8000SeriesManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/jobsMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/jobsMappers.ts deleted file mode 100644 index 73d805c6b4c8..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/jobsMappers.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - JobList, - Job, - BaseModel, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - CloudError, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/managersMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/managersMappers.ts deleted file mode 100644 index 49359ba6def8..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/managersMappers.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - ManagerList, - Manager, - Resource, - BaseResource, - ManagerIntrinsicSettings, - ManagerSku, - CloudError, - ManagerPatch, - PublicKey, - EncryptionSettings, - BaseModel, - ManagerExtendedInfo, - FeatureList, - Feature, - Key, - SymmetricEncryptedSecret, - MetricList, - Metrics, - MetricName, - MetricDimension, - MetricData, - MetricDefinitionList, - MetricDefinition, - MetricAvailablity, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/mappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/mappers.ts index 60d770ba2851..6eec13539fb7 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/mappers.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/models/mappers.ts @@ -1,107 +1,305 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; +export const AvailableProviderOperationList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableProviderOperationList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AvailableProviderOperation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; -export const BaseModel: msRest.CompositeMapper = { - serializedName: "BaseModel", +export const AvailableProviderOperation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BaseModel", + className: "AvailableProviderOperation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "AvailableProviderOperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const AvailableProviderOperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableProviderOperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const ManagerList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagerList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Manager" + } + } + } + } + } + } +}; + +export const ManagerIntrinsicSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagerIntrinsicSettings", + modelProperties: { + type: { + serializedName: "type", + required: true, + type: { + name: "Enum", + allowedValues: ["GardaV1", "HelsinkiV1"] + } + } + } + } +}; + +export const ManagerSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagerSku", + modelProperties: { + name: { + defaultValue: "Standard", + isConstant: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } }, - kind: { - serializedName: "kind", + location: { + serializedName: "location", + required: true, type: { - name: "Enum", - allowedValues: [ - "Series8000" - ] + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const AccessControlRecord: msRest.CompositeMapper = { - serializedName: "AccessControlRecord", +export const ManagerPatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessControlRecord", + className: "ManagerPatch", modelProperties: { - ...BaseModel.type.modelProperties, - initiatorName: { - required: true, - serializedName: "properties.initiatorName", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } - }, - volumeCount: { - readOnly: true, - serializedName: "properties.volumeCount", + } + } + } +}; + +export const AccessControlRecordList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessControlRecordList", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessControlRecord" + } + } } } } } }; -export const AcsConfiguration: msRest.CompositeMapper = { - serializedName: "AcsConfiguration", +export const BaseModel: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AcsConfiguration", + className: "BaseModel", modelProperties: { - namespace: { - required: true, - serializedName: "namespace", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - realm: { - required: true, - serializedName: "realm", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - serviceUrl: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + kind: { + defaultValue: "Series8000", + isConstant: true, + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const AlertList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AlertList", + modelProperties: { + value: { + serializedName: "value", required: true, - serializedName: "serviceUrl", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Alert" + } + } + } + }, + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -110,8 +308,7 @@ export const AcsConfiguration: msRest.CompositeMapper = { } }; -export const AlertSource: msRest.CompositeMapper = { - serializedName: "AlertSource", +export const AlertSource: coreClient.CompositeMapper = { type: { name: "Composite", className: "AlertSource", @@ -132,18 +329,14 @@ export const AlertSource: msRest.CompositeMapper = { serializedName: "alertSourceType", type: { name: "Enum", - allowedValues: [ - "Resource", - "Device" - ] + allowedValues: ["Resource", "Device"] } } } } }; -export const AlertErrorDetails: msRest.CompositeMapper = { - serializedName: "AlertErrorDetails", +export const AlertErrorDetails: coreClient.CompositeMapper = { type: { name: "Composite", className: "AlertErrorDetails", @@ -170,121 +363,71 @@ export const AlertErrorDetails: msRest.CompositeMapper = { } }; -export const Alert: msRest.CompositeMapper = { - serializedName: "Alert", +export const BandwidthSettingList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Alert", + className: "BandwidthSettingList", modelProperties: { - ...BaseModel.type.modelProperties, - title: { - required: true, - serializedName: "properties.title", - type: { - name: "String" - } - }, - scope: { - required: true, - serializedName: "properties.scope", - type: { - name: "Enum", - allowedValues: [ - "Resource", - "Device" - ] - } - }, - alertType: { - required: true, - serializedName: "properties.alertType", - type: { - name: "String" - } - }, - appearedAtTime: { - required: true, - serializedName: "properties.appearedAtTime", - type: { - name: "DateTime" - } - }, - appearedAtSourceTime: { + value: { + serializedName: "value", required: true, - serializedName: "properties.appearedAtSourceTime", - type: { - name: "DateTime" - } - }, - clearedAtTime: { - serializedName: "properties.clearedAtTime", type: { - name: "DateTime" - } - }, - clearedAtSourceTime: { - serializedName: "properties.clearedAtSourceTime", - type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BandwidthSetting" + } + } } - }, - source: { - required: true, - serializedName: "properties.source", + } + } + } +}; + +export const BandwidthSchedule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BandwidthSchedule", + modelProperties: { + start: { + serializedName: "start", type: { name: "Composite", - className: "AlertSource" - } - }, - recommendation: { - serializedName: "properties.recommendation", - type: { - name: "String" + className: "Time" } }, - resolutionReason: { - serializedName: "properties.resolutionReason", + stop: { + serializedName: "stop", type: { - name: "String" + name: "Composite", + className: "Time" } }, - severity: { + rateInMbps: { + serializedName: "rateInMbps", required: true, - serializedName: "properties.severity", type: { - name: "Enum", - allowedValues: [ - "Informational", - "Warning", - "Critical" - ] + name: "Number" } }, - status: { + days: { + serializedName: "days", required: true, - serializedName: "properties.status", - type: { - name: "Enum", - allowedValues: [ - "Active", - "Cleared" - ] - } - }, - errorDetails: { - serializedName: "properties.errorDetails", - type: { - name: "Composite", - className: "AlertErrorDetails" - } - }, - detailedInformation: { - serializedName: "properties.detailedInformation", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Enum", + allowedValues: [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ] } } } @@ -293,100 +436,89 @@ export const Alert: msRest.CompositeMapper = { } }; -export const AlertFilter: msRest.CompositeMapper = { - serializedName: "AlertFilter", +export const Time: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertFilter", + className: "Time", modelProperties: { - status: { - serializedName: "status", + hours: { + constraints: { + InclusiveMaximum: 23, + InclusiveMinimum: 0 + }, + serializedName: "hours", + required: true, type: { - name: "Enum", - allowedValues: [ - "Active", - "Cleared" - ] + name: "Number" } }, - severity: { - serializedName: "severity", + minutes: { + constraints: { + InclusiveMaximum: 59, + InclusiveMinimum: 0 + }, + serializedName: "minutes", + required: true, type: { - name: "Enum", - allowedValues: [ - "Informational", - "Warning", - "Critical" - ] + name: "Number" } }, - sourceType: { - serializedName: "sourceType", + seconds: { + constraints: { + InclusiveMaximum: 59, + InclusiveMinimum: 0 + }, + serializedName: "seconds", + required: true, type: { - name: "Enum", - allowedValues: [ - "Resource", - "Device" - ] + name: "Number" } - }, - sourceName: { - serializedName: "sourceName", + } + } + } +}; + +export const ClearAlertRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClearAlertRequest", + modelProperties: { + resolutionMessage: { + serializedName: "resolutionMessage", type: { name: "String" } }, - appearedOnTime: { - serializedName: "appearedOnTime", + alerts: { + serializedName: "alerts", + required: true, type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const AlertSettings: msRest.CompositeMapper = { - serializedName: "AlertSettings", +export const CloudApplianceConfigurationList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertSettings", + className: "CloudApplianceConfigurationList", modelProperties: { - ...BaseModel.type.modelProperties, - emailNotification: { + value: { + serializedName: "value", required: true, - serializedName: "properties.emailNotification", - type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] - } - }, - alertNotificationCulture: { - serializedName: "properties.alertNotificationCulture", - type: { - name: "String" - } - }, - notificationToServiceOwners: { - serializedName: "properties.notificationToServiceOwners", - type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] - } - }, - additionalRecipientEmailList: { - serializedName: "properties.additionalRecipientEmailList", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "CloudApplianceConfiguration" } } } @@ -395,67 +527,72 @@ export const AlertSettings: msRest.CompositeMapper = { } }; -export const AsymmetricEncryptedSecret: msRest.CompositeMapper = { - serializedName: "AsymmetricEncryptedSecret", +export const AcsConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AsymmetricEncryptedSecret", + className: "AcsConfiguration", modelProperties: { - value: { + namespace: { + serializedName: "namespace", required: true, - serializedName: "value", type: { name: "String" } }, - encryptionCertThumbprint: { - serializedName: "encryptionCertThumbprint", + realm: { + serializedName: "realm", + required: true, type: { name: "String" } }, - encryptionAlgorithm: { + serviceUrl: { + serializedName: "serviceUrl", required: true, - serializedName: "encryptionAlgorithm", type: { - name: "Enum", - allowedValues: [ - "None", - "AES256", - "RSAES_PKCS1_v_1_5" - ] + name: "String" } } } } }; -export const AvailableProviderOperationDisplay: msRest.CompositeMapper = { - serializedName: "AvailableProviderOperationDisplay", +export const VmImage: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailableProviderOperationDisplay", + className: "VmImage", modelProperties: { - provider: { - serializedName: "provider", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - resource: { - serializedName: "resource", - type: { + version: { + serializedName: "version", + required: true, + type: { name: "String" } }, - operation: { - serializedName: "operation", + offer: { + serializedName: "offer", + required: true, type: { name: "String" } }, - description: { - serializedName: "description", + publisher: { + serializedName: "publisher", + required: true, + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + required: true, type: { name: "String" } @@ -464,167 +601,175 @@ export const AvailableProviderOperationDisplay: msRest.CompositeMapper = { } }; -export const AvailableProviderOperation: msRest.CompositeMapper = { - serializedName: "AvailableProviderOperation", +export const SecondaryDNSSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailableProviderOperation", + className: "SecondaryDNSSettings", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "AvailableProviderOperationDisplay" - } - }, - origin: { - serializedName: "origin", - type: { - name: "String" - } - }, - properties: { - serializedName: "properties", + secondaryDnsServers: { + serializedName: "secondaryDnsServers", type: { - name: "Object" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const BackupElement: msRest.CompositeMapper = { - serializedName: "BackupElement", +export const NetworkInterfaceData0Settings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BackupElement", + className: "NetworkInterfaceData0Settings", modelProperties: { - elementId: { - required: true, - serializedName: "elementId", + controllerZeroIp: { + serializedName: "controllerZeroIp", type: { name: "String" } }, - elementName: { - required: true, - serializedName: "elementName", + controllerOneIp: { + serializedName: "controllerOneIp", type: { name: "String" } - }, - elementType: { + } + } + } +}; + +export const DeviceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeviceList", + modelProperties: { + value: { + serializedName: "value", required: true, - serializedName: "elementType", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Device" + } + } } - }, - sizeInBytes: { - required: true, - serializedName: "sizeInBytes", + } + } + } +}; + +export const DeviceDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeviceDetails", + modelProperties: { + endpointCount: { + serializedName: "endpointCount", type: { name: "Number" } }, - volumeName: { - required: true, - serializedName: "volumeName", - type: { - name: "String" - } - }, - volumeContainerId: { - required: true, - serializedName: "volumeContainerId", - type: { - name: "String" - } - }, - volumeType: { - serializedName: "volumeType", + volumeContainerCount: { + serializedName: "volumeContainerCount", type: { - name: "Enum", - allowedValues: [ - "Tiered", - "Archival", - "LocallyPinned" - ] + name: "Number" } } } } }; -export const Backup: msRest.CompositeMapper = { - serializedName: "Backup", +export const DeviceRolloverDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Backup", + className: "DeviceRolloverDetails", modelProperties: { - ...BaseModel.type.modelProperties, - createdOn: { - required: true, - serializedName: "properties.createdOn", - type: { - name: "DateTime" - } - }, - sizeInBytes: { - required: true, - serializedName: "properties.sizeInBytes", + authorizationEligibility: { + serializedName: "authorizationEligibility", type: { - name: "Number" + name: "Enum", + allowedValues: ["InEligible", "Eligible"] } }, - backupType: { - serializedName: "properties.backupType", + authorizationStatus: { + serializedName: "authorizationStatus", type: { name: "Enum", - allowedValues: [ - "LocalSnapshot", - "CloudSnapshot" - ] + allowedValues: ["Disabled", "Enabled"] } }, - backupJobCreationType: { - serializedName: "properties.backupJobCreationType", + inEligibilityReason: { + serializedName: "inEligibilityReason", type: { name: "Enum", allowedValues: [ - "Adhoc", - "BySchedule", - "BySSM" + "DeviceNotOnline", + "NotSupportedAppliance", + "RolloverPending" ] } - }, - backupPolicyId: { - serializedName: "properties.backupPolicyId", + } + } + } +}; + +export const DevicePatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DevicePatch", + modelProperties: { + deviceDescription: { + serializedName: "properties.deviceDescription", type: { name: "String" } - }, - ssmHostName: { - serializedName: "properties.ssmHostName", + } + } + } +}; + +export const BackupPolicyList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupPolicyList", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BackupPolicy" + } + } } - }, - elements: { + } + } + } +}; + +export const BackupScheduleList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupScheduleList", + modelProperties: { + value: { + serializedName: "value", required: true, - serializedName: "properties.elements", type: { name: "Sequence", element: { type: { name: "Composite", - className: "BackupElement" + className: "BackupSchedule" } } } @@ -633,403 +778,424 @@ export const Backup: msRest.CompositeMapper = { } }; -export const BackupFilter: msRest.CompositeMapper = { - serializedName: "BackupFilter", +export const ScheduleRecurrence: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BackupFilter", + className: "ScheduleRecurrence", modelProperties: { - backupPolicyId: { - serializedName: "backupPolicyId", + recurrenceType: { + serializedName: "recurrenceType", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Minutes", "Hourly", "Daily", "Weekly"] } }, - volumeId: { - serializedName: "volumeId", + recurrenceValue: { + serializedName: "recurrenceValue", + required: true, type: { - name: "String" + name: "Number" } }, - createdTime: { - serializedName: "createdTime", + weeklyDaysList: { + serializedName: "weeklyDaysList", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ] + } + } } } } } }; -export const BackupPolicy: msRest.CompositeMapper = { - serializedName: "BackupPolicy", +export const BackupList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BackupPolicy", + className: "BackupList", modelProperties: { - ...BaseModel.type.modelProperties, - volumeIds: { + value: { + serializedName: "value", required: true, - serializedName: "properties.volumeIds", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "Backup" } } } }, - nextBackupTime: { - readOnly: true, - serializedName: "properties.nextBackupTime", - type: { - name: "DateTime" + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const BackupElement: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupElement", + modelProperties: { + elementId: { + serializedName: "elementId", + required: true, + type: { + name: "String" } }, - lastBackupTime: { - readOnly: true, - serializedName: "properties.lastBackupTime", + elementName: { + serializedName: "elementName", + required: true, type: { - name: "DateTime" + name: "String" } }, - schedulesCount: { - readOnly: true, - serializedName: "properties.schedulesCount", + elementType: { + serializedName: "elementType", + required: true, type: { - name: "Number" + name: "String" } }, - scheduledBackupStatus: { - readOnly: true, - serializedName: "properties.scheduledBackupStatus", + sizeInBytes: { + serializedName: "sizeInBytes", + required: true, type: { - name: "Enum", - allowedValues: [ - "Disabled", - "Enabled" - ] + name: "Number" } }, - backupPolicyCreationType: { - readOnly: true, - serializedName: "properties.backupPolicyCreationType", + volumeName: { + serializedName: "volumeName", + required: true, type: { - name: "Enum", - allowedValues: [ - "BySaaS", - "BySSM" - ] + name: "String" } }, - ssmHostName: { - readOnly: true, - serializedName: "properties.ssmHostName", + volumeContainerId: { + serializedName: "volumeContainerId", + required: true, type: { name: "String" } + }, + volumeType: { + serializedName: "volumeType", + type: { + name: "Enum", + allowedValues: ["Tiered", "Archival", "LocallyPinned"] + } } } } }; -export const ScheduleRecurrence: msRest.CompositeMapper = { - serializedName: "ScheduleRecurrence", +export const CloneRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScheduleRecurrence", + className: "CloneRequest", modelProperties: { - recurrenceType: { + targetDeviceId: { + serializedName: "targetDeviceId", required: true, - serializedName: "recurrenceType", type: { - name: "Enum", - allowedValues: [ - "Minutes", - "Hourly", - "Daily", - "Weekly" - ] + name: "String" } }, - recurrenceValue: { + targetVolumeName: { + serializedName: "targetVolumeName", required: true, - serializedName: "recurrenceValue", type: { - name: "Number" + name: "String" } }, - weeklyDaysList: { - serializedName: "weeklyDaysList", + targetAccessControlRecordIds: { + serializedName: "targetAccessControlRecordIds", + required: true, type: { name: "Sequence", element: { type: { - name: "Enum", - allowedValues: [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" - ] + name: "String" } } } + }, + backupElement: { + serializedName: "backupElement", + type: { + name: "Composite", + className: "BackupElement" + } } } } }; -export const BackupSchedule: msRest.CompositeMapper = { - serializedName: "BackupSchedule", +export const HardwareComponentGroupList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BackupSchedule", + className: "HardwareComponentGroupList", modelProperties: { - ...BaseModel.type.modelProperties, - scheduleRecurrence: { - required: true, - serializedName: "properties.scheduleRecurrence", - type: { - name: "Composite", - className: "ScheduleRecurrence" - } - }, - backupType: { + value: { + serializedName: "value", required: true, - serializedName: "properties.backupType", type: { - name: "Enum", - allowedValues: [ - "LocalSnapshot", - "CloudSnapshot" - ] + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HardwareComponentGroup" + } + } } - }, - retentionCount: { + } + } + } +}; + +export const HardwareComponent: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HardwareComponent", + modelProperties: { + componentId: { + serializedName: "componentId", required: true, - serializedName: "properties.retentionCount", type: { - name: "Number" + name: "String" } }, - startTime: { + displayName: { + serializedName: "displayName", required: true, - serializedName: "properties.startTime", type: { - name: "DateTime" + name: "String" } }, - scheduleStatus: { + status: { + serializedName: "status", required: true, - serializedName: "properties.scheduleStatus", type: { name: "Enum", allowedValues: [ - "Enabled", - "Disabled" + "Unknown", + "NotPresent", + "PoweredOff", + "Ok", + "Recovering", + "Warning", + "Failure" ] } }, - lastSuccessfulRun: { - readOnly: true, - serializedName: "properties.lastSuccessfulRun", + statusDisplayName: { + serializedName: "statusDisplayName", + required: true, type: { - name: "DateTime" + name: "String" } } } } }; -export const Time: msRest.CompositeMapper = { - serializedName: "Time", +export const JobList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Time", + className: "JobList", modelProperties: { - hours: { - required: true, - serializedName: "hours", - constraints: { - InclusiveMaximum: 23, - InclusiveMinimum: 0 - }, - type: { - name: "Number" - } - }, - minutes: { + value: { + serializedName: "value", required: true, - serializedName: "minutes", - constraints: { - InclusiveMaximum: 59, - InclusiveMinimum: 0 - }, type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Job" + } + } } }, - seconds: { - required: true, - serializedName: "seconds", - constraints: { - InclusiveMaximum: 59, - InclusiveMinimum: 0 - }, + nextLink: { + serializedName: "nextLink", type: { - name: "Number" + name: "String" } } } } }; -export const BandwidthSchedule: msRest.CompositeMapper = { - serializedName: "BandwidthSchedule", +export const JobErrorDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BandwidthSchedule", + className: "JobErrorDetails", modelProperties: { - start: { - required: true, - serializedName: "start", + errorDetails: { + serializedName: "errorDetails", type: { - name: "Composite", - className: "Time" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "JobErrorItem" + } + } } }, - stop: { + code: { + serializedName: "code", required: true, - serializedName: "stop", type: { - name: "Composite", - className: "Time" + name: "String" } }, - rateInMbps: { + message: { + serializedName: "message", required: true, - serializedName: "rateInMbps", type: { - name: "Number" - } - }, - days: { - required: true, - serializedName: "days", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" - ] - } - } + name: "String" } } } } }; -export const BandwidthSetting: msRest.CompositeMapper = { - serializedName: "BandwidthSetting", +export const JobErrorItem: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BandwidthSetting", + className: "JobErrorItem", modelProperties: { - ...BaseModel.type.modelProperties, - schedules: { - required: true, - serializedName: "properties.schedules", + recommendations: { + serializedName: "recommendations", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "BandwidthSchedule" + name: "String" } } } }, - volumeCount: { - readOnly: true, - serializedName: "properties.volumeCount", + code: { + serializedName: "code", + required: true, type: { - name: "Number" + name: "String" + } + }, + message: { + serializedName: "message", + required: true, + type: { + name: "String" } } } } }; -export const ChapSettings: msRest.CompositeMapper = { - serializedName: "ChapSettings", +export const DataStatistics: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ChapSettings", + className: "DataStatistics", modelProperties: { - initiatorUser: { - serializedName: "initiatorUser", + totalData: { + serializedName: "totalData", type: { - name: "String" + name: "Number" } }, - initiatorSecret: { - serializedName: "initiatorSecret", + processedData: { + serializedName: "processedData", type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" + name: "Number" } }, - targetUser: { - serializedName: "targetUser", + cloudData: { + serializedName: "cloudData", type: { - name: "String" + name: "Number" } }, - targetSecret: { - serializedName: "targetSecret", + throughput: { + serializedName: "throughput", type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" + name: "Number" } } } } }; -export const ClearAlertRequest: msRest.CompositeMapper = { - serializedName: "ClearAlertRequest", +export const JobStage: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClearAlertRequest", + className: "JobStage", modelProperties: { - resolutionMessage: { - serializedName: "resolutionMessage", + message: { + serializedName: "message", type: { name: "String" } }, - alerts: { + stageStatus: { + serializedName: "stageStatus", required: true, - serializedName: "alerts", + type: { + name: "Enum", + allowedValues: ["Running", "Succeeded", "Failed", "Canceled"] + } + }, + detail: { + serializedName: "detail", + type: { + name: "String" + } + }, + errorCode: { + serializedName: "errorCode", + type: { + name: "String" + } + } + } + } +}; + +export const FailoverSetsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FailoverSetsList", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "FailoverSet" } } } @@ -1038,120 +1204,105 @@ export const ClearAlertRequest: msRest.CompositeMapper = { } }; -export const CloneRequest: msRest.CompositeMapper = { - serializedName: "CloneRequest", +export const FailoverSet: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloneRequest", + className: "FailoverSet", modelProperties: { - targetDeviceId: { - required: true, - serializedName: "targetDeviceId", - type: { - name: "String" - } - }, - targetVolumeName: { - required: true, - serializedName: "targetVolumeName", - type: { - name: "String" - } - }, - targetAccessControlRecordIds: { - required: true, - serializedName: "targetAccessControlRecordIds", + volumeContainers: { + serializedName: "volumeContainers", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "VolumeContainerFailoverMetadata" } } } }, - backupElement: { - required: true, - serializedName: "backupElement", + eligibilityResult: { + serializedName: "eligibilityResult", type: { name: "Composite", - className: "BackupElement" + className: "FailoverSetEligibilityResult" } } } } }; -export const CloudAppliance: msRest.CompositeMapper = { - serializedName: "CloudAppliance", +export const VolumeContainerFailoverMetadata: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudAppliance", + className: "VolumeContainerFailoverMetadata", modelProperties: { - name: { - required: true, - serializedName: "name", + volumeContainerId: { + serializedName: "volumeContainerId", type: { name: "String" } }, - vnetName: { - serializedName: "vnetName", + volumes: { + serializedName: "volumes", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VolumeFailoverMetadata" + } + } } - }, - vnetRegion: { - required: true, - serializedName: "vnetRegion", + } + } + } +}; + +export const VolumeFailoverMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeFailoverMetadata", + modelProperties: { + volumeId: { + serializedName: "volumeId", type: { name: "String" } }, - isVnetDnsConfigured: { - serializedName: "isVnetDnsConfigured", - type: { - name: "Boolean" - } - }, - isVnetExpressConfigured: { - serializedName: "isVnetExpressConfigured", - type: { - name: "Boolean" - } - }, - subnetName: { - serializedName: "subnetName", + volumeType: { + serializedName: "volumeType", type: { - name: "String" + name: "Enum", + allowedValues: ["Tiered", "Archival", "LocallyPinned"] } }, - storageAccountName: { - serializedName: "storageAccountName", + sizeInBytes: { + serializedName: "sizeInBytes", type: { - name: "String" + name: "Number" } }, - storageAccountType: { - serializedName: "storageAccountType", + backupCreatedDate: { + serializedName: "backupCreatedDate", type: { - name: "String" + name: "DateTime" } }, - vmType: { - serializedName: "vmType", + backupElementId: { + serializedName: "backupElementId", type: { name: "String" } }, - vmImageName: { - serializedName: "vmImageName", + backupId: { + serializedName: "backupId", type: { name: "String" } }, - modelNumber: { - serializedName: "modelNumber", + backupPolicyId: { + serializedName: "backupPolicyId", type: { name: "String" } @@ -1160,43 +1311,19 @@ export const CloudAppliance: msRest.CompositeMapper = { } }; -export const VmImage: msRest.CompositeMapper = { - serializedName: "VmImage", +export const FailoverSetEligibilityResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VmImage", + className: "FailoverSetEligibilityResult", modelProperties: { - name: { - required: true, - serializedName: "name", - type: { - name: "String" - } - }, - version: { - required: true, - serializedName: "version", - type: { - name: "String" - } - }, - offer: { - required: true, - serializedName: "offer", - type: { - name: "String" - } - }, - publisher: { - required: true, - serializedName: "publisher", + isEligibleForFailover: { + serializedName: "isEligibleForFailover", type: { - name: "String" + name: "Boolean" } }, - sku: { - required: true, - serializedName: "sku", + errorMessage: { + serializedName: "errorMessage", type: { name: "String" } @@ -1205,125 +1332,117 @@ export const VmImage: msRest.CompositeMapper = { } }; -export const CloudApplianceConfiguration: msRest.CompositeMapper = { - serializedName: "CloudApplianceConfiguration", +export const MetricList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudApplianceConfiguration", + className: "MetricList", modelProperties: { - ...BaseModel.type.modelProperties, - modelNumber: { - required: true, - serializedName: "properties.modelNumber", + value: { + serializedName: "value", type: { - name: "String" - } - }, - cloudPlatform: { - required: true, - serializedName: "properties.cloudPlatform", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Metrics" + } + } + } + } + } + } +}; + +export const Metrics: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Metrics", + modelProperties: { + resourceId: { + serializedName: "resourceId", type: { name: "String" } }, - acsConfiguration: { - required: true, - serializedName: "properties.acsConfiguration", + startTime: { + serializedName: "startTime", type: { - name: "Composite", - className: "AcsConfiguration" + name: "DateTime" } }, - supportedStorageAccountTypes: { - required: true, - serializedName: "properties.supportedStorageAccountTypes", + endTime: { + serializedName: "endTime", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTime" } }, - supportedRegions: { - required: true, - serializedName: "properties.supportedRegions", + timeGrain: { + serializedName: "timeGrain", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - supportedVmTypes: { - required: true, - serializedName: "properties.supportedVmTypes", + primaryAggregation: { + serializedName: "primaryAggregation", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Enum", + allowedValues: [ + "Average", + "Last", + "Maximum", + "Minimum", + "None", + "Total" + ] } }, - supportedVmImages: { - required: true, - serializedName: "properties.supportedVmImages", + name: { + serializedName: "name", + type: { + name: "Composite", + className: "MetricName" + } + }, + dimensions: { + serializedName: "dimensions", type: { name: "Sequence", element: { type: { name: "Composite", - className: "VmImage" + className: "MetricDimension" } } } - } - } - } -}; - -export const CloudApplianceSettings: msRest.CompositeMapper = { - serializedName: "CloudApplianceSettings", - type: { - name: "Composite", - className: "CloudApplianceSettings", - modelProperties: { - serviceDataEncryptionKey: { - serializedName: "serviceDataEncryptionKey", + }, + unit: { + serializedName: "unit", type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" + name: "Enum", + allowedValues: [ + "Bytes", + "BytesPerSecond", + "Count", + "CountPerSecond", + "Percent", + "Seconds" + ] } }, - channelIntegrityKey: { - serializedName: "channelIntegrityKey", + type: { + serializedName: "type", type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" + name: "String" } - } - } - } -}; - -export const SecondaryDNSSettings: msRest.CompositeMapper = { - serializedName: "SecondaryDNSSettings", - type: { - name: "Composite", - className: "SecondaryDNSSettings", - modelProperties: { - secondaryDnsServers: { - serializedName: "secondaryDnsServers", + }, + values: { + serializedName: "values", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "MetricData" } } } @@ -1332,20 +1451,19 @@ export const SecondaryDNSSettings: msRest.CompositeMapper = { } }; -export const NetworkInterfaceData0Settings: msRest.CompositeMapper = { - serializedName: "NetworkInterfaceData0Settings", +export const MetricName: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkInterfaceData0Settings", + className: "MetricName", modelProperties: { - controllerZeroIp: { - serializedName: "controllerZeroIp", + value: { + serializedName: "value", type: { name: "String" } }, - controllerOneIp: { - serializedName: "controllerOneIp", + localizedValue: { + serializedName: "localizedValue", type: { name: "String" } @@ -1354,144 +1472,64 @@ export const NetworkInterfaceData0Settings: msRest.CompositeMapper = { } }; -export const ConfigureDeviceRequest: msRest.CompositeMapper = { - serializedName: "ConfigureDeviceRequest", +export const MetricDimension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ConfigureDeviceRequest", + className: "MetricDimension", modelProperties: { - ...BaseModel.type.modelProperties, - friendlyName: { - required: true, - serializedName: "properties.friendlyName", - type: { - name: "String" - } - }, - currentDeviceName: { - required: true, - serializedName: "properties.currentDeviceName", + name: { + serializedName: "name", type: { name: "String" } }, - timeZone: { - required: true, - serializedName: "properties.timeZone", + value: { + serializedName: "value", type: { name: "String" } - }, - dnsSettings: { - serializedName: "properties.dnsSettings", - type: { - name: "Composite", - className: "SecondaryDNSSettings" - } - }, - networkInterfaceData0Settings: { - serializedName: "properties.networkInterfaceData0Settings", - type: { - name: "Composite", - className: "NetworkInterfaceData0Settings" - } } } } }; -export const ControllerPowerStateChangeRequest: msRest.CompositeMapper = { - serializedName: "ControllerPowerStateChangeRequest", +export const MetricData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ControllerPowerStateChangeRequest", + className: "MetricData", modelProperties: { - ...BaseModel.type.modelProperties, - action: { - required: true, - serializedName: "properties.action", - type: { - name: "Enum", - allowedValues: [ - "Start", - "Restart", - "Shutdown" - ] - } - }, - activeController: { - required: true, - serializedName: "properties.activeController", + timeStamp: { + serializedName: "timeStamp", type: { - name: "Enum", - allowedValues: [ - "Unknown", - "None", - "Controller0", - "Controller1" - ] + name: "DateTime" } }, - controller0State: { - required: true, - serializedName: "properties.controller0State", + sum: { + serializedName: "sum", type: { - name: "Enum", - allowedValues: [ - "NotPresent", - "PoweredOff", - "Ok", - "Recovering", - "Warning", - "Failure" - ] + name: "Number" } }, - controller1State: { - required: true, - serializedName: "properties.controller1State", - type: { - name: "Enum", - allowedValues: [ - "NotPresent", - "PoweredOff", - "Ok", - "Recovering", - "Warning", - "Failure" - ] - } - } - } - } -}; - -export const DataStatistics: msRest.CompositeMapper = { - serializedName: "DataStatistics", - type: { - name: "Composite", - className: "DataStatistics", - modelProperties: { - totalData: { - serializedName: "totalData", + count: { + serializedName: "count", type: { name: "Number" } }, - processedData: { - serializedName: "processedData", + average: { + serializedName: "average", type: { name: "Number" } }, - cloudData: { - serializedName: "cloudData", + minimum: { + serializedName: "minimum", type: { name: "Number" } }, - throughput: { - serializedName: "throughput", + maximum: { + serializedName: "maximum", type: { name: "Number" } @@ -1500,298 +1538,418 @@ export const DataStatistics: msRest.CompositeMapper = { } }; -export const DeviceDetails: msRest.CompositeMapper = { - serializedName: "DeviceDetails", +export const MetricDefinitionList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeviceDetails", + className: "MetricDefinitionList", modelProperties: { - endpointCount: { - serializedName: "endpointCount", - type: { - name: "Number" - } - }, - volumeContainerCount: { - serializedName: "volumeContainerCount", + value: { + serializedName: "value", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricDefinition" + } + } } } } } }; -export const DeviceRolloverDetails: msRest.CompositeMapper = { - serializedName: "DeviceRolloverDetails", +export const MetricDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeviceRolloverDetails", + className: "MetricDefinition", modelProperties: { - authorizationEligibility: { - serializedName: "authorizationEligibility", + name: { + serializedName: "name", type: { - name: "Enum", - allowedValues: [ - "InEligible", - "Eligible" - ] + name: "Composite", + className: "MetricName" } }, - authorizationStatus: { - serializedName: "authorizationStatus", + unit: { + serializedName: "unit", type: { name: "Enum", allowedValues: [ - "Disabled", - "Enabled" + "Bytes", + "BytesPerSecond", + "Count", + "CountPerSecond", + "Percent", + "Seconds" ] } }, - inEligibilityReason: { - serializedName: "inEligibilityReason", + primaryAggregationType: { + serializedName: "primaryAggregationType", type: { name: "Enum", allowedValues: [ - "DeviceNotOnline", - "NotSupportedAppliance", - "RolloverPending" + "Average", + "Last", + "Maximum", + "Minimum", + "None", + "Total" ] } + }, + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + metricAvailabilities: { + serializedName: "metricAvailabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricAvailablity" + } + } + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricDimension" + } + } + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } } } } }; -export const Device: msRest.CompositeMapper = { - serializedName: "Device", +export const MetricAvailablity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Device", + className: "MetricAvailablity", modelProperties: { - ...BaseModel.type.modelProperties, - friendlyName: { - required: true, - serializedName: "properties.friendlyName", + timeGrain: { + serializedName: "timeGrain", type: { name: "String" } }, - activationTime: { - required: true, - serializedName: "properties.activationTime", + retention: { + serializedName: "retention", type: { - name: "DateTime" + name: "String" } - }, - culture: { - required: true, - serializedName: "properties.culture", + } + } + } +}; + +export const DNSSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DNSSettings", + modelProperties: { + primaryDnsServer: { + serializedName: "primaryDnsServer", type: { name: "String" } }, - deviceDescription: { - required: true, - serializedName: "properties.deviceDescription", + primaryIpv6DnsServer: { + serializedName: "primaryIpv6DnsServer", type: { name: "String" } }, - deviceSoftwareVersion: { - required: true, - serializedName: "properties.deviceSoftwareVersion", + secondaryDnsServers: { + serializedName: "secondaryDnsServers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - friendlySoftwareName: { - serializedName: "properties.friendlySoftwareName", + secondaryIpv6DnsServers: { + serializedName: "secondaryIpv6DnsServers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } - }, - deviceConfigurationStatus: { + } + } + } +}; + +export const NetworkAdapterList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkAdapterList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkAdapters" + } + } + } + } + } + } +}; + +export const NetworkAdapters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkAdapters", + modelProperties: { + interfaceId: { + serializedName: "interfaceId", required: true, - serializedName: "properties.deviceConfigurationStatus", type: { name: "Enum", allowedValues: [ - "Complete", - "Pending" + "Invalid", + "Data0", + "Data1", + "Data2", + "Data3", + "Data4", + "Data5" ] } }, - targetIqn: { + netInterfaceStatus: { + serializedName: "netInterfaceStatus", required: true, - serializedName: "properties.targetIqn", type: { - name: "String" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } }, - modelDescription: { - required: true, - serializedName: "properties.modelDescription", + isDefault: { + serializedName: "isDefault", type: { - name: "String" + name: "Boolean" } }, - status: { + iscsiAndCloudStatus: { + serializedName: "iscsiAndCloudStatus", required: true, - serializedName: "properties.status", type: { name: "Enum", allowedValues: [ - "Unknown", - "Online", - "Offline", - "Deactivated", - "RequiresAttention", - "MaintenanceMode", - "Creating", - "Provisioning", - "Deactivating", - "Deleted", - "ReadyToSetup" + "Disabled", + "IscsiEnabled", + "CloudEnabled", + "IscsiAndCloudEnabled" ] } }, - serialNumber: { - required: true, - serializedName: "properties.serialNumber", + speed: { + serializedName: "speed", type: { - name: "String" + name: "Number" } }, - deviceType: { + mode: { + serializedName: "mode", required: true, - serializedName: "properties.deviceType", type: { name: "Enum", - allowedValues: [ - "Invalid", - "Series8000VirtualAppliance", - "Series8000PhysicalAppliance" - ] + allowedValues: ["Invalid", "IPV4", "IPV6", "BOTH"] } }, - activeController: { - required: true, - serializedName: "properties.activeController", + nicIpv4Settings: { + serializedName: "nicIpv4Settings", type: { - name: "Enum", - allowedValues: [ - "Unknown", - "None", - "Controller0", - "Controller1" - ] - } + name: "Composite", + className: "NicIPv4" + } }, - friendlySoftwareVersion: { - required: true, - serializedName: "properties.friendlySoftwareVersion", + nicIpv6Settings: { + serializedName: "nicIpv6Settings", + type: { + name: "Composite", + className: "NicIPv6" + } + } + } + } +}; + +export const NicIPv4: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NicIPv4", + modelProperties: { + ipv4Address: { + serializedName: "ipv4Address", type: { name: "String" } }, - availableLocalStorageInBytes: { - serializedName: "properties.availableLocalStorageInBytes", + ipv4Netmask: { + serializedName: "ipv4Netmask", type: { - name: "Number" + name: "String" } }, - availableTieredStorageInBytes: { - serializedName: "properties.availableTieredStorageInBytes", + ipv4Gateway: { + serializedName: "ipv4Gateway", type: { - name: "Number" + name: "String" } }, - provisionedTieredStorageInBytes: { - serializedName: "properties.provisionedTieredStorageInBytes", + controller0Ipv4Address: { + serializedName: "controller0Ipv4Address", type: { - name: "Number" + name: "String" } }, - provisionedLocalStorageInBytes: { - serializedName: "properties.provisionedLocalStorageInBytes", + controller1Ipv4Address: { + serializedName: "controller1Ipv4Address", type: { - name: "Number" + name: "String" } - }, - provisionedVolumeSizeInBytes: { - serializedName: "properties.provisionedVolumeSizeInBytes", + } + } + } +}; + +export const NicIPv6: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NicIPv6", + modelProperties: { + ipv6Address: { + serializedName: "ipv6Address", type: { - name: "Number" + name: "String" } }, - usingStorageInBytes: { - serializedName: "properties.usingStorageInBytes", + ipv6Prefix: { + serializedName: "ipv6Prefix", type: { - name: "Number" + name: "String" } }, - totalTieredStorageInBytes: { - serializedName: "properties.totalTieredStorageInBytes", + ipv6Gateway: { + serializedName: "ipv6Gateway", type: { - name: "Number" + name: "String" } }, - agentGroupVersion: { - serializedName: "properties.agentGroupVersion", + controller0Ipv6Address: { + serializedName: "controller0Ipv6Address", type: { - name: "Number" + name: "String" } }, - networkInterfaceCardCount: { - serializedName: "properties.networkInterfaceCardCount", + controller1Ipv6Address: { + serializedName: "controller1Ipv6Address", type: { - name: "Number" + name: "String" } - }, - deviceLocation: { - serializedName: "properties.deviceLocation", + } + } + } +}; + +export const WebproxySettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WebproxySettings", + modelProperties: { + connectionUri: { + serializedName: "connectionUri", type: { name: "String" } }, - virtualMachineApiType: { - readOnly: true, - serializedName: "properties.virtualMachineApiType", + authentication: { + serializedName: "authentication", + required: true, type: { name: "Enum", - allowedValues: [ - "Classic", - "Arm" - ] + allowedValues: ["Invalid", "None", "Basic", "NTLM"] } }, - details: { - serializedName: "properties.details", + username: { + serializedName: "username", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const NetworkSettingsPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkSettingsPatch", + modelProperties: { + dnsSettings: { + serializedName: "properties.dnsSettings", type: { name: "Composite", - className: "DeviceDetails" + className: "DNSSettings" } }, - rolloverDetails: { - serializedName: "properties.rolloverDetails", + networkAdapters: { + serializedName: "properties.networkAdapters", type: { name: "Composite", - className: "DeviceRolloverDetails" + className: "NetworkAdapterList" } } } } }; -export const DevicePatch: msRest.CompositeMapper = { - serializedName: "DevicePatch", +export const PublicKey: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DevicePatch", + className: "PublicKey", modelProperties: { - deviceDescription: { - serializedName: "properties.deviceDescription", + key: { + serializedName: "key", + required: true, type: { name: "String" } @@ -1800,20 +1958,26 @@ export const DevicePatch: msRest.CompositeMapper = { } }; -export const DimensionFilter: msRest.CompositeMapper = { - serializedName: "DimensionFilter", +export const RemoteManagementSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DimensionFilter", + className: "RemoteManagementSettings", modelProperties: { - name: { - serializedName: "name", + remoteManagementMode: { + serializedName: "remoteManagementMode", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: [ + "Unknown", + "Disabled", + "HttpsEnabled", + "HttpsAndHttpEnabled" + ] } }, - values: { - serializedName: "values", + remoteManagementCertificate: { + serializedName: "remoteManagementCertificate", type: { name: "String" } @@ -1822,187 +1986,173 @@ export const DimensionFilter: msRest.CompositeMapper = { } }; -export const DNSSettings: msRest.CompositeMapper = { - serializedName: "DNSSettings", +export const ChapSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DNSSettings", + className: "ChapSettings", modelProperties: { - primaryDnsServer: { - serializedName: "primaryDnsServer", + initiatorUser: { + serializedName: "initiatorUser", type: { name: "String" } }, - primaryIpv6DnsServer: { - serializedName: "primaryIpv6DnsServer", + initiatorSecret: { + serializedName: "initiatorSecret", type: { - name: "String" + name: "Composite", + className: "AsymmetricEncryptedSecret" } }, - secondaryDnsServers: { - serializedName: "secondaryDnsServers", + targetUser: { + serializedName: "targetUser", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - secondaryIpv6DnsServers: { - serializedName: "secondaryIpv6DnsServers", + targetSecret: { + serializedName: "targetSecret", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Composite", + className: "AsymmetricEncryptedSecret" } } } } }; -export const EncryptionSettings: msRest.CompositeMapper = { - serializedName: "EncryptionSettings", +export const AsymmetricEncryptedSecret: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EncryptionSettings", + className: "AsymmetricEncryptedSecret", modelProperties: { - ...BaseModel.type.modelProperties, - encryptionStatus: { + value: { + serializedName: "value", required: true, - serializedName: "properties.encryptionStatus", type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] + name: "String" } }, - keyRolloverStatus: { - required: true, - serializedName: "properties.keyRolloverStatus", - type: { - name: "Enum", - allowedValues: [ - "Required", - "NotRequired" - ] - } - } - } - } -}; - -export const FailoverRequest: msRest.CompositeMapper = { - serializedName: "FailoverRequest", - type: { - name: "Composite", - className: "FailoverRequest", - modelProperties: { - targetDeviceId: { - serializedName: "targetDeviceId", + encryptionCertThumbprint: { + serializedName: "encryptionCertThumbprint", type: { name: "String" } }, - volumeContainers: { - serializedName: "volumeContainers", + encryptionAlgorithm: { + serializedName: "encryptionAlgorithm", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Enum", + allowedValues: ["None", "AES256", "RSAES_PKCS1_v_1_5"] } } } } }; -export const VolumeFailoverMetadata: msRest.CompositeMapper = { - serializedName: "VolumeFailoverMetadata", +export const SecuritySettingsPatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VolumeFailoverMetadata", + className: "SecuritySettingsPatch", modelProperties: { - volumeId: { - serializedName: "volumeId", + remoteManagementSettings: { + serializedName: "properties.remoteManagementSettings", type: { - name: "String" + name: "Composite", + className: "RemoteManagementSettingsPatch" } }, - volumeType: { - serializedName: "volumeType", + deviceAdminPassword: { + serializedName: "properties.deviceAdminPassword", type: { - name: "Enum", - allowedValues: [ - "Tiered", - "Archival", - "LocallyPinned" - ] - } - }, - sizeInBytes: { - serializedName: "sizeInBytes", - type: { - name: "Number" + name: "Composite", + className: "AsymmetricEncryptedSecret" } }, - backupCreatedDate: { - serializedName: "backupCreatedDate", + snapshotPassword: { + serializedName: "properties.snapshotPassword", type: { - name: "DateTime" + name: "Composite", + className: "AsymmetricEncryptedSecret" } }, - backupElementId: { - serializedName: "backupElementId", + chapSettings: { + serializedName: "properties.chapSettings", type: { - name: "String" + name: "Composite", + className: "ChapSettings" } }, - backupId: { - serializedName: "backupId", + cloudApplianceSettings: { + serializedName: "properties.cloudApplianceSettings", type: { - name: "String" + name: "Composite", + className: "CloudApplianceSettings" } - }, - backupPolicyId: { - serializedName: "backupPolicyId", + } + } + } +}; + +export const RemoteManagementSettingsPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteManagementSettingsPatch", + modelProperties: { + remoteManagementMode: { + serializedName: "remoteManagementMode", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: [ + "Unknown", + "Disabled", + "HttpsEnabled", + "HttpsAndHttpEnabled" + ] } } } } }; -export const VolumeContainerFailoverMetadata: msRest.CompositeMapper = { - serializedName: "VolumeContainerFailoverMetadata", +export const CloudApplianceSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VolumeContainerFailoverMetadata", + className: "CloudApplianceSettings", modelProperties: { - volumeContainerId: { - serializedName: "volumeContainerId", + serviceDataEncryptionKey: { + serializedName: "serviceDataEncryptionKey", type: { - name: "String" + name: "Composite", + className: "AsymmetricEncryptedSecret" } }, - volumes: { - serializedName: "volumes", + channelIntegrityKey: { + serializedName: "channelIntegrityKey", + type: { + name: "Composite", + className: "AsymmetricEncryptedSecret" + } + } + } + } +}; + +export const SendTestAlertEmailRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SendTestAlertEmailRequest", + modelProperties: { + emailList: { + serializedName: "emailList", + required: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "VolumeFailoverMetadata" + name: "String" } } } @@ -2011,118 +2161,109 @@ export const VolumeContainerFailoverMetadata: msRest.CompositeMapper = { } }; -export const FailoverSetEligibilityResult: msRest.CompositeMapper = { - serializedName: "FailoverSetEligibilityResult", +export const VolumeContainerList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "FailoverSetEligibilityResult", + className: "VolumeContainerList", modelProperties: { - isEligibleForFailover: { - serializedName: "isEligibleForFailover", - type: { - name: "Boolean" - } - }, - errorMessage: { - serializedName: "errorMessage", + value: { + serializedName: "value", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VolumeContainer" + } + } } } } } }; -export const FailoverSet: msRest.CompositeMapper = { - serializedName: "FailoverSet", +export const VolumeList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "FailoverSet", + className: "VolumeList", modelProperties: { - volumeContainers: { - serializedName: "volumeContainers", + value: { + serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "VolumeContainerFailoverMetadata" + className: "Volume" } } } - }, - eligibilityResult: { - serializedName: "eligibilityResult", - type: { - name: "Composite", - className: "FailoverSetEligibilityResult" - } } } } }; -export const TargetEligibilityErrorMessage: msRest.CompositeMapper = { - serializedName: "TargetEligibilityErrorMessage", +export const FailoverRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TargetEligibilityErrorMessage", + className: "FailoverRequest", modelProperties: { - message: { - serializedName: "message", - type: { - name: "String" - } - }, - resolution: { - serializedName: "resolution", + targetDeviceId: { + serializedName: "targetDeviceId", type: { name: "String" } }, - resultCode: { - serializedName: "resultCode", + volumeContainers: { + serializedName: "volumeContainers", type: { - name: "Enum", - allowedValues: [ - "TargetAndSourceCannotBeSameError", - "TargetIsNotOnlineError", - "TargetSourceIncompatibleVersionError", - "LocalToTieredVolumesConversionWarning", - "TargetInsufficientCapacityError", - "TargetInsufficientLocalVolumeMemoryError", - "TargetInsufficientTieredVolumeMemoryError" - ] + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const TargetEligibilityResult: msRest.CompositeMapper = { - serializedName: "TargetEligibilityResult", +export const ListFailoverTargetsRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TargetEligibilityResult", + className: "ListFailoverTargetsRequest", modelProperties: { - eligibilityStatus: { - serializedName: "eligibilityStatus", + volumeContainers: { + serializedName: "volumeContainers", type: { - name: "Enum", - allowedValues: [ - "NotEligible", - "Eligible" - ] + name: "Sequence", + element: { + type: { + name: "String" + } + } } - }, - messages: { - serializedName: "messages", + } + } + } +}; + +export const FailoverTargetsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FailoverTargetsList", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "TargetEligibilityErrorMessage" + className: "FailoverTarget" } } } @@ -2131,8 +2272,7 @@ export const TargetEligibilityResult: msRest.CompositeMapper = { } }; -export const FailoverTarget: msRest.CompositeMapper = { - serializedName: "FailoverTarget", +export const FailoverTarget: coreClient.CompositeMapper = { type: { name: "Composite", className: "FailoverTarget", @@ -2221,90 +2361,128 @@ export const FailoverTarget: msRest.CompositeMapper = { } }; -export const Feature: msRest.CompositeMapper = { - serializedName: "Feature", +export const TargetEligibilityResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Feature", + className: "TargetEligibilityResult", modelProperties: { - name: { - required: true, - serializedName: "name", + eligibilityStatus: { + serializedName: "eligibilityStatus", type: { - name: "String" + name: "Enum", + allowedValues: ["NotEligible", "Eligible"] } }, - status: { - required: true, - serializedName: "status", + messages: { + serializedName: "messages", type: { - name: "Enum", - allowedValues: [ - "NotAvailable", - "UnsupportedDeviceVersion", - "Supported" - ] + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TargetEligibilityErrorMessage" + } + } } } } } }; -export const FeatureFilter: msRest.CompositeMapper = { - serializedName: "FeatureFilter", +export const TargetEligibilityErrorMessage: coreClient.CompositeMapper = { type: { name: "Composite", - className: "FeatureFilter", + className: "TargetEligibilityErrorMessage", modelProperties: { - deviceId: { - serializedName: "deviceId", + message: { + serializedName: "message", + type: { + name: "String" + } + }, + resolution: { + serializedName: "resolution", type: { name: "String" } + }, + resultCode: { + serializedName: "resultCode", + type: { + name: "Enum", + allowedValues: [ + "TargetAndSourceCannotBeSameError", + "TargetIsNotOnlineError", + "TargetSourceIncompatibleVersionError", + "LocalToTieredVolumesConversionWarning", + "TargetInsufficientCapacityError", + "TargetInsufficientLocalVolumeMemoryError", + "TargetInsufficientTieredVolumeMemoryError" + ] + } } } } }; -export const HardwareComponent: msRest.CompositeMapper = { - serializedName: "HardwareComponent", +export const FeatureList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HardwareComponent", + className: "FeatureList", modelProperties: { - componentId: { + value: { + serializedName: "value", required: true, - serializedName: "componentId", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Feature" + } + } } - }, - displayName: { + } + } + } +}; + +export const Feature: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Feature", + modelProperties: { + name: { + serializedName: "name", required: true, - serializedName: "displayName", type: { name: "String" } }, status: { - required: true, serializedName: "status", + required: true, type: { name: "Enum", allowedValues: [ - "Unknown", - "NotPresent", - "PoweredOff", - "Ok", - "Recovering", - "Warning", - "Failure" + "NotAvailable", + "UnsupportedDeviceVersion", + "Supported" ] } - }, - statusDisplayName: { + } + } + } +}; + +export const Key: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Key", + modelProperties: { + activationKey: { + serializedName: "activationKey", required: true, - serializedName: "statusDisplayName", type: { name: "String" } @@ -2313,71 +2491,105 @@ export const HardwareComponent: msRest.CompositeMapper = { } }; -export const HardwareComponentGroup: msRest.CompositeMapper = { - serializedName: "HardwareComponentGroup", +export const SymmetricEncryptedSecret: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HardwareComponentGroup", + className: "SymmetricEncryptedSecret", modelProperties: { - ...BaseModel.type.modelProperties, - displayName: { + value: { + serializedName: "value", required: true, - serializedName: "properties.displayName", type: { name: "String" } }, - lastUpdatedTime: { - required: true, - serializedName: "properties.lastUpdatedTime", + valueCertificateThumbprint: { + serializedName: "valueCertificateThumbprint", type: { - name: "DateTime" + name: "String" } }, - components: { + encryptionAlgorithm: { + serializedName: "encryptionAlgorithm", required: true, - serializedName: "properties.components", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "HardwareComponent" - } - } + name: "Enum", + allowedValues: ["None", "AES256", "RSAES_PKCS1_v_1_5"] } } } } }; -export const JobErrorItem: msRest.CompositeMapper = { - serializedName: "JobErrorItem", +export const CloudAppliance: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobErrorItem", + className: "CloudAppliance", modelProperties: { - recommendations: { - serializedName: "recommendations", + name: { + serializedName: "name", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - code: { - required: true, - serializedName: "code", + vnetName: { + serializedName: "vnetName", type: { name: "String" } }, - message: { + vnetRegion: { + serializedName: "vnetRegion", required: true, - serializedName: "message", + type: { + name: "String" + } + }, + isVnetDnsConfigured: { + serializedName: "isVnetDnsConfigured", + type: { + name: "Boolean" + } + }, + isVnetExpressConfigured: { + serializedName: "isVnetExpressConfigured", + type: { + name: "Boolean" + } + }, + subnetName: { + serializedName: "subnetName", + type: { + name: "String" + } + }, + storageAccountName: { + serializedName: "storageAccountName", + type: { + name: "String" + } + }, + storageAccountType: { + serializedName: "storageAccountType", + type: { + name: "String" + } + }, + vmType: { + serializedName: "vmType", + type: { + name: "String" + } + }, + vmImageName: { + serializedName: "vmImageName", + type: { + name: "String" + } + }, + modelNumber: { + serializedName: "modelNumber", type: { name: "String" } @@ -2386,75 +2598,110 @@ export const JobErrorItem: msRest.CompositeMapper = { } }; -export const JobErrorDetails: msRest.CompositeMapper = { - serializedName: "JobErrorDetails", +export const StorageAccountCredentialList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobErrorDetails", + className: "StorageAccountCredentialList", modelProperties: { - errorDetails: { - serializedName: "errorDetails", + value: { + serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "JobErrorItem" + className: "StorageAccountCredential" } } } + } + } + } +}; + +export const AlertFilter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AlertFilter", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "Enum", + allowedValues: ["Active", "Cleared"] + } }, - code: { - required: true, - serializedName: "code", + severity: { + serializedName: "severity", type: { - name: "String" + name: "Enum", + allowedValues: ["Informational", "Warning", "Critical"] } }, - message: { - required: true, - serializedName: "message", + sourceType: { + serializedName: "sourceType", + type: { + name: "Enum", + allowedValues: ["Resource", "Device"] + } + }, + sourceName: { + serializedName: "sourceName", type: { name: "String" } + }, + appearedOnTime: { + serializedName: "appearedOnTime", + type: { + name: "DateTime" + } } } } }; -export const JobStage: msRest.CompositeMapper = { - serializedName: "JobStage", +export const BackupFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobStage", + className: "BackupFilter", modelProperties: { - message: { - serializedName: "message", + backupPolicyId: { + serializedName: "backupPolicyId", type: { name: "String" } }, - stageStatus: { - required: true, - serializedName: "stageStatus", + volumeId: { + serializedName: "volumeId", type: { - name: "Enum", - allowedValues: [ - "Running", - "Succeeded", - "Failed", - "Canceled" - ] + name: "String" } }, - detail: { - serializedName: "detail", + createdTime: { + serializedName: "createdTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const DimensionFilter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DimensionFilter", + modelProperties: { + name: { + serializedName: "name", type: { name: "String" } }, - errorCode: { - serializedName: "errorCode", + values: { + serializedName: "values", type: { name: "String" } @@ -2463,845 +2710,742 @@ export const JobStage: msRest.CompositeMapper = { } }; -export const Job: msRest.CompositeMapper = { - serializedName: "Job", +export const FeatureFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Job", + className: "FeatureFilter", + modelProperties: { + deviceId: { + serializedName: "deviceId", + type: { + name: "String" + } + } + } + } +}; + +export const JobFilter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "JobFilter", modelProperties: { - ...BaseModel.type.modelProperties, status: { - required: true, serializedName: "status", type: { - name: "Enum", - allowedValues: [ - "Running", - "Succeeded", - "Failed", - "Canceled" - ] + name: "String" } }, - startTime: { - serializedName: "startTime", + jobType: { + serializedName: "jobType", type: { - name: "DateTime" + name: "String" } }, - endTime: { - serializedName: "endTime", + startTime: { + serializedName: "startTime", type: { name: "DateTime" } - }, - percentComplete: { - required: true, - serializedName: "percentComplete", - type: { - name: "Number" - } - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "JobErrorDetails" - } - }, - jobType: { - required: true, - serializedName: "properties.jobType", - type: { - name: "Enum", - allowedValues: [ - "ScheduledBackup", - "ManualBackup", - "RestoreBackup", - "CloneVolume", - "FailoverVolumeContainers", - "CreateLocallyPinnedVolume", - "ModifyVolume", - "InstallUpdates", - "SupportPackageLogs", - "CreateCloudAppliance" - ] - } - }, - dataStats: { - serializedName: "properties.dataStats", + } + } + } +}; + +export const MetricFilter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricFilter", + modelProperties: { + name: { + serializedName: "name", type: { name: "Composite", - className: "DataStatistics" - } - }, - entityLabel: { - serializedName: "properties.entityLabel", - type: { - name: "String" + className: "MetricNameFilter" } }, - entityType: { - serializedName: "properties.entityType", + startTime: { + serializedName: "startTime", type: { - name: "String" + name: "DateTime" } }, - jobStages: { - serializedName: "properties.jobStages", + endTime: { + serializedName: "endTime", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "JobStage" - } - } + name: "DateTime" } }, - deviceId: { - serializedName: "properties.deviceId", + timeGrain: { + serializedName: "timeGrain", type: { name: "String" } }, - isCancellable: { - serializedName: "properties.isCancellable", - type: { - name: "Boolean" - } - }, - backupType: { - serializedName: "properties.backupType", - type: { - name: "Enum", - allowedValues: [ - "LocalSnapshot", - "CloudSnapshot" - ] - } - }, - sourceDeviceId: { - serializedName: "properties.sourceDeviceId", + category: { + serializedName: "category", + required: true, type: { name: "String" } }, - backupPointInTime: { - serializedName: "properties.backupPointInTime", + dimensions: { + serializedName: "dimensions", type: { - name: "DateTime" + name: "Composite", + className: "DimensionFilter" } } } } }; -export const JobFilter: msRest.CompositeMapper = { - serializedName: "JobFilter", +export const MetricNameFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobFilter", + className: "MetricNameFilter", modelProperties: { - status: { - serializedName: "status", - type: { - name: "String" - } - }, - jobType: { - serializedName: "jobType", + value: { + serializedName: "value", type: { name: "String" } - }, - startTime: { - serializedName: "startTime", - type: { - name: "DateTime" - } } } } }; -export const Key: msRest.CompositeMapper = { - serializedName: "Key", +export const Manager: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Key", + className: "Manager", modelProperties: { - activationKey: { - required: true, - serializedName: "activationKey", + ...Resource.type.modelProperties, + etag: { + serializedName: "etag", type: { name: "String" } - } - } - } -}; - -export const ListFailoverTargetsRequest: msRest.CompositeMapper = { - serializedName: "ListFailoverTargetsRequest", - type: { - name: "Composite", - className: "ListFailoverTargetsRequest", - modelProperties: { - volumeContainers: { - serializedName: "volumeContainers", + }, + cisIntrinsicSettings: { + serializedName: "properties.cisIntrinsicSettings", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Composite", + className: "ManagerIntrinsicSettings" } - } - } - } -}; - -export const ManagerIntrinsicSettings: msRest.CompositeMapper = { - serializedName: "ManagerIntrinsicSettings", - type: { - name: "Composite", - className: "ManagerIntrinsicSettings", - modelProperties: { - type: { - required: true, - serializedName: "type", + }, + sku: { + serializedName: "properties.sku", type: { - name: "Enum", - allowedValues: [ - "GardaV1", - "HelsinkiV1" - ] + name: "Composite", + className: "ManagerSku" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" } } } } }; -export const ManagerSku: msRest.CompositeMapper = { - serializedName: "ManagerSku", +export const AccessControlRecord: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagerSku", + className: "AccessControlRecord", modelProperties: { - name: { + ...BaseModel.type.modelProperties, + initiatorName: { + serializedName: "properties.initiatorName", required: true, - isConstant: true, - serializedName: "name", - defaultValue: 'Standard', type: { name: "String" } + }, + volumeCount: { + serializedName: "properties.volumeCount", + readOnly: true, + type: { + name: "Number" + } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const Alert: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "Alert", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + ...BaseModel.type.modelProperties, + title: { + serializedName: "properties.title", + required: true, type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + scope: { + serializedName: "properties.scope", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Resource", "Device"] } }, - type: { - readOnly: true, - serializedName: "type", + alertType: { + serializedName: "properties.alertType", + required: true, type: { name: "String" } }, - location: { + appearedAtTime: { + serializedName: "properties.appearedAtTime", required: true, - serializedName: "location", type: { - name: "String" + name: "DateTime" } }, - tags: { - serializedName: "tags", + appearedAtSourceTime: { + serializedName: "properties.appearedAtSourceTime", + required: true, type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "DateTime" } - } - } - } -}; - -export const Manager: msRest.CompositeMapper = { - serializedName: "Manager", - type: { - name: "Composite", - className: "Manager", - modelProperties: { - ...Resource.type.modelProperties, - cisIntrinsicSettings: { - serializedName: "properties.cisIntrinsicSettings", + }, + clearedAtTime: { + serializedName: "properties.clearedAtTime", type: { - name: "Composite", - className: "ManagerIntrinsicSettings" + name: "DateTime" } }, - sku: { - isConstant: true, - serializedName: "properties.sku", - defaultValue: {}, + clearedAtSourceTime: { + serializedName: "properties.clearedAtSourceTime", type: { - name: "Composite", - className: "ManagerSku" + name: "DateTime" } }, - provisioningState: { - serializedName: "properties.provisioningState", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - type: { - name: "String" - } - } - } - } -}; - -export const ManagerExtendedInfo: msRest.CompositeMapper = { - serializedName: "ManagerExtendedInfo", - type: { - name: "Composite", - className: "ManagerExtendedInfo", - modelProperties: { - ...BaseModel.type.modelProperties, - version: { - serializedName: "properties.version", + source: { + serializedName: "properties.source", type: { - name: "String" + name: "Composite", + className: "AlertSource" } }, - integrityKey: { - required: true, - serializedName: "properties.integrityKey", + recommendation: { + serializedName: "properties.recommendation", type: { name: "String" } }, - encryptionKey: { - serializedName: "properties.encryptionKey", + resolutionReason: { + serializedName: "properties.resolutionReason", type: { name: "String" } }, - encryptionKeyThumbprint: { - serializedName: "properties.encryptionKeyThumbprint", + severity: { + serializedName: "properties.severity", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Informational", "Warning", "Critical"] } }, - portalCertificateThumbprint: { - serializedName: "properties.portalCertificateThumbprint", + status: { + serializedName: "properties.status", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Active", "Cleared"] } }, - algorithm: { - required: true, - serializedName: "properties.algorithm", + errorDetails: { + serializedName: "properties.errorDetails", type: { - name: "String" + name: "Composite", + className: "AlertErrorDetails" } }, - etag: { - serializedName: "etag", + detailedInformation: { + serializedName: "properties.detailedInformation", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const ManagerPatch: msRest.CompositeMapper = { - serializedName: "ManagerPatch", +export const BandwidthSetting: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagerPatch", + className: "BandwidthSetting", modelProperties: { - tags: { - serializedName: "tags", + ...BaseModel.type.modelProperties, + schedules: { + serializedName: "properties.schedules", + required: true, type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "BandwidthSchedule" } } } + }, + volumeCount: { + serializedName: "properties.volumeCount", + readOnly: true, + type: { + name: "Number" + } } } } }; -export const MetricAvailablity: msRest.CompositeMapper = { - serializedName: "MetricAvailablity", +export const CloudApplianceConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricAvailablity", + className: "CloudApplianceConfiguration", modelProperties: { - timeGrain: { - serializedName: "timeGrain", + ...BaseModel.type.modelProperties, + modelNumber: { + serializedName: "properties.modelNumber", + required: true, type: { name: "String" } }, - retention: { - serializedName: "retention", + cloudPlatform: { + serializedName: "properties.cloudPlatform", + required: true, type: { name: "String" } - } - } - } -}; - -export const MetricData: msRest.CompositeMapper = { - serializedName: "MetricData", - type: { - name: "Composite", - className: "MetricData", - modelProperties: { - timeStamp: { - serializedName: "timeStamp", - type: { - name: "DateTime" - } }, - sum: { - serializedName: "sum", + acsConfiguration: { + serializedName: "properties.acsConfiguration", type: { - name: "Number" + name: "Composite", + className: "AcsConfiguration" } }, - count: { - serializedName: "count", + supportedStorageAccountTypes: { + serializedName: "properties.supportedStorageAccountTypes", + required: true, type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - average: { - serializedName: "average", + supportedRegions: { + serializedName: "properties.supportedRegions", + required: true, type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - minimum: { - serializedName: "minimum", + supportedVmTypes: { + serializedName: "properties.supportedVmTypes", + required: true, type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - maximum: { - serializedName: "maximum", + supportedVmImages: { + serializedName: "properties.supportedVmImages", + required: true, type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VmImage" + } + } } } } } }; -export const MetricName: msRest.CompositeMapper = { - serializedName: "MetricName", +export const ConfigureDeviceRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricName", + className: "ConfigureDeviceRequest", modelProperties: { - value: { - serializedName: "value", + ...BaseModel.type.modelProperties, + friendlyName: { + serializedName: "properties.friendlyName", + required: true, type: { name: "String" } }, - localizedValue: { - serializedName: "localizedValue", + currentDeviceName: { + serializedName: "properties.currentDeviceName", + required: true, type: { name: "String" } - } - } - } -}; - -export const MetricDimension: msRest.CompositeMapper = { - serializedName: "MetricDimension", - type: { - name: "Composite", - className: "MetricDimension", - modelProperties: { - name: { - serializedName: "name", + }, + timeZone: { + serializedName: "properties.timeZone", + required: true, type: { name: "String" } }, - value: { - serializedName: "value", + dnsSettings: { + serializedName: "properties.dnsSettings", type: { - name: "String" + name: "Composite", + className: "SecondaryDNSSettings" + } + }, + networkInterfaceData0Settings: { + serializedName: "properties.networkInterfaceData0Settings", + type: { + name: "Composite", + className: "NetworkInterfaceData0Settings" } } } } }; -export const MetricDefinition: msRest.CompositeMapper = { - serializedName: "MetricDefinition", +export const Device: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricDefinition", + className: "Device", modelProperties: { - name: { - serializedName: "name", + ...BaseModel.type.modelProperties, + friendlyName: { + serializedName: "properties.friendlyName", + required: true, type: { - name: "Composite", - className: "MetricName" + name: "String" } }, - unit: { - serializedName: "unit", + activationTime: { + serializedName: "properties.activationTime", + required: true, type: { - name: "Enum", - allowedValues: [ - "Bytes", - "BytesPerSecond", - "Count", - "CountPerSecond", - "Percent", - "Seconds" - ] + name: "DateTime" } }, - primaryAggregationType: { - serializedName: "primaryAggregationType", + culture: { + serializedName: "properties.culture", + required: true, type: { - name: "Enum", - allowedValues: [ - "Average", - "Last", - "Maximum", - "Minimum", - "None", - "Total" - ] + name: "String" } }, - resourceId: { - serializedName: "resourceId", + deviceDescription: { + serializedName: "properties.deviceDescription", + required: true, type: { name: "String" } }, - metricAvailabilities: { - serializedName: "metricAvailabilities", + deviceSoftwareVersion: { + serializedName: "properties.deviceSoftwareVersion", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricAvailablity" - } - } + name: "String" } }, - dimensions: { - serializedName: "dimensions", + friendlySoftwareName: { + serializedName: "properties.friendlySoftwareName", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricDimension" - } - } + name: "String" } }, - category: { - serializedName: "category", + deviceConfigurationStatus: { + serializedName: "properties.deviceConfigurationStatus", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Complete", "Pending"] } }, - type: { - serializedName: "type", + targetIqn: { + serializedName: "properties.targetIqn", + required: true, type: { name: "String" } - } - } - } -}; - -export const MetricNameFilter: msRest.CompositeMapper = { - serializedName: "MetricNameFilter", - type: { - name: "Composite", - className: "MetricNameFilter", - modelProperties: { - value: { - serializedName: "value", + }, + modelDescription: { + serializedName: "properties.modelDescription", + required: true, type: { name: "String" } - } - } - } -}; - -export const MetricFilter: msRest.CompositeMapper = { - serializedName: "MetricFilter", - type: { - name: "Composite", - className: "MetricFilter", - modelProperties: { - name: { - serializedName: "name", + }, + status: { + serializedName: "properties.status", + required: true, type: { - name: "Composite", - className: "MetricNameFilter" + name: "Enum", + allowedValues: [ + "Unknown", + "Online", + "Offline", + "Deactivated", + "RequiresAttention", + "MaintenanceMode", + "Creating", + "Provisioning", + "Deactivating", + "Deleted", + "ReadyToSetup" + ] } }, - startTime: { - serializedName: "startTime", + serialNumber: { + serializedName: "properties.serialNumber", + required: true, type: { - name: "DateTime" + name: "String" } }, - endTime: { - serializedName: "endTime", + deviceType: { + serializedName: "properties.deviceType", + required: true, type: { - name: "DateTime" + name: "Enum", + allowedValues: [ + "Invalid", + "Series8000VirtualAppliance", + "Series8000PhysicalAppliance" + ] } }, - timeGrain: { - serializedName: "timeGrain", + activeController: { + serializedName: "properties.activeController", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Unknown", "None", "Controller0", "Controller1"] } }, - category: { + friendlySoftwareVersion: { + serializedName: "properties.friendlySoftwareVersion", required: true, - serializedName: "category", type: { name: "String" } }, - dimensions: { - serializedName: "dimensions", + availableLocalStorageInBytes: { + serializedName: "properties.availableLocalStorageInBytes", type: { - name: "Composite", - className: "DimensionFilter" + name: "Number" } - } - } - } -}; - -export const Metrics: msRest.CompositeMapper = { - serializedName: "Metrics", - type: { - name: "Composite", - className: "Metrics", - modelProperties: { - resourceId: { - serializedName: "resourceId", + }, + availableTieredStorageInBytes: { + serializedName: "properties.availableTieredStorageInBytes", type: { - name: "String" + name: "Number" } }, - startTime: { - serializedName: "startTime", + provisionedTieredStorageInBytes: { + serializedName: "properties.provisionedTieredStorageInBytes", type: { - name: "DateTime" + name: "Number" } }, - endTime: { - serializedName: "endTime", + provisionedLocalStorageInBytes: { + serializedName: "properties.provisionedLocalStorageInBytes", type: { - name: "DateTime" + name: "Number" } }, - timeGrain: { - serializedName: "timeGrain", + provisionedVolumeSizeInBytes: { + serializedName: "properties.provisionedVolumeSizeInBytes", type: { - name: "String" + name: "Number" } }, - primaryAggregation: { - serializedName: "primaryAggregation", + usingStorageInBytes: { + serializedName: "properties.usingStorageInBytes", type: { - name: "Enum", - allowedValues: [ - "Average", - "Last", - "Maximum", - "Minimum", - "None", - "Total" - ] + name: "Number" } }, - name: { - serializedName: "name", + totalTieredStorageInBytes: { + serializedName: "properties.totalTieredStorageInBytes", type: { - name: "Composite", - className: "MetricName" + name: "Number" } }, - dimensions: { - serializedName: "dimensions", + agentGroupVersion: { + serializedName: "properties.agentGroupVersion", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricDimension" - } - } + name: "Number" } }, - unit: { - serializedName: "unit", + networkInterfaceCardCount: { + serializedName: "properties.networkInterfaceCardCount", type: { - name: "Enum", - allowedValues: [ - "Bytes", - "BytesPerSecond", - "Count", - "CountPerSecond", - "Percent", - "Seconds" - ] + name: "Number" } }, - type: { - serializedName: "type", + deviceLocation: { + serializedName: "properties.deviceLocation", type: { name: "String" } }, - values: { - serializedName: "values", + virtualMachineApiType: { + serializedName: "properties.virtualMachineApiType", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricData" - } - } + name: "Enum", + allowedValues: ["Classic", "Arm"] + } + }, + details: { + serializedName: "properties.details", + type: { + name: "Composite", + className: "DeviceDetails" + } + }, + rolloverDetails: { + serializedName: "properties.rolloverDetails", + type: { + name: "Composite", + className: "DeviceRolloverDetails" } } } } }; -export const NicIPv4: msRest.CompositeMapper = { - serializedName: "NicIPv4", +export const AlertSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NicIPv4", + className: "AlertSettings", modelProperties: { - ipv4Address: { - serializedName: "ipv4Address", + ...BaseModel.type.modelProperties, + emailNotification: { + serializedName: "properties.emailNotification", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } }, - ipv4Netmask: { - serializedName: "ipv4Netmask", + alertNotificationCulture: { + serializedName: "properties.alertNotificationCulture", type: { name: "String" } }, - ipv4Gateway: { - serializedName: "ipv4Gateway", + notificationToServiceOwners: { + serializedName: "properties.notificationToServiceOwners", type: { - name: "String" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } }, - controller0Ipv4Address: { - serializedName: "controller0Ipv4Address", + additionalRecipientEmailList: { + serializedName: "properties.additionalRecipientEmailList", type: { - name: "String" - } - }, - controller1Ipv4Address: { - serializedName: "controller1Ipv4Address", - type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const NicIPv6: msRest.CompositeMapper = { - serializedName: "NicIPv6", +export const BackupPolicy: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NicIPv6", + className: "BackupPolicy", modelProperties: { - ipv6Address: { - serializedName: "ipv6Address", + ...BaseModel.type.modelProperties, + volumeIds: { + serializedName: "properties.volumeIds", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - ipv6Prefix: { - serializedName: "ipv6Prefix", + nextBackupTime: { + serializedName: "properties.nextBackupTime", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - ipv6Gateway: { - serializedName: "ipv6Gateway", + lastBackupTime: { + serializedName: "properties.lastBackupTime", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - controller0Ipv6Address: { - serializedName: "controller0Ipv6Address", + schedulesCount: { + serializedName: "properties.schedulesCount", + readOnly: true, type: { - name: "String" + name: "Number" } }, - controller1Ipv6Address: { - serializedName: "controller1Ipv6Address", + scheduledBackupStatus: { + serializedName: "properties.scheduledBackupStatus", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Disabled", "Enabled"] + } + }, + backupPolicyCreationType: { + serializedName: "properties.backupPolicyCreationType", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["BySaaS", "BySSM"] + } + }, + ssmHostName: { + serializedName: "properties.ssmHostName", + readOnly: true, type: { name: "String" } @@ -3310,110 +3454,152 @@ export const NicIPv6: msRest.CompositeMapper = { } }; -export const NetworkAdapters: msRest.CompositeMapper = { - serializedName: "NetworkAdapters", +export const BackupSchedule: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkAdapters", + className: "BackupSchedule", modelProperties: { - interfaceId: { + ...BaseModel.type.modelProperties, + scheduleRecurrence: { + serializedName: "properties.scheduleRecurrence", + type: { + name: "Composite", + className: "ScheduleRecurrence" + } + }, + backupType: { + serializedName: "properties.backupType", required: true, - serializedName: "interfaceId", type: { name: "Enum", - allowedValues: [ - "Invalid", - "Data0", - "Data1", - "Data2", - "Data3", - "Data4", - "Data5" - ] + allowedValues: ["LocalSnapshot", "CloudSnapshot"] } }, - netInterfaceStatus: { + retentionCount: { + serializedName: "properties.retentionCount", required: true, - serializedName: "netInterfaceStatus", type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] + name: "Number" } }, - isDefault: { - serializedName: "isDefault", + startTime: { + serializedName: "properties.startTime", + required: true, type: { - name: "Boolean" + name: "DateTime" } }, - iscsiAndCloudStatus: { + scheduleStatus: { + serializedName: "properties.scheduleStatus", required: true, - serializedName: "iscsiAndCloudStatus", type: { name: "Enum", - allowedValues: [ - "Disabled", - "IscsiEnabled", - "CloudEnabled", - "IscsiAndCloudEnabled" - ] + allowedValues: ["Enabled", "Disabled"] } }, - speed: { - serializedName: "speed", + lastSuccessfulRun: { + serializedName: "properties.lastSuccessfulRun", + readOnly: true, type: { - name: "Number" + name: "DateTime" + } + } + } + } +}; + +export const Backup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Backup", + modelProperties: { + ...BaseModel.type.modelProperties, + createdOn: { + serializedName: "properties.createdOn", + required: true, + type: { + name: "DateTime" } }, - mode: { + sizeInBytes: { + serializedName: "properties.sizeInBytes", required: true, - serializedName: "mode", + type: { + name: "Number" + } + }, + backupType: { + serializedName: "properties.backupType", type: { name: "Enum", - allowedValues: [ - "Invalid", - "IPV4", - "IPV6", - "BOTH" - ] + allowedValues: ["LocalSnapshot", "CloudSnapshot"] } }, - nicIpv4Settings: { - serializedName: "nicIpv4Settings", + backupJobCreationType: { + serializedName: "properties.backupJobCreationType", type: { - name: "Composite", - className: "NicIPv4" + name: "Enum", + allowedValues: ["Adhoc", "BySchedule", "BySSM"] } }, - nicIpv6Settings: { - serializedName: "nicIpv6Settings", + backupPolicyId: { + serializedName: "properties.backupPolicyId", type: { - name: "Composite", - className: "NicIPv6" + name: "String" + } + }, + ssmHostName: { + serializedName: "properties.ssmHostName", + type: { + name: "String" + } + }, + elements: { + serializedName: "properties.elements", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BackupElement" + } + } } } } } }; -export const NetworkAdapterList: msRest.CompositeMapper = { - serializedName: "NetworkAdapterList", +export const HardwareComponentGroup: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkAdapterList", + className: "HardwareComponentGroup", modelProperties: { - value: { + ...BaseModel.type.modelProperties, + displayName: { + serializedName: "properties.displayName", + required: true, + type: { + name: "String" + } + }, + lastUpdatedTime: { + serializedName: "properties.lastUpdatedTime", + required: true, + type: { + name: "DateTime" + } + }, + components: { + serializedName: "properties.components", required: true, - serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "NetworkAdapters" + className: "HardwareComponent" } } } @@ -3422,222 +3608,228 @@ export const NetworkAdapterList: msRest.CompositeMapper = { } }; -export const WebproxySettings: msRest.CompositeMapper = { - serializedName: "WebproxySettings", +export const ControllerPowerStateChangeRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WebproxySettings", + className: "ControllerPowerStateChangeRequest", modelProperties: { - connectionUri: { - serializedName: "connectionUri", + ...BaseModel.type.modelProperties, + action: { + serializedName: "properties.action", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Start", "Restart", "Shutdown"] } }, - authentication: { + activeController: { + serializedName: "properties.activeController", + required: true, + type: { + name: "Enum", + allowedValues: ["Unknown", "None", "Controller0", "Controller1"] + } + }, + controller0State: { + serializedName: "properties.controller0State", required: true, - serializedName: "authentication", type: { name: "Enum", allowedValues: [ - "Invalid", - "None", - "Basic", - "NTLM" + "NotPresent", + "PoweredOff", + "Ok", + "Recovering", + "Warning", + "Failure" ] } }, - username: { + controller1State: { + serializedName: "properties.controller1State", required: true, - serializedName: "username", type: { - name: "String" + name: "Enum", + allowedValues: [ + "NotPresent", + "PoweredOff", + "Ok", + "Recovering", + "Warning", + "Failure" + ] } } } } }; -export const NetworkSettings: msRest.CompositeMapper = { - serializedName: "NetworkSettings", +export const Job: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkSettings", + className: "Job", modelProperties: { ...BaseModel.type.modelProperties, - dnsSettings: { + status: { + serializedName: "status", required: true, - serializedName: "properties.dnsSettings", type: { - name: "Composite", - className: "DNSSettings" + name: "Enum", + allowedValues: ["Running", "Succeeded", "Failed", "Canceled"] } }, - networkAdapters: { - required: true, - serializedName: "properties.networkAdapters", + startTime: { + serializedName: "startTime", type: { - name: "Composite", - className: "NetworkAdapterList" + name: "DateTime" } }, - webproxySettings: { + endTime: { + serializedName: "endTime", + type: { + name: "DateTime" + } + }, + percentComplete: { + serializedName: "percentComplete", required: true, - serializedName: "properties.webproxySettings", type: { - name: "Composite", - className: "WebproxySettings" + name: "Number" } - } - } - } -}; - -export const NetworkSettingsPatch: msRest.CompositeMapper = { - serializedName: "NetworkSettingsPatch", - type: { - name: "Composite", - className: "NetworkSettingsPatch", - modelProperties: { - dnsSettings: { - serializedName: "properties.dnsSettings", + }, + error: { + serializedName: "error", type: { name: "Composite", - className: "DNSSettings" + className: "JobErrorDetails" } }, - networkAdapters: { - serializedName: "properties.networkAdapters", + jobType: { + serializedName: "properties.jobType", + type: { + name: "Enum", + allowedValues: [ + "ScheduledBackup", + "ManualBackup", + "RestoreBackup", + "CloneVolume", + "FailoverVolumeContainers", + "CreateLocallyPinnedVolume", + "ModifyVolume", + "InstallUpdates", + "SupportPackageLogs", + "CreateCloudAppliance" + ] + } + }, + dataStats: { + serializedName: "properties.dataStats", type: { name: "Composite", - className: "NetworkAdapterList" + className: "DataStatistics" } - } - } - } -}; - -export const PublicKey: msRest.CompositeMapper = { - serializedName: "PublicKey", - type: { - name: "Composite", - className: "PublicKey", - modelProperties: { - key: { - required: true, - serializedName: "key", + }, + entityLabel: { + serializedName: "properties.entityLabel", type: { name: "String" } - } - } - } -}; - -export const RemoteManagementSettings: msRest.CompositeMapper = { - serializedName: "RemoteManagementSettings", - type: { - name: "Composite", - className: "RemoteManagementSettings", - modelProperties: { - remoteManagementMode: { - required: true, - serializedName: "remoteManagementMode", + }, + entityType: { + serializedName: "properties.entityType", type: { - name: "Enum", - allowedValues: [ - "Unknown", - "Disabled", - "HttpsEnabled", - "HttpsAndHttpEnabled" - ] + name: "String" } }, - remoteManagementCertificate: { - serializedName: "remoteManagementCertificate", + jobStages: { + serializedName: "properties.jobStages", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "JobStage" + } + } + } + }, + deviceId: { + serializedName: "properties.deviceId", type: { name: "String" } - } - } - } -}; - -export const RemoteManagementSettingsPatch: msRest.CompositeMapper = { - serializedName: "RemoteManagementSettingsPatch", - type: { - name: "Composite", - className: "RemoteManagementSettingsPatch", - modelProperties: { - remoteManagementMode: { - required: true, - serializedName: "remoteManagementMode", + }, + isCancellable: { + serializedName: "properties.isCancellable", + type: { + name: "Boolean" + } + }, + backupType: { + serializedName: "properties.backupType", type: { name: "Enum", - allowedValues: [ - "Unknown", - "Disabled", - "HttpsEnabled", - "HttpsAndHttpEnabled" - ] + allowedValues: ["LocalSnapshot", "CloudSnapshot"] + } + }, + sourceDeviceId: { + serializedName: "properties.sourceDeviceId", + type: { + name: "String" + } + }, + backupPointInTime: { + serializedName: "properties.backupPointInTime", + type: { + name: "DateTime" } } } } }; -export const SecuritySettings: msRest.CompositeMapper = { - serializedName: "SecuritySettings", +export const NetworkSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SecuritySettings", + className: "NetworkSettings", modelProperties: { ...BaseModel.type.modelProperties, - remoteManagementSettings: { - required: true, - serializedName: "properties.remoteManagementSettings", + dnsSettings: { + serializedName: "properties.dnsSettings", type: { name: "Composite", - className: "RemoteManagementSettings" + className: "DNSSettings" } }, - chapSettings: { - required: true, - serializedName: "properties.chapSettings", + networkAdapters: { + serializedName: "properties.networkAdapters", type: { name: "Composite", - className: "ChapSettings" + className: "NetworkAdapterList" + } + }, + webproxySettings: { + serializedName: "properties.webproxySettings", + type: { + name: "Composite", + className: "WebproxySettings" } } } } }; -export const SecuritySettingsPatch: msRest.CompositeMapper = { - serializedName: "SecuritySettingsPatch", +export const SecuritySettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SecuritySettingsPatch", + className: "SecuritySettings", modelProperties: { + ...BaseModel.type.modelProperties, remoteManagementSettings: { serializedName: "properties.remoteManagementSettings", type: { name: "Composite", - className: "RemoteManagementSettingsPatch" - } - }, - deviceAdminPassword: { - serializedName: "properties.deviceAdminPassword", - type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" - } - }, - snapshotPassword: { - serializedName: "properties.snapshotPassword", - type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" + className: "RemoteManagementSettings" } }, chapSettings: { @@ -3646,27 +3838,32 @@ export const SecuritySettingsPatch: msRest.CompositeMapper = { name: "Composite", className: "ChapSettings" } - }, - cloudApplianceSettings: { - serializedName: "properties.cloudApplianceSettings", - type: { - name: "Composite", - className: "CloudApplianceSettings" - } } } } }; -export const SendTestAlertEmailRequest: msRest.CompositeMapper = { - serializedName: "SendTestAlertEmailRequest", +export const TimeSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SendTestAlertEmailRequest", + className: "TimeSettings", modelProperties: { - emailList: { + ...BaseModel.type.modelProperties, + timeZone: { + serializedName: "properties.timeZone", required: true, - serializedName: "emailList", + type: { + name: "String" + } + }, + primaryTimeServer: { + serializedName: "properties.primaryTimeServer", + type: { + name: "String" + } + }, + secondaryTimeServer: { + serializedName: "properties.secondaryTimeServer", type: { name: "Sequence", element: { @@ -3680,190 +3877,137 @@ export const SendTestAlertEmailRequest: msRest.CompositeMapper = { } }; -export const StorageAccountCredential: msRest.CompositeMapper = { - serializedName: "StorageAccountCredential", +export const Updates: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageAccountCredential", + className: "Updates", modelProperties: { ...BaseModel.type.modelProperties, - endPoint: { - required: true, - serializedName: "properties.endPoint", + regularUpdatesAvailable: { + serializedName: "properties.regularUpdatesAvailable", type: { - name: "String" + name: "Boolean" } }, - sslStatus: { - required: true, - serializedName: "properties.sslStatus", + maintenanceModeUpdatesAvailable: { + serializedName: "properties.maintenanceModeUpdatesAvailable", type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] + name: "Boolean" } }, - accessKey: { - serializedName: "properties.accessKey", + isUpdateInProgress: { + serializedName: "properties.isUpdateInProgress", type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" + name: "Boolean" } }, - volumesCount: { - readOnly: true, - serializedName: "properties.volumesCount", + lastUpdatedTime: { + serializedName: "properties.lastUpdatedTime", type: { - name: "Number" + name: "DateTime" } } } } }; -export const SymmetricEncryptedSecret: msRest.CompositeMapper = { - serializedName: "SymmetricEncryptedSecret", +export const VolumeContainer: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SymmetricEncryptedSecret", + className: "VolumeContainer", modelProperties: { - value: { - required: true, - serializedName: "value", - type: { - name: "String" - } - }, - valueCertificateThumbprint: { - serializedName: "valueCertificateThumbprint", + ...BaseModel.type.modelProperties, + encryptionKey: { + serializedName: "properties.encryptionKey", type: { - name: "String" + name: "Composite", + className: "AsymmetricEncryptedSecret" } }, - encryptionAlgorithm: { - required: true, - serializedName: "encryptionAlgorithm", + encryptionStatus: { + serializedName: "properties.encryptionStatus", + readOnly: true, type: { name: "Enum", - allowedValues: [ - "None", - "AES256", - "RSAES_PKCS1_v_1_5" - ] + allowedValues: ["Enabled", "Disabled"] } - } - } - } -}; - -export const TimeSettings: msRest.CompositeMapper = { - serializedName: "TimeSettings", - type: { - name: "Composite", - className: "TimeSettings", - modelProperties: { - ...BaseModel.type.modelProperties, - timeZone: { - required: true, - serializedName: "properties.timeZone", + }, + volumeCount: { + serializedName: "properties.volumeCount", + readOnly: true, type: { - name: "String" + name: "Number" } }, - primaryTimeServer: { - serializedName: "properties.primaryTimeServer", + storageAccountCredentialId: { + serializedName: "properties.storageAccountCredentialId", + required: true, type: { name: "String" } }, - secondaryTimeServer: { - serializedName: "properties.secondaryTimeServer", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const Updates: msRest.CompositeMapper = { - serializedName: "Updates", - type: { - name: "Composite", - className: "Updates", - modelProperties: { - ...BaseModel.type.modelProperties, - regularUpdatesAvailable: { - serializedName: "properties.regularUpdatesAvailable", + ownerShipStatus: { + serializedName: "properties.ownerShipStatus", + readOnly: true, type: { - name: "Boolean" + name: "Enum", + allowedValues: ["Owned", "NotOwned"] } }, - maintenanceModeUpdatesAvailable: { - serializedName: "properties.maintenanceModeUpdatesAvailable", + bandWidthRateInMbps: { + serializedName: "properties.bandWidthRateInMbps", type: { - name: "Boolean" + name: "Number" } }, - isUpdateInProgress: { - serializedName: "properties.isUpdateInProgress", + bandwidthSettingId: { + serializedName: "properties.bandwidthSettingId", type: { - name: "Boolean" + name: "String" } }, - lastUpdatedTime: { - serializedName: "properties.lastUpdatedTime", + totalCloudStorageUsageInBytes: { + serializedName: "properties.totalCloudStorageUsageInBytes", + readOnly: true, type: { - name: "DateTime" + name: "Number" } } } } }; -export const Volume: msRest.CompositeMapper = { - serializedName: "Volume", +export const Volume: coreClient.CompositeMapper = { type: { name: "Composite", className: "Volume", modelProperties: { ...BaseModel.type.modelProperties, sizeInBytes: { - required: true, serializedName: "properties.sizeInBytes", + required: true, type: { name: "Number" } }, volumeType: { - required: true, serializedName: "properties.volumeType", + required: true, type: { name: "Enum", - allowedValues: [ - "Tiered", - "Archival", - "LocallyPinned" - ] + allowedValues: ["Tiered", "Archival", "LocallyPinned"] } }, volumeContainerId: { - readOnly: true, serializedName: "properties.volumeContainerId", + readOnly: true, type: { name: "String" } }, accessControlRecordIds: { - required: true, serializedName: "properties.accessControlRecordIds", + required: true, type: { name: "Sequence", element: { @@ -3874,54 +4018,40 @@ export const Volume: msRest.CompositeMapper = { } }, volumeStatus: { - required: true, serializedName: "properties.volumeStatus", + required: true, type: { name: "Enum", - allowedValues: [ - "Online", - "Offline" - ] + allowedValues: ["Online", "Offline"] } }, operationStatus: { - readOnly: true, serializedName: "properties.operationStatus", + readOnly: true, type: { name: "Enum", - allowedValues: [ - "None", - "Updating", - "Deleting", - "Restoring" - ] + allowedValues: ["None", "Updating", "Deleting", "Restoring"] } }, backupStatus: { - readOnly: true, serializedName: "properties.backupStatus", + readOnly: true, type: { name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] + allowedValues: ["Enabled", "Disabled"] } }, monitoringStatus: { - required: true, serializedName: "properties.monitoringStatus", + required: true, type: { name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] + allowedValues: ["Enabled", "Disabled"] } }, backupPolicyIds: { - readOnly: true, serializedName: "properties.backupPolicyIds", + readOnly: true, type: { name: "Sequence", element: { @@ -3935,100 +4065,76 @@ export const Volume: msRest.CompositeMapper = { } }; -export const VolumeContainer: msRest.CompositeMapper = { - serializedName: "VolumeContainer", +export const EncryptionSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VolumeContainer", + className: "EncryptionSettings", modelProperties: { ...BaseModel.type.modelProperties, - encryptionKey: { - serializedName: "properties.encryptionKey", - type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" - } - }, encryptionStatus: { - readOnly: true, serializedName: "properties.encryptionStatus", + required: true, type: { name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] + allowedValues: ["Enabled", "Disabled"] } }, - volumeCount: { - readOnly: true, - serializedName: "properties.volumeCount", + keyRolloverStatus: { + serializedName: "properties.keyRolloverStatus", + required: true, type: { - name: "Number" + name: "Enum", + allowedValues: ["Required", "NotRequired"] } - }, - storageAccountCredentialId: { - required: true, - serializedName: "properties.storageAccountCredentialId", + } + } + } +}; + +export const ManagerExtendedInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagerExtendedInfo", + modelProperties: { + ...BaseModel.type.modelProperties, + etag: { + serializedName: "etag", type: { name: "String" } }, - ownerShipStatus: { - readOnly: true, - serializedName: "properties.ownerShipStatus", + version: { + serializedName: "properties.version", type: { - name: "Enum", - allowedValues: [ - "Owned", - "NotOwned" - ] + name: "String" } }, - bandWidthRateInMbps: { - serializedName: "properties.bandWidthRateInMbps", + integrityKey: { + serializedName: "properties.integrityKey", type: { - name: "Number" + name: "String" } }, - bandwidthSettingId: { - serializedName: "properties.bandwidthSettingId", + encryptionKey: { + serializedName: "properties.encryptionKey", type: { name: "String" } }, - totalCloudStorageUsageInBytes: { - readOnly: true, - serializedName: "properties.totalCloudStorageUsageInBytes", + encryptionKeyThumbprint: { + serializedName: "properties.encryptionKeyThumbprint", type: { - name: "Number" + name: "String" } - } - } - } -}; - -export const AvailableProviderOperationList: msRest.CompositeMapper = { - serializedName: "AvailableProviderOperationList", - type: { - name: "Composite", - className: "AvailableProviderOperationList", - modelProperties: { - value: { - required: true, - serializedName: "", + }, + portalCertificateThumbprint: { + serializedName: "properties.portalCertificateThumbprint", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AvailableProviderOperation" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + algorithm: { + serializedName: "properties.algorithm", type: { name: "String" } @@ -4037,451 +4143,39 @@ export const AvailableProviderOperationList: msRest.CompositeMapper = { } }; -export const ManagerList: msRest.CompositeMapper = { - serializedName: "ManagerList", +export const StorageAccountCredential: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagerList", + className: "StorageAccountCredential", modelProperties: { - value: { + ...BaseModel.type.modelProperties, + endPoint: { + serializedName: "properties.endPoint", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Manager" - } - } + name: "String" } - } - } - } -}; - -export const FeatureList: msRest.CompositeMapper = { - serializedName: "FeatureList", - type: { - name: "Composite", - className: "FeatureList", - modelProperties: { - value: { + }, + sslStatus: { + serializedName: "properties.sslStatus", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Feature" - } - } - } - } - } - } -}; - -export const MetricList: msRest.CompositeMapper = { - serializedName: "MetricList", - type: { - name: "Composite", - className: "MetricList", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Metrics" - } - } - } - } - } - } -}; - -export const MetricDefinitionList: msRest.CompositeMapper = { - serializedName: "MetricDefinitionList", - type: { - name: "Composite", - className: "MetricDefinitionList", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricDefinition" - } - } - } - } - } - } -}; - -export const AccessControlRecordList: msRest.CompositeMapper = { - serializedName: "AccessControlRecordList", - type: { - name: "Composite", - className: "AccessControlRecordList", - modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessControlRecord" - } - } - } - } - } - } -}; - -export const AlertList: msRest.CompositeMapper = { - serializedName: "AlertList", - type: { - name: "Composite", - className: "AlertList", - modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Alert" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const BandwidthSettingList: msRest.CompositeMapper = { - serializedName: "BandwidthSettingList", - type: { - name: "Composite", - className: "BandwidthSettingList", - modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BandwidthSetting" - } - } - } - } - } - } -}; - -export const CloudApplianceConfigurationList: msRest.CompositeMapper = { - serializedName: "CloudApplianceConfigurationList", - type: { - name: "Composite", - className: "CloudApplianceConfigurationList", - modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CloudApplianceConfiguration" - } - } - } - } - } - } -}; - -export const DeviceList: msRest.CompositeMapper = { - serializedName: "DeviceList", - type: { - name: "Composite", - className: "DeviceList", - modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Device" - } - } - } - } - } - } -}; - -export const FailoverSetsList: msRest.CompositeMapper = { - serializedName: "FailoverSetsList", - type: { - name: "Composite", - className: "FailoverSetsList", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FailoverSet" - } - } - } - } - } - } -}; - -export const FailoverTargetsList: msRest.CompositeMapper = { - serializedName: "FailoverTargetsList", - type: { - name: "Composite", - className: "FailoverTargetsList", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FailoverTarget" - } - } - } - } - } - } -}; - -export const BackupPolicyList: msRest.CompositeMapper = { - serializedName: "BackupPolicyList", - type: { - name: "Composite", - className: "BackupPolicyList", - modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BackupPolicy" - } - } - } - } - } - } -}; - -export const BackupScheduleList: msRest.CompositeMapper = { - serializedName: "BackupScheduleList", - type: { - name: "Composite", - className: "BackupScheduleList", - modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BackupSchedule" - } - } - } - } - } - } -}; - -export const BackupList: msRest.CompositeMapper = { - serializedName: "BackupList", - type: { - name: "Composite", - className: "BackupList", - modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Backup" - } - } + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const HardwareComponentGroupList: msRest.CompositeMapper = { - serializedName: "HardwareComponentGroupList", - type: { - name: "Composite", - className: "HardwareComponentGroupList", - modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "HardwareComponentGroup" - } - } - } - } - } - } -}; - -export const JobList: msRest.CompositeMapper = { - serializedName: "JobList", - type: { - name: "Composite", - className: "JobList", - modelProperties: { - value: { - required: true, - serializedName: "", + accessKey: { + serializedName: "properties.accessKey", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Job" - } - } + name: "Composite", + className: "AsymmetricEncryptedSecret" } }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const VolumeContainerList: msRest.CompositeMapper = { - serializedName: "VolumeContainerList", - type: { - name: "Composite", - className: "VolumeContainerList", - modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VolumeContainer" - } - } - } - } - } - } -}; - -export const VolumeList: msRest.CompositeMapper = { - serializedName: "VolumeList", - type: { - name: "Composite", - className: "VolumeList", - modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Volume" - } - } - } - } - } - } -}; - -export const StorageAccountCredentialList: msRest.CompositeMapper = { - serializedName: "StorageAccountCredentialList", - type: { - name: "Composite", - className: "StorageAccountCredentialList", - modelProperties: { - value: { - required: true, - serializedName: "", + volumesCount: { + serializedName: "properties.volumesCount", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "StorageAccountCredential" - } - } + name: "Number" } } } diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/operationsMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/operationsMappers.ts deleted file mode 100644 index 33d4e95f1a78..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/operationsMappers.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - AvailableProviderOperationList, - AvailableProviderOperation, - AvailableProviderOperationDisplay, - CloudError -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/parameters.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/parameters.ts index 7571898141ac..945719c82cfb 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/parameters.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/models/parameters.ts @@ -1,279 +1,463 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + Manager as ManagerMapper, + ManagerPatch as ManagerPatchMapper, + ManagerExtendedInfo as ManagerExtendedInfoMapper, + AccessControlRecord as AccessControlRecordMapper, + ClearAlertRequest as ClearAlertRequestMapper, + SendTestAlertEmailRequest as SendTestAlertEmailRequestMapper, + BandwidthSetting as BandwidthSettingMapper, + CloudAppliance as CloudApplianceMapper, + ConfigureDeviceRequest as ConfigureDeviceRequestMapper, + DevicePatch as DevicePatchMapper, + FailoverRequest as FailoverRequestMapper, + ListFailoverTargetsRequest as ListFailoverTargetsRequestMapper, + AlertSettings as AlertSettingsMapper, + NetworkSettingsPatch as NetworkSettingsPatchMapper, + SecuritySettingsPatch as SecuritySettingsPatchMapper, + TimeSettings as TimeSettingsMapper, + BackupPolicy as BackupPolicyMapper, + BackupSchedule as BackupScheduleMapper, + CloneRequest as CloneRequestMapper, + ControllerPowerStateChangeRequest as ControllerPowerStateChangeRequestMapper, + VolumeContainer as VolumeContainerMapper, + Volume as VolumeMapper, + StorageAccountCredential as StorageAccountCredentialMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const accessControlRecordName: msRest.OperationURLParameter = { - parameterPath: "accessControlRecordName", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "accessControlRecordName", type: { name: "String" } }, skipEncoding: true }; -export const apiVersion: msRest.OperationQueryParameter = { + +export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - required: true, + defaultValue: "2017-06-01", + isConstant: true, serializedName: "api-version", type: { name: "String" } - }, - skipEncoding: true + } }; -export const backupElementName: msRest.OperationURLParameter = { - parameterPath: "backupElementName", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - serializedName: "backupElementName", type: { name: "String" } }, skipEncoding: true }; -export const backupName: msRest.OperationURLParameter = { - parameterPath: "backupName", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "backupName", type: { name: "String" } }, skipEncoding: true }; -export const backupPolicyName: msRest.OperationURLParameter = { - parameterPath: "backupPolicyName", + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + serializedName: "resourceGroupName", required: true, - serializedName: "backupPolicyName", type: { name: "String" } }, skipEncoding: true }; -export const backupScheduleName: msRest.OperationURLParameter = { - parameterPath: "backupScheduleName", + +export const managerName: OperationURLParameter = { + parameterPath: "managerName", mapper: { + constraints: { + MaxLength: 50, + MinLength: 2 + }, + serializedName: "managerName", required: true, - serializedName: "backupScheduleName", type: { name: "String" } }, skipEncoding: true }; -export const backupType: msRest.OperationQueryParameter = { - parameterPath: "backupType", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "backupType", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } - }, - skipEncoding: true + } }; -export const bandwidthSettingName: msRest.OperationURLParameter = { - parameterPath: "bandwidthSettingName", + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: ManagerMapper +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: ManagerPatchMapper +}; + +export const deviceName: OperationURLParameter = { + parameterPath: "deviceName", mapper: { + serializedName: "deviceName", required: true, - serializedName: "bandwidthSettingName", type: { name: "String" } }, skipEncoding: true }; -export const deviceName: msRest.OperationURLParameter = { - parameterPath: "deviceName", + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: ManagerExtendedInfoMapper +}; + +export const ifMatch: OperationParameter = { + parameterPath: "ifMatch", mapper: { + serializedName: "If-Match", required: true, - serializedName: "deviceName", type: { name: "String" } - }, - skipEncoding: true + } }; -export const expand: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "expand" - ], + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], mapper: { - serializedName: "$expand", + serializedName: "$filter", type: { name: "String" } } }; -export const filter0: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "filter" - ], + +export const filter1: OperationQueryParameter = { + parameterPath: "filter", mapper: { serializedName: "$filter", + required: true, type: { name: "String" } } }; -export const filter1: msRest.OperationQueryParameter = { - parameterPath: "filter", + +export const accessControlRecordName: OperationURLParameter = { + parameterPath: "accessControlRecordName", mapper: { + serializedName: "accessControlRecordName", required: true, - serializedName: "$filter", type: { name: "String" } - } + }, + skipEncoding: true }; -export const hardwareComponentGroupName: msRest.OperationURLParameter = { - parameterPath: "hardwareComponentGroupName", + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: AccessControlRecordMapper +}; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: ClearAlertRequestMapper +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: SendTestAlertEmailRequestMapper +}; + +export const bandwidthSettingName: OperationURLParameter = { + parameterPath: "bandwidthSettingName", mapper: { + serializedName: "bandwidthSettingName", required: true, - serializedName: "hardwareComponentGroupName", type: { name: "String" } }, skipEncoding: true }; -export const ifMatch: msRest.OperationParameter = { - parameterPath: "ifMatch", + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: BandwidthSettingMapper +}; + +export const parameters7: OperationParameter = { + parameterPath: "parameters", + mapper: CloudApplianceMapper +}; + +export const parameters8: OperationParameter = { + parameterPath: "parameters", + mapper: ConfigureDeviceRequestMapper +}; + +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], mapper: { - required: true, - serializedName: "If-Match", + serializedName: "$expand", type: { name: "String" } } }; -export const jobName: msRest.OperationURLParameter = { - parameterPath: "jobName", + +export const parameters9: OperationParameter = { + parameterPath: "parameters", + mapper: DevicePatchMapper +}; + +export const parameters10: OperationParameter = { + parameterPath: "parameters", + mapper: FailoverRequestMapper +}; + +export const sourceDeviceName: OperationURLParameter = { + parameterPath: "sourceDeviceName", mapper: { + serializedName: "sourceDeviceName", required: true, - serializedName: "jobName", type: { name: "String" } }, skipEncoding: true }; -export const managerName: msRest.OperationURLParameter = { - parameterPath: "managerName", + +export const parameters11: OperationParameter = { + parameterPath: "parameters", + mapper: ListFailoverTargetsRequestMapper +}; + +export const parameters12: OperationParameter = { + parameterPath: "parameters", + mapper: AlertSettingsMapper +}; + +export const parameters13: OperationParameter = { + parameterPath: "parameters", + mapper: NetworkSettingsPatchMapper +}; + +export const parameters14: OperationParameter = { + parameterPath: "parameters", + mapper: SecuritySettingsPatchMapper +}; + +export const parameters15: OperationParameter = { + parameterPath: "parameters", + mapper: TimeSettingsMapper +}; + +export const backupPolicyName: OperationURLParameter = { + parameterPath: "backupPolicyName", mapper: { + serializedName: "backupPolicyName", required: true, - serializedName: "managerName", - constraints: { - MaxLength: 50, - MinLength: 2 - }, type: { name: "String" } }, skipEncoding: true }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const parameters16: OperationParameter = { + parameterPath: "parameters", + mapper: BackupPolicyMapper +}; + +export const backupType: OperationQueryParameter = { + parameterPath: "backupType", mapper: { + serializedName: "backupType", required: true, - serializedName: "nextLink", type: { name: "String" } }, skipEncoding: true }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const backupScheduleName: OperationURLParameter = { + parameterPath: "backupScheduleName", mapper: { + serializedName: "backupScheduleName", required: true, - serializedName: "resourceGroupName", type: { name: "String" } }, skipEncoding: true }; -export const sourceDeviceName: msRest.OperationURLParameter = { - parameterPath: "sourceDeviceName", + +export const parameters17: OperationParameter = { + parameterPath: "parameters", + mapper: BackupScheduleMapper +}; + +export const backupName: OperationURLParameter = { + parameterPath: "backupName", mapper: { + serializedName: "backupName", required: true, - serializedName: "sourceDeviceName", type: { name: "String" } }, skipEncoding: true }; -export const storageAccountCredentialName: msRest.OperationURLParameter = { - parameterPath: "storageAccountCredentialName", + +export const parameters18: OperationParameter = { + parameterPath: "parameters", + mapper: CloneRequestMapper +}; + +export const backupElementName: OperationURLParameter = { + parameterPath: "backupElementName", mapper: { + serializedName: "backupElementName", required: true, - serializedName: "storageAccountCredentialName", type: { name: "String" } }, skipEncoding: true }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const parameters19: OperationParameter = { + parameterPath: "parameters", + mapper: ControllerPowerStateChangeRequestMapper +}; + +export const hardwareComponentGroupName: OperationURLParameter = { + parameterPath: "hardwareComponentGroupName", mapper: { + serializedName: "hardwareComponentGroupName", required: true, - serializedName: "subscriptionId", type: { name: "String" } }, skipEncoding: true }; -export const volumeContainerName: msRest.OperationURLParameter = { - parameterPath: "volumeContainerName", + +export const jobName: OperationURLParameter = { + parameterPath: "jobName", mapper: { + serializedName: "jobName", required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const volumeContainerName: OperationURLParameter = { + parameterPath: "volumeContainerName", + mapper: { serializedName: "volumeContainerName", + required: true, type: { name: "String" } }, skipEncoding: true }; -export const volumeName: msRest.OperationURLParameter = { + +export const parameters20: OperationParameter = { + parameterPath: "parameters", + mapper: VolumeContainerMapper +}; + +export const volumeName: OperationURLParameter = { parameterPath: "volumeName", mapper: { - required: true, serializedName: "volumeName", + required: true, type: { name: "String" } }, skipEncoding: true }; + +export const parameters21: OperationParameter = { + parameterPath: "parameters", + mapper: VolumeMapper +}; + +export const storageAccountCredentialName: OperationURLParameter = { + parameterPath: "storageAccountCredentialName", + mapper: { + serializedName: "storageAccountCredentialName", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const parameters22: OperationParameter = { + parameterPath: "parameters", + mapper: StorageAccountCredentialMapper +}; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/storageAccountCredentialsMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/storageAccountCredentialsMappers.ts deleted file mode 100644 index eaafa681128e..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/storageAccountCredentialsMappers.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - StorageAccountCredentialList, - StorageAccountCredential, - BaseModel, - AsymmetricEncryptedSecret, - CloudError, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - TimeSettings, - Updates, - Volume, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/volumeContainersMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/volumeContainersMappers.ts deleted file mode 100644 index 7d381b5987f7..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/volumeContainersMappers.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - VolumeContainerList, - VolumeContainer, - BaseModel, - AsymmetricEncryptedSecret, - CloudError, - MetricList, - Metrics, - MetricName, - MetricDimension, - MetricData, - MetricDefinitionList, - MetricDefinition, - MetricAvailablity, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - StorageAccountCredential, - TimeSettings, - Updates, - Volume -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/models/volumesMappers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/models/volumesMappers.ts deleted file mode 100644 index 9831fdc0b6a0..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/models/volumesMappers.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - VolumeList, - Volume, - BaseModel, - CloudError, - MetricList, - Metrics, - MetricName, - MetricDimension, - MetricData, - MetricDefinitionList, - MetricDefinition, - MetricAvailablity, - AccessControlRecord, - Alert, - AlertSource, - AlertErrorDetails, - AlertSettings, - Backup, - BackupElement, - BackupPolicy, - BackupSchedule, - ScheduleRecurrence, - BandwidthSetting, - BandwidthSchedule, - Time, - CloudApplianceConfiguration, - AcsConfiguration, - VmImage, - ConfigureDeviceRequest, - SecondaryDNSSettings, - NetworkInterfaceData0Settings, - ControllerPowerStateChangeRequest, - Device, - DeviceDetails, - DeviceRolloverDetails, - EncryptionSettings, - HardwareComponentGroup, - HardwareComponent, - Job, - JobErrorDetails, - JobErrorItem, - DataStatistics, - JobStage, - ManagerExtendedInfo, - NetworkSettings, - DNSSettings, - NetworkAdapterList, - NetworkAdapters, - NicIPv4, - NicIPv6, - WebproxySettings, - SecuritySettings, - RemoteManagementSettings, - ChapSettings, - AsymmetricEncryptedSecret, - StorageAccountCredential, - TimeSettings, - Updates, - VolumeContainer -} from "../models/mappers"; - diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/accessControlRecords.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/accessControlRecords.ts index df7426c21ea4..8e602ffa2eb2 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/accessControlRecords.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/accessControlRecords.ts @@ -1,29 +1,40 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/accessControlRecordsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessControlRecords } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + AccessControlRecord, + AccessControlRecordsListByManagerOptionalParams, + AccessControlRecordsListByManagerResponse, + AccessControlRecordsGetOptionalParams, + AccessControlRecordsGetResponse, + AccessControlRecordsCreateOrUpdateOptionalParams, + AccessControlRecordsCreateOrUpdateResponse, + AccessControlRecordsDeleteOptionalParams +} from "../models"; -/** Class representing a AccessControlRecords. */ -export class AccessControlRecords { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing AccessControlRecords operations. */ +export class AccessControlRecordsImpl implements AccessControlRecords { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a AccessControlRecords. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class AccessControlRecords class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -31,32 +42,77 @@ export class AccessControlRecords { * Retrieves all the access control records in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listByManager( + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves all the access control records in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsListByManagerOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listByManagerOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); } /** @@ -64,49 +120,119 @@ export class AccessControlRecords { * @param accessControlRecordName Name of access control record to be fetched. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param accessControlRecordName Name of access control record to be fetched. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(accessControlRecordName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + get( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accessControlRecordName, resourceGroupName, managerName, options }, + getOperationSpec + ); + } + /** - * @param accessControlRecordName Name of access control record to be fetched. + * Creates or Updates an access control record. + * @param accessControlRecordName The name of the access control record. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param parameters The access control record to be added or updated. + * @param options The options parameters. */ - get(accessControlRecordName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + parameters: AccessControlRecord, + options?: AccessControlRecordsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccessControlRecordsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { accessControlRecordName, resourceGroupName, managerName, + parameters, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or Updates an access control record. * @param accessControlRecordName The name of the access control record. - * @param parameters The access control record to be added or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The access control record to be added or updated. + * @param options The options parameters. */ - createOrUpdate(accessControlRecordName: string, parameters: Models.AccessControlRecord, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(accessControlRecordName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + parameters: AccessControlRecord, + options?: AccessControlRecordsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + accessControlRecordName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } /** @@ -114,34 +240,62 @@ export class AccessControlRecords { * @param accessControlRecordName The name of the access control record to delete. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(accessControlRecordName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Creates or Updates an access control record. - * @param accessControlRecordName The name of the access control record. - * @param parameters The access control record to be added or updated. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(accessControlRecordName: string, parameters: Models.AccessControlRecord, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - accessControlRecordName, - parameters, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + const lro = new LroImpl( + sendOperation, + { accessControlRecordName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -149,130 +303,108 @@ export class AccessControlRecords { * @param accessControlRecordName The name of the access control record to delete. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - accessControlRecordName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + accessControlRecordName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByManagerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AccessControlRecordList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.accessControlRecordName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AccessControlRecord - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.accessControlRecordName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.accessControlRecordName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AccessControlRecord, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.AccessControlRecord }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError + 201: { + bodyMapper: Mappers.AccessControlRecord + }, + 202: { + bodyMapper: Mappers.AccessControlRecord + }, + 204: { + bodyMapper: Mappers.AccessControlRecord } }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.accessControlRecordName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.accessControlRecordName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.accessControlRecordName ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/alerts.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/alerts.ts index 6fb447d652b2..25d1f908235d 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/alerts.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/alerts.ts @@ -1,28 +1,39 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/alertsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Alerts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { + Alert, + AlertsListByManagerNextOptionalParams, + AlertsListByManagerOptionalParams, + AlertsListByManagerResponse, + ClearAlertRequest, + AlertsClearOptionalParams, + SendTestAlertEmailRequest, + AlertsSendTestEmailOptionalParams, + AlertsListByManagerNextResponse +} from "../models"; -/** Class representing a Alerts. */ -export class Alerts { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing Alerts operations. */ +export class AlertsImpl implements Alerts { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a Alerts. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Alerts class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -30,245 +41,222 @@ export class Alerts { * Retrieves all the alerts in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: Models.AlertsListByManagerOptionalParams): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, options: Models.AlertsListByManagerOptionalParams, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: Models.AlertsListByManagerOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByManager( + resourceGroupName: string, + managerName: string, + options?: AlertsListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: AlertsListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByManagerNext( resourceGroupName, managerName, + continuationToken, options - }, - listByManagerOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: AlertsListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Clear the alerts. - * @param parameters The clear alert request. + * Retrieves all the alerts in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - clear(parameters: Models.ClearAlertRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: AlertsListByManagerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); + } + /** - * @param parameters The clear alert request. + * Clear the alerts. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback - */ - clear(parameters: Models.ClearAlertRequest, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** * @param parameters The clear alert request. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - clear(parameters: Models.ClearAlertRequest, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - clear(parameters: Models.ClearAlertRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + clear( + resourceGroupName: string, + managerName: string, + parameters: ClearAlertRequest, + options?: AlertsClearOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - parameters, - resourceGroupName, - managerName, - options - }, - clearOperationSpec, - callback); + { resourceGroupName, managerName, parameters, options }, + clearOperationSpec + ); } /** * Sends a test alert email. * @param deviceName The device name - * @param parameters The send test alert email request. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - sendTestEmail(deviceName: string, parameters: Models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name * @param parameters The send test alert email request. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - sendTestEmail(deviceName: string, parameters: Models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name - * @param parameters The send test alert email request. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - sendTestEmail(deviceName: string, parameters: Models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - sendTestEmail(deviceName: string, parameters: Models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + sendTestEmail( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: SendTestAlertEmailRequest, + options?: AlertsSendTestEmailOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - parameters, - resourceGroupName, - managerName, - options - }, - sendTestEmailOperationSpec, - callback); + { deviceName, resourceGroupName, managerName, parameters, options }, + sendTestEmailOperationSpec + ); } /** - * Retrieves all the alerts in a manager. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagerNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByManagerNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByManagerNext + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param nextLink The nextLink from the previous successful call to the ListByManager method. + * @param options The options parameters. */ - listByManagerNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManagerNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManagerNext( + resourceGroupName: string, + managerName: string, + nextLink: string, + options?: AlertsListByManagerNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByManagerNextOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, nextLink, options }, + listByManagerNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByManagerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/alerts", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/alerts", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AlertList - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName + ], + headerParameters: [Parameters.accept], serializer }; - -const clearOperationSpec: msRest.OperationSpec = { +const clearOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/clearAlerts", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/clearAlerts", + responses: { 204: {} }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ClearAlertRequest, - required: true - } - }, - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - -const sendTestEmailOperationSpec: msRest.OperationSpec = { +const sendTestEmailOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/sendTestAlertEmail", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/sendTestAlertEmail", + responses: { 204: {} }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName + Parameters.managerName, + Parameters.deviceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.SendTestAlertEmailRequest, - required: true - } - }, - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - -const listByManagerNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByManagerNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AlertList - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backupPolicies.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backupPolicies.ts index 01367182a8fd..88a17e13cba6 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backupPolicies.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backupPolicies.ts @@ -1,29 +1,41 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/backupPoliciesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { BackupPolicies } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + BackupPolicy, + BackupPoliciesListByDeviceOptionalParams, + BackupPoliciesListByDeviceResponse, + BackupPoliciesGetOptionalParams, + BackupPoliciesGetResponse, + BackupPoliciesCreateOrUpdateOptionalParams, + BackupPoliciesCreateOrUpdateResponse, + BackupPoliciesDeleteOptionalParams, + BackupPoliciesBackupNowOptionalParams +} from "../models"; -/** Class representing a BackupPolicies. */ -export class BackupPolicies { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing BackupPolicies operations. */ +export class BackupPoliciesImpl implements BackupPolicies { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a BackupPolicies. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class BackupPolicies class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -32,35 +44,86 @@ export class BackupPolicies { * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Gets all the backup policies in a device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesListByDeviceOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - listByDeviceOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); } /** @@ -69,53 +132,126 @@ export class BackupPolicies { * @param backupPolicyName The name of backup policy to be fetched. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param backupPolicyName The name of backup policy to be fetched. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + get( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, backupPolicyName, resourceGroupName, managerName, options }, + getOperationSpec + ); + } + /** + * Creates or updates the backup policy. * @param deviceName The device name - * @param backupPolicyName The name of backup policy to be fetched. + * @param backupPolicyName The name of the backup policy to be created/updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param parameters The backup policy. + * @param options The options parameters. */ - get(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + parameters: BackupPolicy, + options?: BackupPoliciesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + BackupPoliciesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, backupPolicyName, resourceGroupName, managerName, + parameters, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or updates the backup policy. * @param deviceName The device name * @param backupPolicyName The name of the backup policy to be created/updated. - * @param parameters The backup policy. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The backup policy. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, backupPolicyName: string, parameters: Models.BackupPolicy, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,backupPolicyName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + parameters: BackupPolicy, + options?: BackupPoliciesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + backupPolicyName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } /** @@ -124,73 +260,162 @@ export class BackupPolicies { * @param backupPolicyName The name of the backup policy. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,backupPolicyName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Backup the backup policy now. - * @param deviceName The device name - * @param backupPolicyName The backup policy name. - * @param backupType The backup Type. This can be cloudSnapshot or localSnapshot. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - backupNow(deviceName: string, backupPolicyName: string, backupType: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginBackupNow(deviceName,backupPolicyName,backupType,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + const lro = new LroImpl( + sendOperation, + { deviceName, backupPolicyName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Creates or updates the backup policy. + * Deletes the backup policy. * @param deviceName The device name - * @param backupPolicyName The name of the backup policy to be created/updated. - * @param parameters The backup policy. + * @param backupPolicyName The name of the backup policy. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, backupPolicyName: string, parameters: Models.BackupPolicy, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - backupPolicyName, - parameters, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + backupPolicyName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Deletes the backup policy. + * Backup the backup policy now. * @param deviceName The device name - * @param backupPolicyName The name of the backup policy. + * @param backupPolicyName The backup policy name. + * @param backupType The backup Type. This can be cloudSnapshot or localSnapshot. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginBackupNow( + deviceName: string, + backupPolicyName: string, + backupType: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesBackupNowOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, backupPolicyName, + backupType, resourceGroupName, managerName, options }, - beginDeleteMethodOperationSpec, - options); + backupNowOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -200,163 +425,132 @@ export class BackupPolicies { * @param backupType The backup Type. This can be cloudSnapshot or localSnapshot. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginBackupNow(deviceName: string, backupPolicyName: string, backupType: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - backupPolicyName, - backupType, - resourceGroupName, - managerName, - options - }, - beginBackupNowOperationSpec, - options); + async beginBackupNowAndWait( + deviceName: string, + backupPolicyName: string, + backupType: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesBackupNowOptionalParams + ): Promise { + const poller = await this.beginBackupNow( + deviceName, + backupPolicyName, + backupType, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.BackupPolicyList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.backupPolicyName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BackupPolicy - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.backupPolicyName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.backupPolicyName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.BackupPolicy, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.BackupPolicy }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError + 201: { + bodyMapper: Mappers.BackupPolicy + }, + 202: { + bodyMapper: Mappers.BackupPolicy + }, + 204: { + bodyMapper: Mappers.BackupPolicy } }, + requestBody: Parameters.parameters16, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName, + Parameters.backupPolicyName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.backupPolicyName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.backupPolicyName ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; - -const beginBackupNowOperationSpec: msRest.OperationSpec = { +const backupNowOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}/backup", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}/backup", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion, Parameters.backupType], urlParameters: [ - Parameters.deviceName, - Parameters.backupPolicyName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.backupType, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.backupPolicyName ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backupSchedules.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backupSchedules.ts index 8012162c6f09..a31497c29b81 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backupSchedules.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backupSchedules.ts @@ -1,29 +1,40 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/backupSchedulesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { BackupSchedules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + BackupSchedule, + BackupSchedulesListByBackupPolicyOptionalParams, + BackupSchedulesListByBackupPolicyResponse, + BackupSchedulesGetOptionalParams, + BackupSchedulesGetResponse, + BackupSchedulesCreateOrUpdateOptionalParams, + BackupSchedulesCreateOrUpdateResponse, + BackupSchedulesDeleteOptionalParams +} from "../models"; -/** Class representing a BackupSchedules. */ -export class BackupSchedules { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing BackupSchedules operations. */ +export class BackupSchedulesImpl implements BackupSchedules { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a BackupSchedules. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class BackupSchedules class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -33,82 +44,207 @@ export class BackupSchedules { * @param backupPolicyName The backup policy name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByBackupPolicy(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + public listByBackupPolicy( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + options?: BackupSchedulesListByBackupPolicyOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByBackupPolicyPagingAll( + deviceName, + backupPolicyName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByBackupPolicyPagingPage( + deviceName, + backupPolicyName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByBackupPolicyPagingPage( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + options?: BackupSchedulesListByBackupPolicyOptionalParams + ): AsyncIterableIterator { + let result = await this._listByBackupPolicy( + deviceName, + backupPolicyName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByBackupPolicyPagingAll( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + options?: BackupSchedulesListByBackupPolicyOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByBackupPolicyPagingPage( + deviceName, + backupPolicyName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Gets all the backup schedules in a backup policy. * @param deviceName The device name * @param backupPolicyName The backup policy name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByBackupPolicy(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _listByBackupPolicy( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + options?: BackupSchedulesListByBackupPolicyOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, backupPolicyName, resourceGroupName, managerName, options }, + listByBackupPolicyOperationSpec + ); + } + /** + * Gets the properties of the specified backup schedule name. * @param deviceName The device name * @param backupPolicyName The backup policy name. + * @param backupScheduleName The name of the backup schedule to be fetched * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByBackupPolicy(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByBackupPolicy(deviceName: string, backupPolicyName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + backupPolicyName: string, + backupScheduleName: string, + resourceGroupName: string, + managerName: string, + options?: BackupSchedulesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { deviceName, backupPolicyName, + backupScheduleName, resourceGroupName, managerName, options }, - listByBackupPolicyOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** - * Gets the properties of the specified backup schedule name. - * @param deviceName The device name - * @param backupPolicyName The backup policy name. - * @param backupScheduleName The name of the backup schedule to be fetched - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, backupPolicyName: string, backupScheduleName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param backupPolicyName The backup policy name. - * @param backupScheduleName The name of the backup schedule to be fetched - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(deviceName: string, backupPolicyName: string, backupScheduleName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** + * Creates or updates the backup schedule. * @param deviceName The device name * @param backupPolicyName The backup policy name. - * @param backupScheduleName The name of the backup schedule to be fetched + * @param backupScheduleName The backup schedule name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param parameters The backup schedule. + * @param options The options parameters. */ - get(deviceName: string, backupPolicyName: string, backupScheduleName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, backupPolicyName: string, backupScheduleName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + deviceName: string, + backupPolicyName: string, + backupScheduleName: string, + resourceGroupName: string, + managerName: string, + parameters: BackupSchedule, + options?: BackupSchedulesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + BackupSchedulesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, backupPolicyName, backupScheduleName, resourceGroupName, managerName, + parameters, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -116,15 +252,30 @@ export class BackupSchedules { * @param deviceName The device name * @param backupPolicyName The backup policy name. * @param backupScheduleName The backup schedule name. - * @param parameters The backup schedule. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The backup schedule. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, backupPolicyName: string, backupScheduleName: string, parameters: Models.BackupSchedule, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,backupPolicyName,backupScheduleName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + deviceName: string, + backupPolicyName: string, + backupScheduleName: string, + resourceGroupName: string, + managerName: string, + parameters: BackupSchedule, + options?: BackupSchedulesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + backupPolicyName, + backupScheduleName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } /** @@ -134,38 +285,71 @@ export class BackupSchedules { * @param backupScheduleName The name the backup schedule. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(deviceName: string, backupPolicyName: string, backupScheduleName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,backupPolicyName,backupScheduleName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + deviceName: string, + backupPolicyName: string, + backupScheduleName: string, + resourceGroupName: string, + managerName: string, + options?: BackupSchedulesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Creates or updates the backup schedule. - * @param deviceName The device name - * @param backupPolicyName The backup policy name. - * @param backupScheduleName The backup schedule name. - * @param parameters The backup schedule. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(deviceName: string, backupPolicyName: string, backupScheduleName: string, parameters: Models.BackupSchedule, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + const lro = new LroImpl( + sendOperation, { deviceName, backupPolicyName, backupScheduleName, - parameters, resourceGroupName, managerName, options }, - beginCreateOrUpdateOperationSpec, - options); + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -175,140 +359,120 @@ export class BackupSchedules { * @param backupScheduleName The name the backup schedule. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, backupPolicyName: string, backupScheduleName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - backupPolicyName, - backupScheduleName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + backupPolicyName: string, + backupScheduleName: string, + resourceGroupName: string, + managerName: string, + options?: BackupSchedulesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + backupPolicyName, + backupScheduleName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByBackupPolicyOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByBackupPolicyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}/schedules", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}/schedules", - urlParameters: [ - Parameters.deviceName, - Parameters.backupPolicyName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.BackupScheduleList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}/schedules/{backupScheduleName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.backupPolicyName, - Parameters.backupScheduleName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.backupPolicyName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}/schedules/{backupScheduleName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BackupSchedule - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}/schedules/{backupScheduleName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.backupPolicyName, - Parameters.backupScheduleName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.backupPolicyName, + Parameters.backupScheduleName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.BackupSchedule, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}/schedules/{backupScheduleName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.BackupSchedule }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError + 201: { + bodyMapper: Mappers.BackupSchedule + }, + 202: { + bodyMapper: Mappers.BackupSchedule + }, + 204: { + bodyMapper: Mappers.BackupSchedule } }, + requestBody: Parameters.parameters17, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName, + Parameters.backupPolicyName, + Parameters.backupScheduleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}/schedules/{backupScheduleName}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupPolicies/{backupPolicyName}/schedules/{backupScheduleName}", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.backupPolicyName, - Parameters.backupScheduleName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.backupPolicyName, + Parameters.backupScheduleName ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backups.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backups.ts index 60cf331ab4f8..4b6cc01506c6 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backups.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/backups.ts @@ -1,29 +1,41 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/backupsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Backups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Backup, + BackupsListByDeviceNextOptionalParams, + BackupsListByDeviceOptionalParams, + BackupsListByDeviceResponse, + BackupsDeleteOptionalParams, + CloneRequest, + BackupsCloneOptionalParams, + BackupsRestoreOptionalParams, + BackupsListByDeviceNextResponse +} from "../models"; -/** Class representing a Backups. */ -export class Backups { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing Backups operations. */ +export class BackupsImpl implements Backups { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a Backups. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Backups class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -32,101 +44,265 @@ export class Backups { * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.BackupsListByDeviceOptionalParams): Promise; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: Models.BackupsListByDeviceOptionalParams, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.BackupsListByDeviceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDeviceNext( deviceName, resourceGroupName, managerName, + continuationToken, options - }, - listByDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Deletes the backup. + * Retrieves all the backups in a device. * @param deviceName The device name - * @param backupName The backup name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,backupName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsListByDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); } /** - * Clones the backup element as a new volume. + * Deletes the backup. * @param deviceName The device name * @param backupName The backup name. - * @param backupElementName The backup element name. - * @param parameters The clone request object. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - clone(deviceName: string, backupName: string, backupElementName: string, parameters: Models.CloneRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginClone(deviceName,backupName,backupElementName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDelete( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, backupName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Restores the backup on the device. + * Deletes the backup. * @param deviceName The device name - * @param backupName The backupSet name + * @param backupName The backup name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - restore(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginRestore(deviceName,backupName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDeleteAndWait( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + backupName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Deletes the backup. + * Clones the backup element as a new volume. * @param deviceName The device name * @param backupName The backup name. + * @param backupElementName The backup element name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The clone request object. + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginClone( + deviceName: string, + backupName: string, + backupElementName: string, + resourceGroupName: string, + managerName: string, + parameters: CloneRequest, + options?: BackupsCloneOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, backupName, + backupElementName, resourceGroupName, managerName, + parameters, options }, - beginDeleteMethodOperationSpec, - options); + cloneOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -134,25 +310,30 @@ export class Backups { * @param deviceName The device name * @param backupName The backup name. * @param backupElementName The backup element name. - * @param parameters The clone request object. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The clone request object. + * @param options The options parameters. */ - beginClone(deviceName: string, backupName: string, backupElementName: string, parameters: Models.CloneRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - backupName, - backupElementName, - parameters, - resourceGroupName, - managerName, - options - }, - beginCloneOperationSpec, - options); + async beginCloneAndWait( + deviceName: string, + backupName: string, + backupElementName: string, + resourceGroupName: string, + managerName: string, + parameters: CloneRequest, + options?: BackupsCloneOptionalParams + ): Promise { + const poller = await this.beginClone( + deviceName, + backupName, + backupElementName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } /** @@ -161,183 +342,203 @@ export class Backups { * @param backupName The backupSet name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginRestore(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - backupName, - resourceGroupName, - managerName, - options - }, - beginRestoreOperationSpec, - options); + async beginRestore( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsRestoreOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, backupName, resourceGroupName, managerName, options }, + restoreOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Retrieves all the backups in a device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * Restores the backup on the device. + * @param deviceName The device name + * @param backupName The backupSet name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. */ - listByDeviceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + async beginRestoreAndWait( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsRestoreOptionalParams + ): Promise { + const poller = await this.beginRestore( + deviceName, + backupName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByDeviceNext + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param nextLink The nextLink from the previous successful call to the ListByDevice method. + * @param options The options parameters. */ - listByDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDeviceNext( + deviceName: string, + resourceGroupName: string, + managerName: string, + nextLink: string, + options?: BackupsListByDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, nextLink, options }, + listByDeviceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.BackupList - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.backupName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.backupName ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; - -const beginCloneOperationSpec: msRest.OperationSpec = { +const cloneOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/elements/{backupElementName}/clone", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/elements/{backupElementName}/clone", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + requestBody: Parameters.parameters18, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.backupName, - Parameters.backupElementName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.backupName, + Parameters.backupElementName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.CloneRequest, - required: true - } - }, - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - -const beginRestoreOperationSpec: msRest.OperationSpec = { +const restoreOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/restore", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/restore", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.backupName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.backupName ], - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; - -const listByDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BackupList - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/bandwidthSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/bandwidthSettings.ts index d7226e18c2c0..110b5123bd9c 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/bandwidthSettings.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/bandwidthSettings.ts @@ -1,29 +1,40 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/bandwidthSettingsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { BandwidthSettings } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + BandwidthSetting, + BandwidthSettingsListByManagerOptionalParams, + BandwidthSettingsListByManagerResponse, + BandwidthSettingsGetOptionalParams, + BandwidthSettingsGetResponse, + BandwidthSettingsCreateOrUpdateOptionalParams, + BandwidthSettingsCreateOrUpdateResponse, + BandwidthSettingsDeleteOptionalParams +} from "../models"; -/** Class representing a BandwidthSettings. */ -export class BandwidthSettings { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing BandwidthSettings operations. */ +export class BandwidthSettingsImpl implements BandwidthSettings { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a BandwidthSettings. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class BandwidthSettings class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -31,32 +42,77 @@ export class BandwidthSettings { * Retrieves all the bandwidth setting in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listByManager( + resourceGroupName: string, + managerName: string, + options?: BandwidthSettingsListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: BandwidthSettingsListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: BandwidthSettingsListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves all the bandwidth setting in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: BandwidthSettingsListByManagerOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listByManagerOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); } /** @@ -64,49 +120,119 @@ export class BandwidthSettings { * @param bandwidthSettingName The name of bandwidth setting to be fetched. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(bandwidthSettingName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param bandwidthSettingName The name of bandwidth setting to be fetched. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(bandwidthSettingName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + get( + bandwidthSettingName: string, + resourceGroupName: string, + managerName: string, + options?: BandwidthSettingsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { bandwidthSettingName, resourceGroupName, managerName, options }, + getOperationSpec + ); + } + /** - * @param bandwidthSettingName The name of bandwidth setting to be fetched. + * Creates or updates the bandwidth setting + * @param bandwidthSettingName The bandwidth setting name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param parameters The bandwidth setting to be added or updated. + * @param options The options parameters. */ - get(bandwidthSettingName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(bandwidthSettingName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + bandwidthSettingName: string, + resourceGroupName: string, + managerName: string, + parameters: BandwidthSetting, + options?: BandwidthSettingsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + BandwidthSettingsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { bandwidthSettingName, resourceGroupName, managerName, + parameters, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or updates the bandwidth setting * @param bandwidthSettingName The bandwidth setting name. - * @param parameters The bandwidth setting to be added or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The bandwidth setting to be added or updated. + * @param options The options parameters. */ - createOrUpdate(bandwidthSettingName: string, parameters: Models.BandwidthSetting, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(bandwidthSettingName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + bandwidthSettingName: string, + resourceGroupName: string, + managerName: string, + parameters: BandwidthSetting, + options?: BandwidthSettingsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + bandwidthSettingName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } /** @@ -114,34 +240,62 @@ export class BandwidthSettings { * @param bandwidthSettingName The name of the bandwidth setting. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(bandwidthSettingName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(bandwidthSettingName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + bandwidthSettingName: string, + resourceGroupName: string, + managerName: string, + options?: BandwidthSettingsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Creates or updates the bandwidth setting - * @param bandwidthSettingName The bandwidth setting name. - * @param parameters The bandwidth setting to be added or updated. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(bandwidthSettingName: string, parameters: Models.BandwidthSetting, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - bandwidthSettingName, - parameters, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + const lro = new LroImpl( + sendOperation, + { bandwidthSettingName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -149,130 +303,108 @@ export class BandwidthSettings { * @param bandwidthSettingName The name of the bandwidth setting. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(bandwidthSettingName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - bandwidthSettingName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + bandwidthSettingName: string, + resourceGroupName: string, + managerName: string, + options?: BandwidthSettingsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + bandwidthSettingName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByManagerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/bandwidthSettings", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/bandwidthSettings", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.BandwidthSettingList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/bandwidthSettings/{bandwidthSettingName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.bandwidthSettingName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/bandwidthSettings/{bandwidthSettingName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BandwidthSetting - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/bandwidthSettings/{bandwidthSettingName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.bandwidthSettingName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.bandwidthSettingName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.BandwidthSetting, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/bandwidthSettings/{bandwidthSettingName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.BandwidthSetting }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError + 201: { + bodyMapper: Mappers.BandwidthSetting + }, + 202: { + bodyMapper: Mappers.BandwidthSetting + }, + 204: { + bodyMapper: Mappers.BandwidthSetting } }, + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.bandwidthSettingName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/bandwidthSettings/{bandwidthSettingName}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/bandwidthSettings/{bandwidthSettingName}", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.bandwidthSettingName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.bandwidthSettingName ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/cloudAppliances.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/cloudAppliances.ts index fce5b54cd390..b058402d28b0 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/cloudAppliances.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/cloudAppliances.ts @@ -1,29 +1,37 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/cloudAppliancesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { CloudAppliances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + CloudApplianceConfiguration, + CloudAppliancesListSupportedConfigurationsOptionalParams, + CloudAppliancesListSupportedConfigurationsResponse, + CloudAppliance, + CloudAppliancesProvisionOptionalParams +} from "../models"; -/** Class representing a CloudAppliances. */ -export class CloudAppliances { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing CloudAppliances operations. */ +export class CloudAppliancesImpl implements CloudAppliances { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a CloudAppliances. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class CloudAppliances class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -31,122 +39,200 @@ export class CloudAppliances { * Lists supported cloud appliance models and supported configurations. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listSupportedConfigurations(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listSupportedConfigurations(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listSupportedConfigurations( + resourceGroupName: string, + managerName: string, + options?: CloudAppliancesListSupportedConfigurationsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listSupportedConfigurationsPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listSupportedConfigurationsPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listSupportedConfigurationsPagingPage( + resourceGroupName: string, + managerName: string, + options?: CloudAppliancesListSupportedConfigurationsOptionalParams + ): AsyncIterableIterator { + let result = await this._listSupportedConfigurations( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listSupportedConfigurationsPagingAll( + resourceGroupName: string, + managerName: string, + options?: CloudAppliancesListSupportedConfigurationsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listSupportedConfigurationsPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Lists supported cloud appliance models and supported configurations. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listSupportedConfigurations(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listSupportedConfigurations(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listSupportedConfigurations( + resourceGroupName: string, + managerName: string, + options?: CloudAppliancesListSupportedConfigurationsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listSupportedConfigurationsOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listSupportedConfigurationsOperationSpec + ); } /** * Provisions cloud appliance. - * @param parameters The cloud appliance * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The cloud appliance + * @param options The options parameters. */ - provision(parameters: Models.CloudAppliance, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginProvision(parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginProvision( + resourceGroupName: string, + managerName: string, + parameters: CloudAppliance, + options?: CloudAppliancesProvisionOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, managerName, parameters, options }, + provisionOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Provisions cloud appliance. - * @param parameters The cloud appliance * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The cloud appliance + * @param options The options parameters. */ - beginProvision(parameters: Models.CloudAppliance, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - parameters, - resourceGroupName, - managerName, - options - }, - beginProvisionOperationSpec, - options); + async beginProvisionAndWait( + resourceGroupName: string, + managerName: string, + parameters: CloudAppliance, + options?: CloudAppliancesProvisionOptionalParams + ): Promise { + const poller = await this.beginProvision( + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listSupportedConfigurationsOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listSupportedConfigurationsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/cloudApplianceConfigurations", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/cloudApplianceConfigurations", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.CloudApplianceConfigurationList - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginProvisionOperationSpec: msRest.OperationSpec = { +const provisionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/provisionCloudAppliance", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/provisionCloudAppliance", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + requestBody: Parameters.parameters7, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.CloudAppliance, - required: true - } - }, - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/deviceSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/deviceSettings.ts index 2e537937b1a7..c38aa5aaa5e6 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/deviceSettings.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/deviceSettings.ts @@ -1,29 +1,51 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/deviceSettingsMappers"; +import { DeviceSettings } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DeviceSettingsGetAlertSettingsOptionalParams, + DeviceSettingsGetAlertSettingsResponse, + AlertSettings, + DeviceSettingsCreateOrUpdateAlertSettingsOptionalParams, + DeviceSettingsCreateOrUpdateAlertSettingsResponse, + DeviceSettingsGetNetworkSettingsOptionalParams, + DeviceSettingsGetNetworkSettingsResponse, + NetworkSettingsPatch, + DeviceSettingsUpdateNetworkSettingsOptionalParams, + DeviceSettingsUpdateNetworkSettingsResponse, + DeviceSettingsGetSecuritySettingsOptionalParams, + DeviceSettingsGetSecuritySettingsResponse, + SecuritySettingsPatch, + DeviceSettingsUpdateSecuritySettingsOptionalParams, + DeviceSettingsUpdateSecuritySettingsResponse, + DeviceSettingsSyncRemotemanagementCertificateOptionalParams, + DeviceSettingsGetTimeSettingsOptionalParams, + DeviceSettingsGetTimeSettingsResponse, + TimeSettings, + DeviceSettingsCreateOrUpdateTimeSettingsOptionalParams, + DeviceSettingsCreateOrUpdateTimeSettingsResponse +} from "../models"; -/** Class representing a DeviceSettings. */ -export class DeviceSettings { - private readonly client: StorSimple8000SeriesManagementClientContext; +/** Class containing DeviceSettings operations. */ +export class DeviceSettingsImpl implements DeviceSettings { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a DeviceSettings. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class DeviceSettings class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -32,586 +54,761 @@ export class DeviceSettings { * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getAlertSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsGetAlertSettingsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - getAlertSettingsOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + getAlertSettingsOperationSpec + ); } /** * Creates or updates the alert settings of the specified device. * @param deviceName The device name - * @param parameters The alert settings to be added or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The alert settings to be added or updated. + * @param options The options parameters. */ - createOrUpdateAlertSettings(deviceName: string, parameters: Models.AlertSettings, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdateAlertSettings(deviceName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAlertSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: AlertSettings, + options?: DeviceSettingsCreateOrUpdateAlertSettingsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeviceSettingsCreateOrUpdateAlertSettingsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, parameters, options }, + createOrUpdateAlertSettingsOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Gets the network settings of the specified device. - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Creates or updates the alert settings of the specified device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param parameters The alert settings to be added or updated. + * @param options The options parameters. */ - getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginCreateOrUpdateAlertSettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: AlertSettings, + options?: DeviceSettingsCreateOrUpdateAlertSettingsOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdateAlertSettings( + deviceName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets the network settings of the specified device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getNetworkSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsGetNetworkSettingsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - getNetworkSettingsOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + getNetworkSettingsOperationSpec + ); } /** * Updates the network settings on the specified device. * @param deviceName The device name - * @param parameters The network settings to be updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The network settings to be updated. + * @param options The options parameters. */ - updateNetworkSettings(deviceName: string, parameters: Models.NetworkSettingsPatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdateNetworkSettings(deviceName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginUpdateNetworkSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: NetworkSettingsPatch, + options?: DeviceSettingsUpdateNetworkSettingsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeviceSettingsUpdateNetworkSettingsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, parameters, options }, + updateNetworkSettingsOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Returns the Security properties of the specified device name. - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - getSecuritySettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Updates the network settings on the specified device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param parameters The network settings to be updated. + * @param options The options parameters. */ - getSecuritySettings(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginUpdateNetworkSettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: NetworkSettingsPatch, + options?: DeviceSettingsUpdateNetworkSettingsOptionalParams + ): Promise { + const poller = await this.beginUpdateNetworkSettings( + deviceName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** + * Returns the Security properties of the specified device name. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getSecuritySettings(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getSecuritySettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getSecuritySettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsGetSecuritySettingsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - getSecuritySettingsOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + getSecuritySettingsOperationSpec + ); } /** * Patch Security properties of the specified device name. * @param deviceName The device name - * @param parameters The security settings properties to be patched. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The security settings properties to be patched. + * @param options The options parameters. */ - updateSecuritySettings(deviceName: string, parameters: Models.SecuritySettingsPatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdateSecuritySettings(deviceName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } + async beginUpdateSecuritySettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: SecuritySettingsPatch, + options?: DeviceSettingsUpdateSecuritySettingsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeviceSettingsUpdateSecuritySettingsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * sync Remote management Certificate between appliance and Service - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - syncRemotemanagementCertificate(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginSyncRemotemanagementCertificate(deviceName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, parameters, options }, + updateSecuritySettingsOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Gets the time settings of the specified device. - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** + * Patch Security properties of the specified device name. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param parameters The security settings properties to be patched. + * @param options The options parameters. */ - getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - getTimeSettingsOperationSpec, - callback) as Promise; + async beginUpdateSecuritySettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: SecuritySettingsPatch, + options?: DeviceSettingsUpdateSecuritySettingsOptionalParams + ): Promise { + const poller = await this.beginUpdateSecuritySettings( + deviceName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Creates or updates the time settings of the specified device. + * sync Remote management Certificate between appliance and Service * @param deviceName The device name - * @param parameters The time settings to be added or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdateTimeSettings(deviceName: string, parameters: Models.TimeSettings, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdateTimeSettings(deviceName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } + async beginSyncRemotemanagementCertificate( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsSyncRemotemanagementCertificateOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Creates or updates the alert settings of the specified device. - * @param deviceName The device name - * @param parameters The alert settings to be added or updated. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdateAlertSettings(deviceName: string, parameters: Models.AlertSettings, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - parameters, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateAlertSettingsOperationSpec, - options); + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, options }, + syncRemotemanagementCertificateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Updates the network settings on the specified device. + * sync Remote management Certificate between appliance and Service * @param deviceName The device name - * @param parameters The network settings to be updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginUpdateNetworkSettings(deviceName: string, parameters: Models.NetworkSettingsPatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - parameters, - resourceGroupName, - managerName, - options - }, - beginUpdateNetworkSettingsOperationSpec, - options); + async beginSyncRemotemanagementCertificateAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsSyncRemotemanagementCertificateOptionalParams + ): Promise { + const poller = await this.beginSyncRemotemanagementCertificate( + deviceName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Patch Security properties of the specified device name. + * Gets the time settings of the specified device. * @param deviceName The device name - * @param parameters The security settings properties to be patched. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginUpdateSecuritySettings(deviceName: string, parameters: Models.SecuritySettingsPatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - parameters, - resourceGroupName, - managerName, - options - }, - beginUpdateSecuritySettingsOperationSpec, - options); + getTimeSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsGetTimeSettingsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + getTimeSettingsOperationSpec + ); } /** - * sync Remote management Certificate between appliance and Service + * Creates or updates the time settings of the specified device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The time settings to be added or updated. + * @param options The options parameters. */ - beginSyncRemotemanagementCertificate(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - beginSyncRemotemanagementCertificateOperationSpec, - options); + async beginCreateOrUpdateTimeSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: TimeSettings, + options?: DeviceSettingsCreateOrUpdateTimeSettingsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeviceSettingsCreateOrUpdateTimeSettingsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, parameters, options }, + createOrUpdateTimeSettingsOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or updates the time settings of the specified device. * @param deviceName The device name - * @param parameters The time settings to be added or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The time settings to be added or updated. + * @param options The options parameters. */ - beginCreateOrUpdateTimeSettings(deviceName: string, parameters: Models.TimeSettings, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - parameters, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateTimeSettingsOperationSpec, - options); + async beginCreateOrUpdateTimeSettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: TimeSettings, + options?: DeviceSettingsCreateOrUpdateTimeSettingsOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdateTimeSettings( + deviceName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getAlertSettingsOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getAlertSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AlertSettings - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getNetworkSettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/networkSettings/default", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateAlertSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.NetworkSettings + bodyMapper: Mappers.AlertSettings + }, + 201: { + bodyMapper: Mappers.AlertSettings + }, + 202: { + bodyMapper: Mappers.AlertSettings }, - default: { - bodyMapper: Mappers.CloudError + 204: { + bodyMapper: Mappers.AlertSettings } }, - serializer -}; - -const getSecuritySettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default", + requestBody: Parameters.parameters12, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.deviceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.SecuritySettings - }, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const getTimeSettingsOperationSpec: msRest.OperationSpec = { +const getNetworkSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/networkSettings/default", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/timeSettings/default", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.TimeSettings - }, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.NetworkSettings } }, - serializer -}; - -const beginCreateOrUpdateAlertSettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.deviceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AlertSettings, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateNetworkSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/networkSettings/default", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.AlertSettings + bodyMapper: Mappers.NetworkSettings + }, + 201: { + bodyMapper: Mappers.NetworkSettings + }, + 202: { + bodyMapper: Mappers.NetworkSettings }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError + 204: { + bodyMapper: Mappers.NetworkSettings } }, - serializer -}; - -const beginUpdateNetworkSettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/networkSettings/default", + requestBody: Parameters.parameters13, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.NetworkSettingsPatch, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getSecuritySettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.NetworkSettings - }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.SecuritySettings } }, - serializer -}; - -const beginUpdateSecuritySettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.SecuritySettingsPatch, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateSecuritySettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.SecuritySettings }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError + 201: { + bodyMapper: Mappers.SecuritySettings + }, + 202: { + bodyMapper: Mappers.SecuritySettings + }, + 204: { + bodyMapper: Mappers.SecuritySettings } }, + requestBody: Parameters.parameters14, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginSyncRemotemanagementCertificateOperationSpec: msRest.OperationSpec = { +const syncRemotemanagementCertificateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default/syncRemoteManagementCertificate", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default/syncRemoteManagementCertificate", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + serializer +}; +const getTimeSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/timeSettings/default", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError + 200: { + bodyMapper: Mappers.TimeSettings } }, - serializer -}; - -const beginCreateOrUpdateTimeSettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/timeSettings/default", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName + Parameters.managerName, + Parameters.deviceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.TimeSettings, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateTimeSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/timeSettings/default", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.TimeSettings }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError + 201: { + bodyMapper: Mappers.TimeSettings + }, + 202: { + bodyMapper: Mappers.TimeSettings + }, + 204: { + bodyMapper: Mappers.TimeSettings } }, + requestBody: Parameters.parameters15, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/devices.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/devices.ts index 2968f4c2a474..0a13a802b321 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/devices.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/devices.ts @@ -1,983 +1,1388 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/devicesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Devices } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Device, + DevicesListByManagerOptionalParams, + FailoverSet, + DevicesListFailoverSetsOptionalParams, + Metrics, + DevicesListMetricsOptionalParams, + MetricDefinition, + DevicesListMetricDefinitionOptionalParams, + FailoverTarget, + ListFailoverTargetsRequest, + DevicesListFailoverTargetsOptionalParams, + ConfigureDeviceRequest, + DevicesConfigureOptionalParams, + DevicesListByManagerResponse, + DevicesGetOptionalParams, + DevicesGetResponse, + DevicesDeleteOptionalParams, + DevicePatch, + DevicesUpdateOptionalParams, + DevicesUpdateResponse, + DevicesAuthorizeForServiceEncryptionKeyRolloverOptionalParams, + DevicesDeactivateOptionalParams, + DevicesInstallUpdatesOptionalParams, + DevicesListFailoverSetsResponse, + DevicesListMetricsResponse, + DevicesListMetricDefinitionResponse, + DevicesScanForUpdatesOptionalParams, + DevicesGetUpdateSummaryOptionalParams, + DevicesGetUpdateSummaryResponse, + FailoverRequest, + DevicesFailoverOptionalParams, + DevicesListFailoverTargetsResponse +} from "../models"; -/** Class representing a Devices. */ -export class Devices { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing Devices operations. */ +export class DevicesImpl implements Devices { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a Devices. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Devices class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } - /** - * Complete minimal setup before using the device. - * @param parameters The minimal properties to configure a device. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - configure(parameters: Models.ConfigureDeviceRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginConfigure(parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - /** * Returns the list of devices for the specified manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listByManager(resourceGroupName: string, managerName: string, options?: Models.DevicesListByManagerOptionalParams): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, options: Models.DevicesListByManagerOptionalParams, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: Models.DevicesListByManagerOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options + public listByManager( + resourceGroupName: string, + managerName: string, + options?: DevicesListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listByManagerOperationSpec, - callback) as Promise; + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: DevicesListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: DevicesListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Returns the properties of the specified device. - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.DevicesGetOptionalParams): Promise; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** + * Returns all failover sets for a given device and their eligibility for participating in a failover. + * A failover set refers to a set of volume containers that need to be failed-over as a single unit to + * maintain data integrity. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, resourceGroupName: string, managerName: string, options: Models.DevicesGetOptionalParams, callback: msRest.ServiceCallback): void; - get(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.DevicesGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options + public listFailoverSets( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListFailoverSetsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listFailoverSetsPagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); }, - getOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listFailoverSetsPagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; } - /** - * Deletes the device. - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private async *listFailoverSetsPagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListFailoverSetsOptionalParams + ): AsyncIterableIterator { + let result = await this._listFailoverSets( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listFailoverSetsPagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListFailoverSetsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listFailoverSetsPagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Patches the device. - * @param deviceName The device name - * @param parameters Patch representation of the device. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - update(deviceName: string, parameters: Models.DevicePatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param parameters Patch representation of the device. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - update(deviceName: string, parameters: Models.DevicePatch, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** + * Gets the metrics for the specified device. * @param deviceName The device name - * @param parameters Patch representation of the device. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param filter OData Filter options + * @param options The options parameters. */ - update(deviceName: string, parameters: Models.DevicePatch, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(deviceName: string, parameters: Models.DevicePatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - parameters, - resourceGroupName, - managerName, - options + public listMetrics( + deviceName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: DevicesListMetricsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricsPagingAll( + deviceName, + resourceGroupName, + managerName, + filter, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - updateOperationSpec, - callback) as Promise; + byPage: () => { + return this.listMetricsPagingPage( + deviceName, + resourceGroupName, + managerName, + filter, + options + ); + } + }; + } + + private async *listMetricsPagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: DevicesListMetricsOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetrics( + deviceName, + resourceGroupName, + managerName, + filter, + options + ); + yield result.value || []; + } + + private async *listMetricsPagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: DevicesListMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricsPagingPage( + deviceName, + resourceGroupName, + managerName, + filter, + options + )) { + yield* page; + } } /** - * Authorizes the specified device for service data encryption key rollover. - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - authorizeForServiceEncryptionKeyRollover(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - authorizeForServiceEncryptionKeyRollover(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** + * Gets the metric definitions for the specified device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - authorizeForServiceEncryptionKeyRollover(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - authorizeForServiceEncryptionKeyRollover(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options + public listMetricDefinition( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricDefinitionPagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - authorizeForServiceEncryptionKeyRolloverOperationSpec, - callback); + byPage: () => { + return this.listMetricDefinitionPagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricDefinitionPagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetricDefinition( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricDefinitionPagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricDefinitionPagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Deactivates the device. - * @param deviceName The device name + * Given a list of volume containers to be failed over from a source device, this method returns the + * eligibility result, as a failover target, for all devices under that resource. + * @param sourceDeviceName The source device name on which failover is performed. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters ListFailoverTargetsRequest containing the list of volume containers to be failed + * over. + * @param options The options parameters. */ - deactivate(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeactivate(deviceName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + public listFailoverTargets( + sourceDeviceName: string, + resourceGroupName: string, + managerName: string, + parameters: ListFailoverTargetsRequest, + options?: DevicesListFailoverTargetsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listFailoverTargetsPagingAll( + sourceDeviceName, + resourceGroupName, + managerName, + parameters, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listFailoverTargetsPagingPage( + sourceDeviceName, + resourceGroupName, + managerName, + parameters, + options + ); + } + }; + } + + private async *listFailoverTargetsPagingPage( + sourceDeviceName: string, + resourceGroupName: string, + managerName: string, + parameters: ListFailoverTargetsRequest, + options?: DevicesListFailoverTargetsOptionalParams + ): AsyncIterableIterator { + let result = await this._listFailoverTargets( + sourceDeviceName, + resourceGroupName, + managerName, + parameters, + options + ); + yield result.value || []; + } + + private async *listFailoverTargetsPagingAll( + sourceDeviceName: string, + resourceGroupName: string, + managerName: string, + parameters: ListFailoverTargetsRequest, + options?: DevicesListFailoverTargetsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listFailoverTargetsPagingPage( + sourceDeviceName, + resourceGroupName, + managerName, + parameters, + options + )) { + yield* page; + } } /** - * Downloads and installs the updates on the device. - * @param deviceName The device name + * Complete minimal setup before using the device. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The minimal properties to configure a device. + * @param options The options parameters. */ - installUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginInstallUpdates(deviceName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginConfigure( + resourceGroupName: string, + managerName: string, + parameters: ConfigureDeviceRequest, + options?: DevicesConfigureOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, managerName, parameters, options }, + configureOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Returns all failover sets for a given device and their eligibility for participating in a - * failover. A failover set refers to a set of volume containers that need to be failed-over as a - * single unit to maintain data integrity. - * @param deviceName The device name + * Complete minimal setup before using the device. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The minimal properties to configure a device. + * @param options The options parameters. */ - listFailoverSets(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + async beginConfigureAndWait( + resourceGroupName: string, + managerName: string, + parameters: ConfigureDeviceRequest, + options?: DevicesConfigureOptionalParams + ): Promise { + const poller = await this.beginConfigure( + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** - * @param deviceName The device name + * Returns the list of devices for the specified manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listFailoverSets(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: DevicesListByManagerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); + } + /** + * Returns the properties of the specified device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listFailoverSets(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listFailoverSets(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - listFailoverSetsOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + getOperationSpec + ); } /** - * Gets the metrics for the specified device. + * Deletes the device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param filter OData Filter options - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listMetrics(deviceName: string, resourceGroupName: string, managerName: string, filter: string, options?: msRest.RequestOptionsBase): Promise; + async beginDelete( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Deletes the device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param filter OData Filter options - * @param callback The callback + * @param options The options parameters. */ - listMetrics(deviceName: string, resourceGroupName: string, managerName: string, filter: string, callback: msRest.ServiceCallback): void; + async beginDeleteAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); + } + /** + * Patches the device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param filter OData Filter options - * @param options The optional parameters - * @param callback The callback + * @param parameters Patch representation of the device. + * @param options The options parameters. */ - listMetrics(deviceName: string, resourceGroupName: string, managerName: string, filter: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetrics(deviceName: string, resourceGroupName: string, managerName: string, filter: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: DevicePatch, + options?: DevicesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - filter, - options - }, - listMetricsOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, parameters, options }, + updateOperationSpec + ); } /** - * Gets the metric definitions for the specified device. - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Authorizes the specified device for service data encryption key rollover. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + authorizeForServiceEncryptionKeyRollover( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesAuthorizeForServiceEncryptionKeyRolloverOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + authorizeForServiceEncryptionKeyRolloverOperationSpec + ); + } + /** + * Deactivates the device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - listMetricDefinitionOperationSpec, - callback) as Promise; + async beginDeactivate( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeactivateOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, options }, + deactivateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Scans for updates on the device. + * Deactivates the device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - scanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginScanForUpdates(deviceName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDeactivateAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeactivateOptionalParams + ): Promise { + const poller = await this.beginDeactivate( + deviceName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Returns the update summary of the specified device name. + * Downloads and installs the updates on the device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + async beginInstallUpdates( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, options }, + installUpdatesOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Downloads and installs the updates on the device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginInstallUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise { + const poller = await this.beginInstallUpdates( + deviceName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); + } + /** + * Returns all failover sets for a given device and their eligibility for participating in a failover. + * A failover set refers to a set of volume containers that need to be failed-over as a single unit to + * maintain data integrity. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listFailoverSets( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListFailoverSetsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - getUpdateSummaryOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + listFailoverSetsOperationSpec + ); } /** - * Failovers a set of volume containers from a specified source device to a target device. - * @param sourceDeviceName The source device name on which failover is performed. - * @param parameters FailoverRequest containing the source device and the list of volume containers - * to be failed over. + * Gets the metrics for the specified device. + * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param filter OData Filter options + * @param options The options parameters. */ - failover(sourceDeviceName: string, parameters: Models.FailoverRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginFailover(sourceDeviceName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private _listMetrics( + deviceName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: DevicesListMetricsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, filter, options }, + listMetricsOperationSpec + ); } /** - * Given a list of volume containers to be failed over from a source device, this method returns - * the eligibility result, as a failover target, for all devices under that resource. - * @param sourceDeviceName The source device name on which failover is performed. - * @param parameters ListFailoverTargetsRequest containing the list of volume containers to be - * failed over. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listFailoverTargets(sourceDeviceName: string, parameters: Models.ListFailoverTargetsRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param sourceDeviceName The source device name on which failover is performed. - * @param parameters ListFailoverTargetsRequest containing the list of volume containers to be - * failed over. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listFailoverTargets(sourceDeviceName: string, parameters: Models.ListFailoverTargetsRequest, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param sourceDeviceName The source device name on which failover is performed. - * @param parameters ListFailoverTargetsRequest containing the list of volume containers to be - * failed over. + * Gets the metric definitions for the specified device. + * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listFailoverTargets(sourceDeviceName: string, parameters: Models.ListFailoverTargetsRequest, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listFailoverTargets(sourceDeviceName: string, parameters: Models.ListFailoverTargetsRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listMetricDefinition( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricDefinitionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - sourceDeviceName, - parameters, - resourceGroupName, - managerName, - options - }, - listFailoverTargetsOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + listMetricDefinitionOperationSpec + ); } /** - * Complete minimal setup before using the device. - * @param parameters The minimal properties to configure a device. + * Scans for updates on the device. + * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginConfigure(parameters: Models.ConfigureDeviceRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - parameters, - resourceGroupName, - managerName, - options - }, - beginConfigureOperationSpec, - options); + async beginScanForUpdates( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, managerName, options }, + scanForUpdatesOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Deletes the device. + * Scans for updates on the device. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginScanForUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise { + const poller = await this.beginScanForUpdates( + deviceName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Deactivates the device. + * Returns the update summary of the specified device name. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeactivate(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - beginDeactivateOperationSpec, - options); + getUpdateSummary( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetUpdateSummaryOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + getUpdateSummaryOperationSpec + ); } /** - * Downloads and installs the updates on the device. - * @param deviceName The device name + * Failovers a set of volume containers from a specified source device to a target device. + * @param sourceDeviceName The source device name on which failover is performed. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters FailoverRequest containing the source device and the list of volume containers to + * be failed over. + * @param options The options parameters. */ - beginInstallUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - beginInstallUpdatesOperationSpec, - options); + async beginFailover( + sourceDeviceName: string, + resourceGroupName: string, + managerName: string, + parameters: FailoverRequest, + options?: DevicesFailoverOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { sourceDeviceName, resourceGroupName, managerName, parameters, options }, + failoverOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Scans for updates on the device. - * @param deviceName The device name + * Failovers a set of volume containers from a specified source device to a target device. + * @param sourceDeviceName The source device name on which failover is performed. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters FailoverRequest containing the source device and the list of volume containers to + * be failed over. + * @param options The options parameters. */ - beginScanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - beginScanForUpdatesOperationSpec, - options); + async beginFailoverAndWait( + sourceDeviceName: string, + resourceGroupName: string, + managerName: string, + parameters: FailoverRequest, + options?: DevicesFailoverOptionalParams + ): Promise { + const poller = await this.beginFailover( + sourceDeviceName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Failovers a set of volume containers from a specified source device to a target device. + * Given a list of volume containers to be failed over from a source device, this method returns the + * eligibility result, as a failover target, for all devices under that resource. * @param sourceDeviceName The source device name on which failover is performed. - * @param parameters FailoverRequest containing the source device and the list of volume containers - * to be failed over. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters ListFailoverTargetsRequest containing the list of volume containers to be failed + * over. + * @param options The options parameters. */ - beginFailover(sourceDeviceName: string, parameters: Models.FailoverRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - sourceDeviceName, - parameters, - resourceGroupName, - managerName, - options - }, - beginFailoverOperationSpec, - options); + private _listFailoverTargets( + sourceDeviceName: string, + resourceGroupName: string, + managerName: string, + parameters: ListFailoverTargetsRequest, + options?: DevicesListFailoverTargetsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { sourceDeviceName, resourceGroupName, managerName, parameters, options }, + listFailoverTargetsOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByManagerOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const configureOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/configureDevice", + httpMethod: "POST", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + requestBody: Parameters.parameters8, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion, - Parameters.expand - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.contentType], + mediaType: "json", + serializer +}; +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeviceList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion, - Parameters.expand - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Device - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", + httpMethod: "DELETE", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.deviceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.DevicePatch, - required: true - } - }, + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.Device - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const authorizeForServiceEncryptionKeyRolloverOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/authorizeForServiceEncryptionKeyRollover", + requestBody: Parameters.parameters9, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.deviceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listFailoverSetsOperationSpec: msRest.OperationSpec = { +const authorizeForServiceEncryptionKeyRolloverOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/authorizeForServiceEncryptionKeyRollover", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/listFailoverSets", + responses: { 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName + Parameters.managerName, + Parameters.deviceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.FailoverSetsList - }, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; - -const listMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metrics", +const deactivateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/deactivate", + httpMethod: "POST", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName + Parameters.managerName, + Parameters.deviceName ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.MetricList - }, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; - -const listMetricDefinitionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metricsDefinitions", +const installUpdatesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/installUpdates", + httpMethod: "POST", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + serializer +}; +const listFailoverSetsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/listFailoverSets", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.MetricDefinitionList - }, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.FailoverSetsList } }, - serializer -}; - -const getUpdateSummaryOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/updateSummary/default", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const listMetricsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metrics", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Updates - }, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.MetricList } }, - serializer -}; - -const listFailoverTargetsOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{sourceDeviceName}/listFailoverTargets", + queryParameters: [Parameters.apiVersion, Parameters.filter1], urlParameters: [ - Parameters.sourceDeviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ListFailoverTargetsRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listMetricDefinitionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metricsDefinitions", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FailoverTargetsList - }, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.MetricDefinitionList } }, - serializer -}; - -const beginConfigureOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/configureDevice", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.deviceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ConfigureDeviceRequest, - required: true - } - }, - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept], serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}", +const scanForUpdatesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/scanForUpdates", + httpMethod: "POST", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + serializer +}; +const getUpdateSummaryOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/updateSummary/default", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError + 200: { + bodyMapper: Mappers.Updates } }, - serializer -}; - -const beginDeactivateOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/deactivate", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.deviceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept], serializer }; - -const beginInstallUpdatesOperationSpec: msRest.OperationSpec = { +const failoverOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{sourceDeviceName}/failover", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/installUpdates", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + requestBody: Parameters.parameters10, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName + Parameters.managerName, + Parameters.sourceDeviceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - -const beginScanForUpdatesOperationSpec: msRest.OperationSpec = { +const listFailoverTargetsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{sourceDeviceName}/listFailoverTargets", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/scanForUpdates", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError + 200: { + bodyMapper: Mappers.FailoverTargetsList } }, - serializer -}; - -const beginFailoverOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{sourceDeviceName}/failover", + requestBody: Parameters.parameters11, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.sourceDeviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.sourceDeviceName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.FailoverRequest, - required: true - } - }, - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/hardwareComponentGroups.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/hardwareComponentGroups.ts index 4ea0b6a05596..b5f2b17489b1 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/hardwareComponentGroups.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/hardwareComponentGroups.ts @@ -1,29 +1,37 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/hardwareComponentGroupsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { HardwareComponentGroups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + HardwareComponentGroup, + HardwareComponentGroupsListByDeviceOptionalParams, + HardwareComponentGroupsListByDeviceResponse, + ControllerPowerStateChangeRequest, + HardwareComponentGroupsChangeControllerPowerStateOptionalParams +} from "../models"; -/** Class representing a HardwareComponentGroups. */ -export class HardwareComponentGroups { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing HardwareComponentGroups operations. */ +export class HardwareComponentGroupsImpl implements HardwareComponentGroups { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a HardwareComponentGroups. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class HardwareComponentGroups class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -32,134 +40,229 @@ export class HardwareComponentGroups { * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: HardwareComponentGroupsListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: HardwareComponentGroupsListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: HardwareComponentGroupsListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Lists the hardware component groups at device-level. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: HardwareComponentGroupsListByDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); + } + /** + * Changes the power state of the controller. * @param deviceName The device name + * @param hardwareComponentGroupName The hardware component group name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param parameters The controller power state change request. + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginChangeControllerPowerState( + deviceName: string, + hardwareComponentGroupName: string, + resourceGroupName: string, + managerName: string, + parameters: ControllerPowerStateChangeRequest, + options?: HardwareComponentGroupsChangeControllerPowerStateOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, + hardwareComponentGroupName, resourceGroupName, managerName, + parameters, options }, - listByDeviceOperationSpec, - callback) as Promise; + changeControllerPowerStateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Changes the power state of the controller. * @param deviceName The device name * @param hardwareComponentGroupName The hardware component group name. - * @param parameters The controller power state change request. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - changeControllerPowerState(deviceName: string, hardwareComponentGroupName: string, parameters: Models.ControllerPowerStateChangeRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginChangeControllerPowerState(deviceName,hardwareComponentGroupName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Changes the power state of the controller. - * @param deviceName The device name - * @param hardwareComponentGroupName The hardware component group name. * @param parameters The controller power state change request. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginChangeControllerPowerState(deviceName: string, hardwareComponentGroupName: string, parameters: Models.ControllerPowerStateChangeRequest, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - hardwareComponentGroupName, - parameters, - resourceGroupName, - managerName, - options - }, - beginChangeControllerPowerStateOperationSpec, - options); + async beginChangeControllerPowerStateAndWait( + deviceName: string, + hardwareComponentGroupName: string, + resourceGroupName: string, + managerName: string, + parameters: ControllerPowerStateChangeRequest, + options?: HardwareComponentGroupsChangeControllerPowerStateOptionalParams + ): Promise { + const poller = await this.beginChangeControllerPowerState( + deviceName, + hardwareComponentGroupName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/hardwareComponentGroups", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/hardwareComponentGroups", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.HardwareComponentGroupList - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginChangeControllerPowerStateOperationSpec: msRest.OperationSpec = { +const changeControllerPowerStateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/hardwareComponentGroups/{hardwareComponentGroupName}/changeControllerPowerState", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/hardwareComponentGroups/{hardwareComponentGroupName}/changeControllerPowerState", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + requestBody: Parameters.parameters19, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.hardwareComponentGroupName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.hardwareComponentGroupName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ControllerPowerStateChangeRequest, - required: true - } - }, - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/index.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/index.ts index 1e7af78ddd76..1b7af3405d3b 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/index.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./operations"; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/jobs.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/jobs.ts index 434ac801f946..dd6d388d01a7 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/jobs.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/jobs.ts @@ -1,107 +1,239 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/jobsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Jobs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Job, + JobsListByDeviceNextOptionalParams, + JobsListByDeviceOptionalParams, + JobsListByManagerNextOptionalParams, + JobsListByManagerOptionalParams, + JobsListByDeviceResponse, + JobsGetOptionalParams, + JobsGetResponse, + JobsCancelOptionalParams, + JobsListByManagerResponse, + JobsListByDeviceNextResponse, + JobsListByManagerNextResponse +} from "../models"; -/** Class representing a Jobs. */ -export class Jobs { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing Jobs operations. */ +export class JobsImpl implements Jobs { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a Jobs. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Jobs class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } /** - * Gets all the jobs for specified device. With optional OData query parameters, a filtered set of - * jobs is returned. - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.JobsListByDeviceOptionalParams): Promise; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** + * Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs + * is returned. * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: Models.JobsListByDeviceOptionalParams, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: Models.JobsListByDeviceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: JobsListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: JobsListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDeviceNext( deviceName, resourceGroupName, managerName, + continuationToken, options - }, - listByDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: JobsListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } } /** - * Gets the details of the specified job name. - * @param deviceName The device name - * @param jobName The job Name. + * Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of + * jobs is returned. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + public listByManager( + resourceGroupName: string, + managerName: string, + options?: JobsListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: JobsListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByManagerNext( + resourceGroupName, + managerName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: JobsListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs + * is returned. * @param deviceName The device name - * @param jobName The job Name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: JobsListByDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); + } + /** + * Gets the details of the specified job name. * @param deviceName The device name * @param jobName The job Name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + jobName: string, + resourceGroupName: string, + managerName: string, + options?: JobsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - jobName, - resourceGroupName, - managerName, - options - }, - getOperationSpec, - callback) as Promise; + { deviceName, jobName, resourceGroupName, managerName, options }, + getOperationSpec + ); } /** @@ -110,274 +242,263 @@ export class Jobs { * @param jobName The jobName. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - cancel(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCancel(deviceName,jobName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCancel( + deviceName: string, + jobName: string, + resourceGroupName: string, + managerName: string, + options?: JobsCancelOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, jobName, resourceGroupName, managerName, options }, + cancelOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Gets all the jobs for the specified manager. With optional OData query parameters, a filtered - * set of jobs is returned. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listByManager(resourceGroupName: string, managerName: string, options?: Models.JobsListByManagerOptionalParams): Promise; - /** + * Cancels a job on the device. + * @param deviceName The device name + * @param jobName The jobName. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginCancelAndWait( + deviceName: string, + jobName: string, + resourceGroupName: string, + managerName: string, + options?: JobsCancelOptionalParams + ): Promise { + const poller = await this.beginCancel( + deviceName, + jobName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of + * jobs is returned. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options: Models.JobsListByManagerOptionalParams, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: Models.JobsListByManagerOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: JobsListByManagerOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listByManagerOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); } /** - * Cancels a job on the device. + * ListByDeviceNext * @param deviceName The device name - * @param jobName The jobName. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCancel(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - jobName, - resourceGroupName, - managerName, - options - }, - beginCancelOperationSpec, - options); - } - - /** - * Gets all the jobs for specified device. With optional OData query parameters, a filtered set of - * jobs is returned. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDeviceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListByDevice method. + * @param options The options parameters. */ - listByDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDeviceNext( + deviceName: string, + resourceGroupName: string, + managerName: string, + nextLink: string, + options?: JobsListByDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, nextLink, options }, + listByDeviceNextOperationSpec + ); } /** - * Gets all the jobs for the specified manager. With optional OData query parameters, a filtered - * set of jobs is returned. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByManagerNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByManagerNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByManagerNext + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param nextLink The nextLink from the previous successful call to the ListByManager method. + * @param options The options parameters. */ - listByManagerNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManagerNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManagerNext( + resourceGroupName: string, + managerName: string, + nextLink: string, + options?: JobsListByManagerNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByManagerNextOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, nextLink, options }, + listByManagerNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.JobList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.deviceName, - Parameters.jobName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Job - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName, + Parameters.jobName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByManagerOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/jobs", +const cancelOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}/cancel", + httpMethod: "POST", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter0 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.jobName ], + serializer +}; +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/jobs", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.JobList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCancelOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}/cancel", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.deviceName, - Parameters.jobName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept], serializer }; - -const listByDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.JobList - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByManagerNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByManagerNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.JobList - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/managers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/managers.ts index c94fae390c9b..770282c109ad 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/managers.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/managers.ts @@ -1,217 +1,435 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/managersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Managers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; - -/** Class representing a Managers. */ -export class Managers { - private readonly client: StorSimple8000SeriesManagementClientContext; - - /** - * Create a Managers. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. - */ - constructor(client: StorSimple8000SeriesManagementClientContext) { +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { + Manager, + ManagersListOptionalParams, + ManagersListByResourceGroupOptionalParams, + Feature, + ManagersListFeatureSupportStatusOptionalParams, + Metrics, + ManagersListMetricsOptionalParams, + MetricDefinition, + ManagersListMetricDefinitionOptionalParams, + ManagersListResponse, + ManagersListByResourceGroupResponse, + ManagersGetOptionalParams, + ManagersGetResponse, + ManagersCreateOrUpdateOptionalParams, + ManagersCreateOrUpdateResponse, + ManagersDeleteOptionalParams, + ManagerPatch, + ManagersUpdateOptionalParams, + ManagersUpdateResponse, + ManagersGetDevicePublicEncryptionKeyOptionalParams, + ManagersGetDevicePublicEncryptionKeyResponse, + ManagersGetEncryptionSettingsOptionalParams, + ManagersGetEncryptionSettingsResponse, + ManagersGetExtendedInfoOptionalParams, + ManagersGetExtendedInfoResponse, + ManagerExtendedInfo, + ManagersCreateExtendedInfoOptionalParams, + ManagersCreateExtendedInfoResponse, + ManagersDeleteExtendedInfoOptionalParams, + ManagersUpdateExtendedInfoOptionalParams, + ManagersUpdateExtendedInfoResponse, + ManagersListFeatureSupportStatusResponse, + ManagersGetActivationKeyOptionalParams, + ManagersGetActivationKeyResponse, + ManagersGetPublicEncryptionKeyOptionalParams, + ManagersGetPublicEncryptionKeyResponse, + ManagersListMetricsResponse, + ManagersListMetricDefinitionResponse, + ManagersRegenerateActivationKeyOptionalParams, + ManagersRegenerateActivationKeyResponse +} from "../models"; + +/// +/** Class containing Managers operations. */ +export class ManagersImpl implements Managers { + private readonly client: StorSimple8000SeriesManagementClient; + + /** + * Initialize a new instance of the class Managers class. + * @param client Reference to the service client + */ + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } /** * Retrieves all the managers in a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + * @param options The options parameters. + */ + public list( + options?: ManagersListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ManagersListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: ManagersListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Retrieves all the managers in a resource group. * @param resourceGroupName The resource group name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - options + public listByResourceGroup( + resourceGroupName: string, + options?: ManagersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listByResourceGroupOperationSpec, - callback) as Promise; + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ManagersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ManagersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Returns the properties of the specified manager name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Lists the features and their support status * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback - */ - get(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + * @param options The options parameters. + */ + public listFeatureSupportStatus( + resourceGroupName: string, + managerName: string, + options?: ManagersListFeatureSupportStatusOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listFeatureSupportStatusPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listFeatureSupportStatusPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listFeatureSupportStatusPagingPage( + resourceGroupName: string, + managerName: string, + options?: ManagersListFeatureSupportStatusOptionalParams + ): AsyncIterableIterator { + let result = await this._listFeatureSupportStatus( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listFeatureSupportStatusPagingAll( + resourceGroupName: string, + managerName: string, + options?: ManagersListFeatureSupportStatusOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listFeatureSupportStatusPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Gets the metrics for the specified manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options + * @param filter OData Filter options + * @param options The options parameters. + */ + public listMetrics( + resourceGroupName: string, + managerName: string, + filter: string, + options?: ManagersListMetricsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricsPagingAll( + resourceGroupName, + managerName, + filter, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - getOperationSpec, - callback) as Promise; + byPage: () => { + return this.listMetricsPagingPage( + resourceGroupName, + managerName, + filter, + options + ); + } + }; + } + + private async *listMetricsPagingPage( + resourceGroupName: string, + managerName: string, + filter: string, + options?: ManagersListMetricsOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetrics( + resourceGroupName, + managerName, + filter, + options + ); + yield result.value || []; + } + + private async *listMetricsPagingAll( + resourceGroupName: string, + managerName: string, + filter: string, + options?: ManagersListMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricsPagingPage( + resourceGroupName, + managerName, + filter, + options + )) { + yield* page; + } } /** - * Creates or updates the manager. - * @param parameters The manager. + * Gets the metric definitions for the specified manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(parameters: Models.Manager, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + * @param options The options parameters. + */ + public listMetricDefinition( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricDefinitionPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricDefinitionPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricDefinitionPagingPage( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetricDefinition( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricDefinitionPagingAll( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricDefinitionPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** - * @param parameters The manager. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback + * Retrieves all the managers in a subscription. + * @param options The options parameters. */ - createOrUpdate(parameters: Models.Manager, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _list( + options?: ManagersListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param parameters The manager. + * Retrieves all the managers in a resource group. * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(parameters: Models.Manager, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(parameters: Models.Manager, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: ManagersListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - parameters, - resourceGroupName, - managerName, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** - * Deletes the manager. + * Returns the properties of the specified manager name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + get( + resourceGroupName: string, + managerName: string, + options?: ManagersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, managerName, options }, + getOperationSpec + ); + } + /** + * Creates or updates the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + * @param parameters The manager. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + managerName: string, + parameters: Manager, + options?: ManagersCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, managerName, parameters, options }, + createOrUpdateOperationSpec + ); + } + /** + * Deletes the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + managerName: string, + options?: ManagersDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, managerName, options }, + deleteOperationSpec + ); } /** * Updates the StorSimple Manager. - * @param parameters The manager update parameters. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - update(parameters: Models.ManagerPatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param parameters The manager update parameters. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback - */ - update(parameters: Models.ManagerPatch, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** * @param parameters The manager update parameters. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - update(parameters: Models.ManagerPatch, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(parameters: Models.ManagerPatch, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + update( + resourceGroupName: string, + managerName: string, + parameters: ManagerPatch, + options?: ManagersUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - parameters, - resourceGroupName, - managerName, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, parameters, options }, + updateOperationSpec + ); } /** @@ -219,303 +437,160 @@ export class Managers { * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - getDevicePublicEncryptionKey(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - getDevicePublicEncryptionKey(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - getDevicePublicEncryptionKey(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getDevicePublicEncryptionKey(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getDevicePublicEncryptionKey( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: ManagersGetDevicePublicEncryptionKeyOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options - }, - getDevicePublicEncryptionKeyOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, managerName, options }, + getDevicePublicEncryptionKeyOperationSpec + ); } /** * Returns the encryption settings of the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getEncryptionSettings(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - getEncryptionSettings(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - getEncryptionSettings(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getEncryptionSettings(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getEncryptionSettings( + resourceGroupName: string, + managerName: string, + options?: ManagersGetEncryptionSettingsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - getEncryptionSettingsOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + getEncryptionSettingsOperationSpec + ); } /** * Returns the extended information of the specified manager name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getExtendedInfo(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - getExtendedInfo(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - getExtendedInfo(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getExtendedInfo(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getExtendedInfo( + resourceGroupName: string, + managerName: string, + options?: ManagersGetExtendedInfoOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - getExtendedInfoOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + getExtendedInfoOperationSpec + ); } /** * Creates the extended info of the manager. - * @param parameters The manager extended information. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - createExtendedInfo(parameters: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param parameters The manager extended information. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback - */ - createExtendedInfo(parameters: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** * @param parameters The manager extended information. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - createExtendedInfo(parameters: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createExtendedInfo(parameters: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + createExtendedInfo( + resourceGroupName: string, + managerName: string, + parameters: ManagerExtendedInfo, + options?: ManagersCreateExtendedInfoOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - parameters, - resourceGroupName, - managerName, - options - }, - createExtendedInfoOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, parameters, options }, + createExtendedInfoOperationSpec + ); } /** * Deletes the extended info of the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - deleteExtendedInfo(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - deleteExtendedInfo(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - deleteExtendedInfo(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteExtendedInfo(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + deleteExtendedInfo( + resourceGroupName: string, + managerName: string, + options?: ManagersDeleteExtendedInfoOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - deleteExtendedInfoOperationSpec, - callback); + { resourceGroupName, managerName, options }, + deleteExtendedInfoOperationSpec + ); } /** * Updates the extended info of the manager. - * @param parameters The manager extended information. * @param resourceGroupName The resource group name * @param managerName The manager name * @param ifMatch Pass the ETag of ExtendedInfo fetched from GET call - * @param [options] The optional parameters - * @returns Promise - */ - updateExtendedInfo(parameters: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, options?: msRest.RequestOptionsBase): Promise; - /** * @param parameters The manager extended information. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param ifMatch Pass the ETag of ExtendedInfo fetched from GET call - * @param callback The callback - */ - updateExtendedInfo(parameters: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, callback: msRest.ServiceCallback): void; - /** - * @param parameters The manager extended information. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param ifMatch Pass the ETag of ExtendedInfo fetched from GET call - * @param options The optional parameters - * @param callback The callback - */ - updateExtendedInfo(parameters: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - updateExtendedInfo(parameters: Models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + updateExtendedInfo( + resourceGroupName: string, + managerName: string, + ifMatch: string, + parameters: ManagerExtendedInfo, + options?: ManagersUpdateExtendedInfoOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - parameters, - resourceGroupName, - managerName, - ifMatch, - options - }, - updateExtendedInfoOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, ifMatch, parameters, options }, + updateExtendedInfoOperationSpec + ); } /** * Lists the features and their support status * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listFeatureSupportStatus(resourceGroupName: string, managerName: string, options?: Models.ManagersListFeatureSupportStatusOptionalParams): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listFeatureSupportStatus(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listFeatureSupportStatus(resourceGroupName: string, managerName: string, options: Models.ManagersListFeatureSupportStatusOptionalParams, callback: msRest.ServiceCallback): void; - listFeatureSupportStatus(resourceGroupName: string, managerName: string, options?: Models.ManagersListFeatureSupportStatusOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listFeatureSupportStatus( + resourceGroupName: string, + managerName: string, + options?: ManagersListFeatureSupportStatusOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listFeatureSupportStatusOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listFeatureSupportStatusOperationSpec + ); } /** * Returns the activation key of the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getActivationKey(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - getActivationKey(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - getActivationKey(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getActivationKey(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getActivationKey( + resourceGroupName: string, + managerName: string, + options?: ManagersGetActivationKeyOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - getActivationKeyOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + getActivationKeyOperationSpec + ); } /** * Returns the symmetric encrypted public encryption key of the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getPublicEncryptionKey(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - getPublicEncryptionKey(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback - */ - getPublicEncryptionKey(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getPublicEncryptionKey(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getPublicEncryptionKey( + resourceGroupName: string, + managerName: string, + options?: ManagersGetPublicEncryptionKeyOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - getPublicEncryptionKeyOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + getPublicEncryptionKeyOperationSpec + ); } /** @@ -523,579 +598,396 @@ export class Managers { * @param resourceGroupName The resource group name * @param managerName The manager name * @param filter OData Filter options - * @param [options] The optional parameters - * @returns Promise - */ - listMetrics(resourceGroupName: string, managerName: string, filter: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param filter OData Filter options - * @param callback The callback - */ - listMetrics(resourceGroupName: string, managerName: string, filter: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param filter OData Filter options - * @param options The optional parameters - * @param callback The callback - */ - listMetrics(resourceGroupName: string, managerName: string, filter: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetrics(resourceGroupName: string, managerName: string, filter: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + private _listMetrics( + resourceGroupName: string, + managerName: string, + filter: string, + options?: ManagersListMetricsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - filter, - options - }, - listMetricsOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, filter, options }, + listMetricsOperationSpec + ); } /** * Gets the metric definitions for the specified manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listMetricDefinition(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listMetricDefinition(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listMetricDefinition(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetricDefinition(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listMetricDefinition( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricDefinitionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listMetricDefinitionOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listMetricDefinitionOperationSpec + ); } /** * Re-generates and returns the activation key of the manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - regenerateActivationKey(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - regenerateActivationKey(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - regenerateActivationKey(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - regenerateActivationKey(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + regenerateActivationKey( + resourceGroupName: string, + managerName: string, + options?: ManagersRegenerateActivationKeyOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - regenerateActivationKeyOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + regenerateActivationKeyOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.StorSimple/managers", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.StorSimple/managers", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ManagerList - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ManagerList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Manager - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Manager, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Manager }, 201: { bodyMapper: Mappers.Manager - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + httpMethod: "DELETE", + responses: { 200: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ManagerPatch, - required: true - } - }, + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.Manager - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getDevicePublicEncryptionKeyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/publicEncryptionKey", + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getDevicePublicEncryptionKeyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/publicEncryptionKey", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.PublicKey - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getEncryptionSettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/encryptionSettings/default", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getEncryptionSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/encryptionSettings/default", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EncryptionSettings - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getExtendedInfoOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getExtendedInfoOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ManagerExtendedInfo - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createExtendedInfoOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ManagerExtendedInfo, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createExtendedInfoOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ManagerExtendedInfo - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteExtendedInfoOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const updateExtendedInfoOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", +const deleteExtendedInfoOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + httpMethod: "DELETE", + responses: { 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.ifMatch, - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ManagerExtendedInfo, - required: true - } - }, + serializer +}; +const updateExtendedInfoOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.ManagerExtendedInfo - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listFeatureSupportStatusOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/features", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter0 - ], headerParameters: [ - Parameters.acceptLanguage + Parameters.accept, + Parameters.contentType, + Parameters.ifMatch ], + mediaType: "json", + serializer +}; +const listFeatureSupportStatusOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/features", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.FeatureList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getActivationKeyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/listActivationKey", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getActivationKeyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/listActivationKey", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.Key - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getPublicEncryptionKeyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/listPublicEncryptionKey", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getPublicEncryptionKeyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/listPublicEncryptionKey", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.SymmetricEncryptedSecret - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metrics", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listMetricsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metrics", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.MetricList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listMetricDefinitionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metricsDefinitions", + queryParameters: [Parameters.apiVersion, Parameters.filter1], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listMetricDefinitionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metricsDefinitions", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.MetricDefinitionList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const regenerateActivationKeyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/regenerateActivationKey", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const regenerateActivationKeyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/regenerateActivationKey", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.Key - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/operations.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/operations.ts index 0ec054845d1a..ceb47ec2275a 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/operations.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/operations.ts @@ -1,123 +1,131 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { + AvailableProviderOperation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a Operations. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } /** - * Lists all of the available REST API operations of the Microsoft.Storsimple provider - * @param [options] The optional parameters - * @returns Promise + * Lists all of the available REST API operations of the Microsoft.StorSimple provider + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** - * Lists all of the available REST API operations of the Microsoft.Storsimple provider - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * Lists all of the available REST API operations of the Microsoft.StorSimple provider + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.StorSimple/operations", httpMethod: "GET", - path: "providers/Microsoft.StorSimple/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AvailableProviderOperationList - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AvailableProviderOperationList - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/storageAccountCredentials.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/storageAccountCredentials.ts index 0a42ec912eac..7d8527102ad1 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/storageAccountCredentials.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/storageAccountCredentials.ts @@ -1,29 +1,41 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/storageAccountCredentialsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { StorageAccountCredentials } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + StorageAccountCredential, + StorageAccountCredentialsListByManagerOptionalParams, + StorageAccountCredentialsListByManagerResponse, + StorageAccountCredentialsGetOptionalParams, + StorageAccountCredentialsGetResponse, + StorageAccountCredentialsCreateOrUpdateOptionalParams, + StorageAccountCredentialsCreateOrUpdateResponse, + StorageAccountCredentialsDeleteOptionalParams +} from "../models"; -/** Class representing a StorageAccountCredentials. */ -export class StorageAccountCredentials { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing StorageAccountCredentials operations. */ +export class StorageAccountCredentialsImpl + implements StorageAccountCredentials { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a StorageAccountCredentials. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class StorageAccountCredentials class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -31,32 +43,77 @@ export class StorageAccountCredentials { * Gets all the storage account credentials in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByManager(resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listByManager( + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsListByManagerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagerPagingAll( + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByManagerPagingPage( + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsListByManagerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByManager( + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByManagerPagingAll( + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsListByManagerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagerPagingPage( + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Gets all the storage account credentials in a manager. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByManager(resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByManager( + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsListByManagerOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - managerName, - options - }, - listByManagerOperationSpec, - callback) as Promise; + { resourceGroupName, managerName, options }, + listByManagerOperationSpec + ); } /** @@ -64,49 +121,119 @@ export class StorageAccountCredentials { * @param storageAccountCredentialName The name of storage account credential to be fetched. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(storageAccountCredentialName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param storageAccountCredentialName The name of storage account credential to be fetched. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - get(storageAccountCredentialName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + get( + storageAccountCredentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { storageAccountCredentialName, resourceGroupName, managerName, options }, + getOperationSpec + ); + } + /** - * @param storageAccountCredentialName The name of storage account credential to be fetched. + * Creates or updates the storage account credential. + * @param storageAccountCredentialName The storage account credential name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param parameters The storage account credential to be added or updated. + * @param options The options parameters. */ - get(storageAccountCredentialName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(storageAccountCredentialName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + storageAccountCredentialName: string, + resourceGroupName: string, + managerName: string, + parameters: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageAccountCredentialsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { storageAccountCredentialName, resourceGroupName, managerName, + parameters, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or updates the storage account credential. * @param storageAccountCredentialName The storage account credential name. - * @param parameters The storage account credential to be added or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The storage account credential to be added or updated. + * @param options The options parameters. */ - createOrUpdate(storageAccountCredentialName: string, parameters: Models.StorageAccountCredential, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(storageAccountCredentialName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + storageAccountCredentialName: string, + resourceGroupName: string, + managerName: string, + parameters: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + storageAccountCredentialName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } /** @@ -114,34 +241,62 @@ export class StorageAccountCredentials { * @param storageAccountCredentialName The name of the storage account credential. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(storageAccountCredentialName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(storageAccountCredentialName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + storageAccountCredentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Creates or updates the storage account credential. - * @param storageAccountCredentialName The storage account credential name. - * @param parameters The storage account credential to be added or updated. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(storageAccountCredentialName: string, parameters: Models.StorageAccountCredential, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - storageAccountCredentialName, - parameters, - resourceGroupName, - managerName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + const lro = new LroImpl( + sendOperation, + { storageAccountCredentialName, resourceGroupName, managerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -149,130 +304,108 @@ export class StorageAccountCredentials { * @param storageAccountCredentialName The name of the storage account credential. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(storageAccountCredentialName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - storageAccountCredentialName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + storageAccountCredentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + storageAccountCredentialName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByManagerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByManagerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.StorageAccountCredentialList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{storageAccountCredentialName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.storageAccountCredentialName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.managerName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{storageAccountCredentialName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.StorageAccountCredential - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{storageAccountCredentialName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.storageAccountCredentialName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.storageAccountCredentialName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.StorageAccountCredential, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{storageAccountCredentialName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.StorageAccountCredential }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError + 201: { + bodyMapper: Mappers.StorageAccountCredential + }, + 202: { + bodyMapper: Mappers.StorageAccountCredential + }, + 204: { + bodyMapper: Mappers.StorageAccountCredential } }, + requestBody: Parameters.parameters22, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.storageAccountCredentialName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{storageAccountCredentialName}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{storageAccountCredentialName}", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.storageAccountCredentialName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.storageAccountCredentialName ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/volumeContainers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/volumeContainers.ts index a9feae317a84..1d069677315c 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/volumeContainers.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/volumeContainers.ts @@ -1,29 +1,46 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/volumeContainersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { VolumeContainers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + VolumeContainer, + VolumeContainersListByDeviceOptionalParams, + Metrics, + VolumeContainersListMetricsOptionalParams, + MetricDefinition, + VolumeContainersListMetricDefinitionOptionalParams, + VolumeContainersListByDeviceResponse, + VolumeContainersGetOptionalParams, + VolumeContainersGetResponse, + VolumeContainersCreateOrUpdateOptionalParams, + VolumeContainersCreateOrUpdateResponse, + VolumeContainersDeleteOptionalParams, + VolumeContainersListMetricsResponse, + VolumeContainersListMetricDefinitionResponse +} from "../models"; -/** Class representing a VolumeContainers. */ -export class VolumeContainers { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing VolumeContainers operations. */ +export class VolumeContainersImpl implements VolumeContainers { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a VolumeContainers. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class VolumeContainers class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -32,65 +49,263 @@ export class VolumeContainers { * @param deviceName The device name * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Gets the metrics for the specified volume container. * @param deviceName The device name + * @param volumeContainerName The volume container name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param filter OData Filter options + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - managerName, - options + public listMetrics( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: VolumeContainersListMetricsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricsPagingAll( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + filter, + options + ); + return { + next() { + return iter.next(); }, - listByDeviceOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricsPagingPage( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + filter, + options + ); + } + }; + } + + private async *listMetricsPagingPage( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: VolumeContainersListMetricsOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetrics( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + filter, + options + ); + yield result.value || []; + } + + private async *listMetricsPagingAll( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: VolumeContainersListMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricsPagingPage( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + filter, + options + )) { + yield* page; + } } /** - * Gets the properties of the specified volume container name. + * Gets the metric definitions for the specified volume container. * @param deviceName The device name - * @param volumeContainerName The name of the volume container. + * @param volumeContainerName The volume container name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + public listMetricDefinition( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricDefinitionPagingAll( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricDefinitionPagingPage( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricDefinitionPagingPage( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetricDefinition( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricDefinitionPagingAll( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricDefinitionPagingPage( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Gets all the volume containers in a device. * @param deviceName The device name - * @param volumeContainerName The name of the volume container. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersListByDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); + } + /** + * Gets the properties of the specified volume container name. * @param deviceName The device name * @param volumeContainerName The name of the volume container. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { deviceName, @@ -99,158 +314,259 @@ export class VolumeContainers { managerName, options }, - getOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** * Creates or updates the volume container. * @param deviceName The device name * @param volumeContainerName The name of the volume container. - * @param parameters The volume container to be added or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The volume container to be added or updated. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, volumeContainerName: string, parameters: Models.VolumeContainer, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,volumeContainerName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + parameters: VolumeContainer, + options?: VolumeContainersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VolumeContainersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + parameters, + options + }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Deletes the volume container. + * Creates or updates the volume container. * @param deviceName The device name * @param volumeContainerName The name of the volume container. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters The volume container to be added or updated. + * @param options The options parameters. */ - deleteMethod(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,volumeContainerName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateOrUpdateAndWait( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + parameters: VolumeContainer, + options?: VolumeContainersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Gets the metrics for the specified volume container. - * @param deviceName The device name - * @param volumeContainerName The volume container name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param filter OData Filter options - * @param [options] The optional parameters - * @returns Promise - */ - listMetrics(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, filter: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param volumeContainerName The volume container name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param filter OData Filter options - * @param callback The callback - */ - listMetrics(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, filter: string, callback: msRest.ServiceCallback): void; - /** + * Deletes the volume container. * @param deviceName The device name - * @param volumeContainerName The volume container name. + * @param volumeContainerName The name of the volume container. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param filter OData Filter options - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listMetrics(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, filter: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetrics(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, filter: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginDelete( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, volumeContainerName, resourceGroupName, managerName, - filter, options }, - listMetricsOperationSpec, - callback) as Promise; + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Gets the metric definitions for the specified volume container. - * @param deviceName The device name - * @param volumeContainerName The volume container name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listMetricDefinition(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param volumeContainerName The volume container name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listMetricDefinition(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; - /** + * Deletes the volume container. * @param deviceName The device name - * @param volumeContainerName The volume container name. + * @param volumeContainerName The name of the volume container. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetricDefinition(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - volumeContainerName, - resourceGroupName, - managerName, - options - }, - listMetricDefinitionOperationSpec, - callback) as Promise; + async beginDeleteAndWait( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); } /** - * Creates or updates the volume container. + * Gets the metrics for the specified volume container. * @param deviceName The device name - * @param volumeContainerName The name of the volume container. - * @param parameters The volume container to be added or updated. + * @param volumeContainerName The volume container name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param filter OData Filter options + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, volumeContainerName: string, parameters: Models.VolumeContainer, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + private _listMetrics( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: VolumeContainersListMetricsOptionalParams + ): Promise { + return this.client.sendOperationRequest( { deviceName, volumeContainerName, - parameters, resourceGroupName, managerName, + filter, options }, - beginCreateOrUpdateOperationSpec, - options); + listMetricsOperationSpec + ); } /** - * Deletes the volume container. + * Gets the metric definitions for the specified volume container. * @param deviceName The device name - * @param volumeContainerName The name of the volume container. + * @param volumeContainerName The volume container name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + private _listMetricDefinition( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersListMetricDefinitionOptionalParams + ): Promise { + return this.client.sendOperationRequest( { deviceName, volumeContainerName, @@ -258,178 +574,141 @@ export class VolumeContainers { managerName, options }, - beginDeleteMethodOperationSpec, - options); + listMetricDefinitionOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.VolumeContainerList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.volumeContainerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.VolumeContainer - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/metrics", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.volumeContainerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.volumeContainerName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.MetricList + bodyMapper: Mappers.VolumeContainer + }, + 201: { + bodyMapper: Mappers.VolumeContainer }, - default: { - bodyMapper: Mappers.CloudError + 202: { + bodyMapper: Mappers.VolumeContainer + }, + 204: { + bodyMapper: Mappers.VolumeContainer } }, + requestBody: Parameters.parameters20, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, + Parameters.deviceName, + Parameters.volumeContainerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listMetricDefinitionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/metricsDefinitions", +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}", + httpMethod: "DELETE", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.volumeContainerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.volumeContainerName ], + serializer +}; +const listMetricsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/metrics", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.MetricDefinitionList - }, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.MetricList } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}", + queryParameters: [Parameters.apiVersion, Parameters.filter1], urlParameters: [ - Parameters.deviceName, - Parameters.volumeContainerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.volumeContainerName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.VolumeContainer, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listMetricDefinitionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/metricsDefinitions", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.VolumeContainer - }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.MetricDefinitionList } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.volumeContainerName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.volumeContainerName ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/volumes.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/volumes.ts index 7b2990997a07..b98a0c3cbe0a 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/operations/volumes.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operations/volumes.ts @@ -1,29 +1,48 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/volumesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Volumes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorSimple8000SeriesManagementClientContext } from "../storSimple8000SeriesManagementClientContext"; +import { StorSimple8000SeriesManagementClient } from "../storSimple8000SeriesManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Volume, + VolumesListByVolumeContainerOptionalParams, + Metrics, + VolumesListMetricsOptionalParams, + MetricDefinition, + VolumesListMetricDefinitionOptionalParams, + VolumesListByDeviceOptionalParams, + VolumesListByVolumeContainerResponse, + VolumesGetOptionalParams, + VolumesGetResponse, + VolumesCreateOrUpdateOptionalParams, + VolumesCreateOrUpdateResponse, + VolumesDeleteOptionalParams, + VolumesListMetricsResponse, + VolumesListMetricDefinitionResponse, + VolumesListByDeviceResponse +} from "../models"; -/** Class representing a Volumes. */ -export class Volumes { - private readonly client: StorSimple8000SeriesManagementClientContext; +/// +/** Class containing Volumes operations. */ +export class VolumesImpl implements Volumes { + private readonly client: StorSimple8000SeriesManagementClient; /** - * Create a Volumes. - * @param {StorSimple8000SeriesManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Volumes class. + * @param client Reference to the service client */ - constructor(client: StorSimple8000SeriesManagementClientContext) { + constructor(client: StorSimple8000SeriesManagementClient) { this.client = client; } @@ -33,195 +52,548 @@ export class Volumes { * @param volumeContainerName The volume container name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByVolumeContainer(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param volumeContainerName The volume container name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param callback The callback - */ - listByVolumeContainer(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listByVolumeContainer( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListByVolumeContainerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByVolumeContainerPagingAll( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByVolumeContainerPagingPage( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByVolumeContainerPagingPage( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListByVolumeContainerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByVolumeContainer( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByVolumeContainerPagingAll( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListByVolumeContainerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByVolumeContainerPagingPage( + deviceName, + volumeContainerName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Gets the metrics for the specified volume. * @param deviceName The device name * @param volumeContainerName The volume container name. + * @param volumeName The volume name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param filter OData Filter options + * @param options The options parameters. */ - listByVolumeContainer(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByVolumeContainer(deviceName: string, volumeContainerName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - volumeContainerName, - resourceGroupName, - managerName, - options + public listMetrics( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: VolumesListMetricsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricsPagingAll( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + filter, + options + ); + return { + next() { + return iter.next(); }, - listByVolumeContainerOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricsPagingPage( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + filter, + options + ); + } + }; + } + + private async *listMetricsPagingPage( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: VolumesListMetricsOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetrics( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + filter, + options + ); + yield result.value || []; + } + + private async *listMetricsPagingAll( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: VolumesListMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricsPagingPage( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + filter, + options + )) { + yield* page; + } } /** - * Returns the properties of the specified volume name. + * Gets the metric definitions for the specified volume. * @param deviceName The device name * @param volumeContainerName The volume container name. * @param volumeName The volume name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; + public listMetricDefinition( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMetricDefinitionPagingAll( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMetricDefinitionPagingPage( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listMetricDefinitionPagingPage( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + let result = await this._listMetricDefinition( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listMetricDefinitionPagingAll( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListMetricDefinitionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMetricDefinitionPagingPage( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves all the volumes in a device. * @param deviceName The device name - * @param volumeContainerName The volume container name. - * @param volumeName The volume name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + public listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListByDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevicePagingAll( + deviceName, + resourceGroupName, + managerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + ); + } + }; + } + + private async *listByDevicePagingPage( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListByDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevice( + deviceName, + resourceGroupName, + managerName, + options + ); + yield result.value || []; + } + + private async *listByDevicePagingAll( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListByDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevicePagingPage( + deviceName, + resourceGroupName, + managerName, + options + )) { + yield* page; + } + } + /** + * Retrieves all the volumes in a volume container. * @param deviceName The device name * @param volumeContainerName The volume container name. - * @param volumeName The volume name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByVolumeContainer( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListByVolumeContainerOptionalParams + ): Promise { return this.client.sendOperationRequest( { deviceName, volumeContainerName, - volumeName, resourceGroupName, managerName, options }, - getOperationSpec, - callback) as Promise; + listByVolumeContainerOperationSpec + ); } /** - * Creates or updates the volume. + * Returns the properties of the specified volume name. * @param deviceName The device name * @param volumeContainerName The volume container name. * @param volumeName The volume name. - * @param parameters Volume to be created or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(deviceName: string, volumeContainerName: string, volumeName: string, parameters: Models.Volume, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,volumeContainerName,volumeName,parameters,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + get( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + options + }, + getOperationSpec + ); } /** - * Deletes the volume. + * Creates or updates the volume. * @param deviceName The device name * @param volumeContainerName The volume container name. * @param volumeName The volume name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param parameters Volume to be created or updated. + * @param options The options parameters. */ - deleteMethod(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,volumeContainerName,volumeName,resourceGroupName,managerName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginCreateOrUpdate( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + parameters: Volume, + options?: VolumesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VolumesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Gets the metrics for the specified volume. - * @param deviceName The device name - * @param volumeContainerName The volume container name. - * @param volumeName The volume name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param filter OData Filter options - * @param [options] The optional parameters - * @returns Promise - */ - listMetrics(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, filter: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name - * @param volumeContainerName The volume container name. - * @param volumeName The volume name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param filter OData Filter options - * @param callback The callback - */ - listMetrics(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, filter: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name - * @param volumeContainerName The volume container name. - * @param volumeName The volume name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param filter OData Filter options - * @param options The optional parameters - * @param callback The callback - */ - listMetrics(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, filter: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetrics(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, filter: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + const lro = new LroImpl( + sendOperation, { deviceName, volumeContainerName, volumeName, resourceGroupName, managerName, - filter, + parameters, options }, - listMetricsOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Gets the metric definitions for the specified volume. - * @param deviceName The device name - * @param volumeContainerName The volume container name. - * @param volumeName The volume name. - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listMetricDefinition(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Creates or updates the volume. * @param deviceName The device name * @param volumeContainerName The volume container name. * @param volumeName The volume name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param parameters Volume to be created or updated. + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginCreateOrUpdateAndWait( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + parameters: Volume, + options?: VolumesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** + * Deletes the volume. * @param deviceName The device name * @param volumeContainerName The volume container name. * @param volumeName The volume name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listMetricDefinition(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listMetricDefinition(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginDelete( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, volumeContainerName, @@ -230,296 +602,281 @@ export class Volumes { managerName, options }, - listMetricDefinitionOperationSpec, - callback) as Promise; + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Retrieves all the volumes in a device. - * @param deviceName The device name - * @param resourceGroupName The resource group name - * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Deletes the volume. * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param volumeName The volume name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param callback The callback + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: msRest.ServiceCallback): void; + async beginDeleteAndWait( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + volumeContainerName, + volumeName, + resourceGroupName, + managerName, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets the metrics for the specified volume. * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param volumeName The volume name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param options The optional parameters - * @param callback The callback + * @param filter OData Filter options + * @param options The options parameters. */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listMetrics( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: VolumesListMetricsOptionalParams + ): Promise { return this.client.sendOperationRequest( { deviceName, + volumeContainerName, + volumeName, resourceGroupName, managerName, + filter, options }, - listByDeviceOperationSpec, - callback) as Promise; + listMetricsOperationSpec + ); } /** - * Creates or updates the volume. + * Gets the metric definitions for the specified volume. * @param deviceName The device name * @param volumeContainerName The volume container name. * @param volumeName The volume name. - * @param parameters Volume to be created or updated. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, volumeContainerName: string, volumeName: string, parameters: Models.Volume, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + private _listMetricDefinition( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListMetricDefinitionOptionalParams + ): Promise { + return this.client.sendOperationRequest( { deviceName, volumeContainerName, volumeName, - parameters, resourceGroupName, managerName, options }, - beginCreateOrUpdateOperationSpec, - options); + listMetricDefinitionOperationSpec + ); } /** - * Deletes the volume. + * Retrieves all the volumes in a device. * @param deviceName The device name - * @param volumeContainerName The volume container name. - * @param volumeName The volume name. * @param resourceGroupName The resource group name * @param managerName The manager name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, volumeContainerName: string, volumeName: string, resourceGroupName: string, managerName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - volumeContainerName, - volumeName, - resourceGroupName, - managerName, - options - }, - beginDeleteMethodOperationSpec, - options); + private _listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListByDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, managerName, options }, + listByDeviceOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByVolumeContainerOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByVolumeContainerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes", - urlParameters: [ - Parameters.deviceName, - Parameters.volumeContainerName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.VolumeList - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.volumeContainerName, - Parameters.volumeName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.volumeContainerName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Volume - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}/metrics", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.volumeContainerName, - Parameters.volumeName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.volumeContainerName, + Parameters.volumeName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.MetricList + bodyMapper: Mappers.Volume + }, + 201: { + bodyMapper: Mappers.Volume + }, + 202: { + bodyMapper: Mappers.Volume }, - default: { - bodyMapper: Mappers.CloudError + 204: { + bodyMapper: Mappers.Volume } }, - serializer -}; - -const listMetricDefinitionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}/metricsDefinitions", + requestBody: Parameters.parameters21, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.managerName, Parameters.deviceName, Parameters.volumeContainerName, - Parameters.volumeName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}", + httpMethod: "DELETE", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.volumeContainerName, + Parameters.volumeName ], + serializer +}; +const listMetricsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}/metrics", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.MetricDefinitionList - }, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.MetricList } }, - serializer -}; - -const listByDeviceOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumes", + queryParameters: [Parameters.apiVersion, Parameters.filter1], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.volumeContainerName, + Parameters.volumeName ], + headerParameters: [Parameters.accept], + serializer +}; +const listMetricDefinitionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}/metricsDefinitions", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.VolumeList - }, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.MetricDefinitionList } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.volumeContainerName, - Parameters.volumeName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.managerName, + Parameters.deviceName, + Parameters.volumeContainerName, + Parameters.volumeName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Volume, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listByDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumes", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Volume - }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.VolumeList } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.volumeContainerName, - Parameters.volumeName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.managerName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.managerName, + Parameters.deviceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/accessControlRecords.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/accessControlRecords.ts new file mode 100644 index 000000000000..92e6510b0927 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/accessControlRecords.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + AccessControlRecord, + AccessControlRecordsListByManagerOptionalParams, + AccessControlRecordsGetOptionalParams, + AccessControlRecordsGetResponse, + AccessControlRecordsCreateOrUpdateOptionalParams, + AccessControlRecordsCreateOrUpdateResponse, + AccessControlRecordsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a AccessControlRecords. */ +export interface AccessControlRecords { + /** + * Retrieves all the access control records in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified access control record name. + * @param accessControlRecordName Name of access control record to be fetched. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsGetOptionalParams + ): Promise; + /** + * Creates or Updates an access control record. + * @param accessControlRecordName The name of the access control record. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The access control record to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdate( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + parameters: AccessControlRecord, + options?: AccessControlRecordsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccessControlRecordsCreateOrUpdateResponse + > + >; + /** + * Creates or Updates an access control record. + * @param accessControlRecordName The name of the access control record. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The access control record to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + parameters: AccessControlRecord, + options?: AccessControlRecordsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the access control record. + * @param accessControlRecordName The name of the access control record to delete. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the access control record. + * @param accessControlRecordName The name of the access control record to delete. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + accessControlRecordName: string, + resourceGroupName: string, + managerName: string, + options?: AccessControlRecordsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/alerts.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/alerts.ts new file mode 100644 index 000000000000..a70e19f1dbdc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/alerts.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Alert, + AlertsListByManagerOptionalParams, + ClearAlertRequest, + AlertsClearOptionalParams, + SendTestAlertEmailRequest, + AlertsSendTestEmailOptionalParams +} from "../models"; + +/// +/** Interface representing a Alerts. */ +export interface Alerts { + /** + * Retrieves all the alerts in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: AlertsListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Clear the alerts. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The clear alert request. + * @param options The options parameters. + */ + clear( + resourceGroupName: string, + managerName: string, + parameters: ClearAlertRequest, + options?: AlertsClearOptionalParams + ): Promise; + /** + * Sends a test alert email. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The send test alert email request. + * @param options The options parameters. + */ + sendTestEmail( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: SendTestAlertEmailRequest, + options?: AlertsSendTestEmailOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backupPolicies.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backupPolicies.ts new file mode 100644 index 000000000000..7f876fddb391 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backupPolicies.ts @@ -0,0 +1,156 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + BackupPolicy, + BackupPoliciesListByDeviceOptionalParams, + BackupPoliciesGetOptionalParams, + BackupPoliciesGetResponse, + BackupPoliciesCreateOrUpdateOptionalParams, + BackupPoliciesCreateOrUpdateResponse, + BackupPoliciesDeleteOptionalParams, + BackupPoliciesBackupNowOptionalParams +} from "../models"; + +/// +/** Interface representing a BackupPolicies. */ +export interface BackupPolicies { + /** + * Gets all the backup policies in a device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified backup policy name. + * @param deviceName The device name + * @param backupPolicyName The name of backup policy to be fetched. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesGetOptionalParams + ): Promise; + /** + * Creates or updates the backup policy. + * @param deviceName The device name + * @param backupPolicyName The name of the backup policy to be created/updated. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The backup policy. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + parameters: BackupPolicy, + options?: BackupPoliciesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + BackupPoliciesCreateOrUpdateResponse + > + >; + /** + * Creates or updates the backup policy. + * @param deviceName The device name + * @param backupPolicyName The name of the backup policy to be created/updated. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The backup policy. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + parameters: BackupPolicy, + options?: BackupPoliciesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the backup policy. + * @param deviceName The device name + * @param backupPolicyName The name of the backup policy. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the backup policy. + * @param deviceName The device name + * @param backupPolicyName The name of the backup policy. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesDeleteOptionalParams + ): Promise; + /** + * Backup the backup policy now. + * @param deviceName The device name + * @param backupPolicyName The backup policy name. + * @param backupType The backup Type. This can be cloudSnapshot or localSnapshot. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginBackupNow( + deviceName: string, + backupPolicyName: string, + backupType: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesBackupNowOptionalParams + ): Promise, void>>; + /** + * Backup the backup policy now. + * @param deviceName The device name + * @param backupPolicyName The backup policy name. + * @param backupType The backup Type. This can be cloudSnapshot or localSnapshot. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginBackupNowAndWait( + deviceName: string, + backupPolicyName: string, + backupType: string, + resourceGroupName: string, + managerName: string, + options?: BackupPoliciesBackupNowOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backupSchedules.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backupSchedules.ts new file mode 100644 index 000000000000..f63d17df3b33 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backupSchedules.ts @@ -0,0 +1,133 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + BackupSchedule, + BackupSchedulesListByBackupPolicyOptionalParams, + BackupSchedulesGetOptionalParams, + BackupSchedulesGetResponse, + BackupSchedulesCreateOrUpdateOptionalParams, + BackupSchedulesCreateOrUpdateResponse, + BackupSchedulesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a BackupSchedules. */ +export interface BackupSchedules { + /** + * Gets all the backup schedules in a backup policy. + * @param deviceName The device name + * @param backupPolicyName The backup policy name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByBackupPolicy( + deviceName: string, + backupPolicyName: string, + resourceGroupName: string, + managerName: string, + options?: BackupSchedulesListByBackupPolicyOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified backup schedule name. + * @param deviceName The device name + * @param backupPolicyName The backup policy name. + * @param backupScheduleName The name of the backup schedule to be fetched + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + backupPolicyName: string, + backupScheduleName: string, + resourceGroupName: string, + managerName: string, + options?: BackupSchedulesGetOptionalParams + ): Promise; + /** + * Creates or updates the backup schedule. + * @param deviceName The device name + * @param backupPolicyName The backup policy name. + * @param backupScheduleName The backup schedule name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The backup schedule. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + backupPolicyName: string, + backupScheduleName: string, + resourceGroupName: string, + managerName: string, + parameters: BackupSchedule, + options?: BackupSchedulesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + BackupSchedulesCreateOrUpdateResponse + > + >; + /** + * Creates or updates the backup schedule. + * @param deviceName The device name + * @param backupPolicyName The backup policy name. + * @param backupScheduleName The backup schedule name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The backup schedule. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + backupPolicyName: string, + backupScheduleName: string, + resourceGroupName: string, + managerName: string, + parameters: BackupSchedule, + options?: BackupSchedulesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the backup schedule. + * @param deviceName The device name + * @param backupPolicyName The backup policy name. + * @param backupScheduleName The name the backup schedule. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + backupPolicyName: string, + backupScheduleName: string, + resourceGroupName: string, + managerName: string, + options?: BackupSchedulesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the backup schedule. + * @param deviceName The device name + * @param backupPolicyName The backup policy name. + * @param backupScheduleName The name the backup schedule. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + backupPolicyName: string, + backupScheduleName: string, + resourceGroupName: string, + managerName: string, + options?: BackupSchedulesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backups.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backups.ts new file mode 100644 index 000000000000..fdc31e72a259 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/backups.ts @@ -0,0 +1,134 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Backup, + BackupsListByDeviceOptionalParams, + BackupsDeleteOptionalParams, + CloneRequest, + BackupsCloneOptionalParams, + BackupsRestoreOptionalParams +} from "../models"; + +/// +/** Interface representing a Backups. */ +export interface Backups { + /** + * Retrieves all the backups in a device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Deletes the backup. + * @param deviceName The device name + * @param backupName The backup name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the backup. + * @param deviceName The device name + * @param backupName The backup name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsDeleteOptionalParams + ): Promise; + /** + * Clones the backup element as a new volume. + * @param deviceName The device name + * @param backupName The backup name. + * @param backupElementName The backup element name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The clone request object. + * @param options The options parameters. + */ + beginClone( + deviceName: string, + backupName: string, + backupElementName: string, + resourceGroupName: string, + managerName: string, + parameters: CloneRequest, + options?: BackupsCloneOptionalParams + ): Promise, void>>; + /** + * Clones the backup element as a new volume. + * @param deviceName The device name + * @param backupName The backup name. + * @param backupElementName The backup element name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The clone request object. + * @param options The options parameters. + */ + beginCloneAndWait( + deviceName: string, + backupName: string, + backupElementName: string, + resourceGroupName: string, + managerName: string, + parameters: CloneRequest, + options?: BackupsCloneOptionalParams + ): Promise; + /** + * Restores the backup on the device. + * @param deviceName The device name + * @param backupName The backupSet name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginRestore( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsRestoreOptionalParams + ): Promise, void>>; + /** + * Restores the backup on the device. + * @param deviceName The device name + * @param backupName The backupSet name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginRestoreAndWait( + deviceName: string, + backupName: string, + resourceGroupName: string, + managerName: string, + options?: BackupsRestoreOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/bandwidthSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/bandwidthSettings.ts new file mode 100644 index 000000000000..b0a8dfbb3ee2 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/bandwidthSettings.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + BandwidthSetting, + BandwidthSettingsListByManagerOptionalParams, + BandwidthSettingsGetOptionalParams, + BandwidthSettingsGetResponse, + BandwidthSettingsCreateOrUpdateOptionalParams, + BandwidthSettingsCreateOrUpdateResponse, + BandwidthSettingsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a BandwidthSettings. */ +export interface BandwidthSettings { + /** + * Retrieves all the bandwidth setting in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: BandwidthSettingsListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified bandwidth setting name. + * @param bandwidthSettingName The name of bandwidth setting to be fetched. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + bandwidthSettingName: string, + resourceGroupName: string, + managerName: string, + options?: BandwidthSettingsGetOptionalParams + ): Promise; + /** + * Creates or updates the bandwidth setting + * @param bandwidthSettingName The bandwidth setting name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The bandwidth setting to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdate( + bandwidthSettingName: string, + resourceGroupName: string, + managerName: string, + parameters: BandwidthSetting, + options?: BandwidthSettingsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + BandwidthSettingsCreateOrUpdateResponse + > + >; + /** + * Creates or updates the bandwidth setting + * @param bandwidthSettingName The bandwidth setting name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The bandwidth setting to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + bandwidthSettingName: string, + resourceGroupName: string, + managerName: string, + parameters: BandwidthSetting, + options?: BandwidthSettingsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the bandwidth setting + * @param bandwidthSettingName The name of the bandwidth setting. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + bandwidthSettingName: string, + resourceGroupName: string, + managerName: string, + options?: BandwidthSettingsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the bandwidth setting + * @param bandwidthSettingName The name of the bandwidth setting. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + bandwidthSettingName: string, + resourceGroupName: string, + managerName: string, + options?: BandwidthSettingsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/cloudAppliances.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/cloudAppliances.ts new file mode 100644 index 000000000000..6c94fc73d14a --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/cloudAppliances.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + CloudApplianceConfiguration, + CloudAppliancesListSupportedConfigurationsOptionalParams, + CloudAppliance, + CloudAppliancesProvisionOptionalParams +} from "../models"; + +/// +/** Interface representing a CloudAppliances. */ +export interface CloudAppliances { + /** + * Lists supported cloud appliance models and supported configurations. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listSupportedConfigurations( + resourceGroupName: string, + managerName: string, + options?: CloudAppliancesListSupportedConfigurationsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Provisions cloud appliance. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The cloud appliance + * @param options The options parameters. + */ + beginProvision( + resourceGroupName: string, + managerName: string, + parameters: CloudAppliance, + options?: CloudAppliancesProvisionOptionalParams + ): Promise, void>>; + /** + * Provisions cloud appliance. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The cloud appliance + * @param options The options parameters. + */ + beginProvisionAndWait( + resourceGroupName: string, + managerName: string, + parameters: CloudAppliance, + options?: CloudAppliancesProvisionOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/deviceSettings.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/deviceSettings.ts new file mode 100644 index 000000000000..565dcf6f8568 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/deviceSettings.ts @@ -0,0 +1,254 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + DeviceSettingsGetAlertSettingsOptionalParams, + DeviceSettingsGetAlertSettingsResponse, + AlertSettings, + DeviceSettingsCreateOrUpdateAlertSettingsOptionalParams, + DeviceSettingsCreateOrUpdateAlertSettingsResponse, + DeviceSettingsGetNetworkSettingsOptionalParams, + DeviceSettingsGetNetworkSettingsResponse, + NetworkSettingsPatch, + DeviceSettingsUpdateNetworkSettingsOptionalParams, + DeviceSettingsUpdateNetworkSettingsResponse, + DeviceSettingsGetSecuritySettingsOptionalParams, + DeviceSettingsGetSecuritySettingsResponse, + SecuritySettingsPatch, + DeviceSettingsUpdateSecuritySettingsOptionalParams, + DeviceSettingsUpdateSecuritySettingsResponse, + DeviceSettingsSyncRemotemanagementCertificateOptionalParams, + DeviceSettingsGetTimeSettingsOptionalParams, + DeviceSettingsGetTimeSettingsResponse, + TimeSettings, + DeviceSettingsCreateOrUpdateTimeSettingsOptionalParams, + DeviceSettingsCreateOrUpdateTimeSettingsResponse +} from "../models"; + +/** Interface representing a DeviceSettings. */ +export interface DeviceSettings { + /** + * Gets the alert settings of the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getAlertSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsGetAlertSettingsOptionalParams + ): Promise; + /** + * Creates or updates the alert settings of the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The alert settings to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAlertSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: AlertSettings, + options?: DeviceSettingsCreateOrUpdateAlertSettingsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeviceSettingsCreateOrUpdateAlertSettingsResponse + > + >; + /** + * Creates or updates the alert settings of the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The alert settings to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAlertSettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: AlertSettings, + options?: DeviceSettingsCreateOrUpdateAlertSettingsOptionalParams + ): Promise; + /** + * Gets the network settings of the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getNetworkSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsGetNetworkSettingsOptionalParams + ): Promise; + /** + * Updates the network settings on the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The network settings to be updated. + * @param options The options parameters. + */ + beginUpdateNetworkSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: NetworkSettingsPatch, + options?: DeviceSettingsUpdateNetworkSettingsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeviceSettingsUpdateNetworkSettingsResponse + > + >; + /** + * Updates the network settings on the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The network settings to be updated. + * @param options The options parameters. + */ + beginUpdateNetworkSettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: NetworkSettingsPatch, + options?: DeviceSettingsUpdateNetworkSettingsOptionalParams + ): Promise; + /** + * Returns the Security properties of the specified device name. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getSecuritySettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsGetSecuritySettingsOptionalParams + ): Promise; + /** + * Patch Security properties of the specified device name. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The security settings properties to be patched. + * @param options The options parameters. + */ + beginUpdateSecuritySettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: SecuritySettingsPatch, + options?: DeviceSettingsUpdateSecuritySettingsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeviceSettingsUpdateSecuritySettingsResponse + > + >; + /** + * Patch Security properties of the specified device name. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The security settings properties to be patched. + * @param options The options parameters. + */ + beginUpdateSecuritySettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: SecuritySettingsPatch, + options?: DeviceSettingsUpdateSecuritySettingsOptionalParams + ): Promise; + /** + * sync Remote management Certificate between appliance and Service + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginSyncRemotemanagementCertificate( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsSyncRemotemanagementCertificateOptionalParams + ): Promise, void>>; + /** + * sync Remote management Certificate between appliance and Service + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginSyncRemotemanagementCertificateAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsSyncRemotemanagementCertificateOptionalParams + ): Promise; + /** + * Gets the time settings of the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getTimeSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DeviceSettingsGetTimeSettingsOptionalParams + ): Promise; + /** + * Creates or updates the time settings of the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The time settings to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateTimeSettings( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: TimeSettings, + options?: DeviceSettingsCreateOrUpdateTimeSettingsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeviceSettingsCreateOrUpdateTimeSettingsResponse + > + >; + /** + * Creates or updates the time settings of the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The time settings to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateTimeSettingsAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: TimeSettings, + options?: DeviceSettingsCreateOrUpdateTimeSettingsOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/devices.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/devices.ts new file mode 100644 index 000000000000..44b527dac7ec --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/devices.ts @@ -0,0 +1,331 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Device, + DevicesListByManagerOptionalParams, + FailoverSet, + DevicesListFailoverSetsOptionalParams, + Metrics, + DevicesListMetricsOptionalParams, + MetricDefinition, + DevicesListMetricDefinitionOptionalParams, + FailoverTarget, + ListFailoverTargetsRequest, + DevicesListFailoverTargetsOptionalParams, + ConfigureDeviceRequest, + DevicesConfigureOptionalParams, + DevicesGetOptionalParams, + DevicesGetResponse, + DevicesDeleteOptionalParams, + DevicePatch, + DevicesUpdateOptionalParams, + DevicesUpdateResponse, + DevicesAuthorizeForServiceEncryptionKeyRolloverOptionalParams, + DevicesDeactivateOptionalParams, + DevicesInstallUpdatesOptionalParams, + DevicesScanForUpdatesOptionalParams, + DevicesGetUpdateSummaryOptionalParams, + DevicesGetUpdateSummaryResponse, + FailoverRequest, + DevicesFailoverOptionalParams +} from "../models"; + +/// +/** Interface representing a Devices. */ +export interface Devices { + /** + * Returns the list of devices for the specified manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: DevicesListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns all failover sets for a given device and their eligibility for participating in a failover. + * A failover set refers to a set of volume containers that need to be failed-over as a single unit to + * maintain data integrity. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listFailoverSets( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListFailoverSetsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the metrics for the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param filter OData Filter options + * @param options The options parameters. + */ + listMetrics( + deviceName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: DevicesListMetricsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the metric definitions for the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetricDefinition( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Given a list of volume containers to be failed over from a source device, this method returns the + * eligibility result, as a failover target, for all devices under that resource. + * @param sourceDeviceName The source device name on which failover is performed. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters ListFailoverTargetsRequest containing the list of volume containers to be failed + * over. + * @param options The options parameters. + */ + listFailoverTargets( + sourceDeviceName: string, + resourceGroupName: string, + managerName: string, + parameters: ListFailoverTargetsRequest, + options?: DevicesListFailoverTargetsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Complete minimal setup before using the device. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The minimal properties to configure a device. + * @param options The options parameters. + */ + beginConfigure( + resourceGroupName: string, + managerName: string, + parameters: ConfigureDeviceRequest, + options?: DevicesConfigureOptionalParams + ): Promise, void>>; + /** + * Complete minimal setup before using the device. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The minimal properties to configure a device. + * @param options The options parameters. + */ + beginConfigureAndWait( + resourceGroupName: string, + managerName: string, + parameters: ConfigureDeviceRequest, + options?: DevicesConfigureOptionalParams + ): Promise; + /** + * Returns the properties of the specified device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetOptionalParams + ): Promise; + /** + * Deletes the device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeleteOptionalParams + ): Promise; + /** + * Patches the device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters Patch representation of the device. + * @param options The options parameters. + */ + update( + deviceName: string, + resourceGroupName: string, + managerName: string, + parameters: DevicePatch, + options?: DevicesUpdateOptionalParams + ): Promise; + /** + * Authorizes the specified device for service data encryption key rollover. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + authorizeForServiceEncryptionKeyRollover( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesAuthorizeForServiceEncryptionKeyRolloverOptionalParams + ): Promise; + /** + * Deactivates the device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeactivate( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeactivateOptionalParams + ): Promise, void>>; + /** + * Deactivates the device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeactivateAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesDeactivateOptionalParams + ): Promise; + /** + * Downloads and installs the updates on the device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginInstallUpdates( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise, void>>; + /** + * Downloads and installs the updates on the device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginInstallUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise; + /** + * Scans for updates on the device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginScanForUpdates( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise, void>>; + /** + * Scans for updates on the device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginScanForUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise; + /** + * Returns the update summary of the specified device name. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getUpdateSummary( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: DevicesGetUpdateSummaryOptionalParams + ): Promise; + /** + * Failovers a set of volume containers from a specified source device to a target device. + * @param sourceDeviceName The source device name on which failover is performed. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters FailoverRequest containing the source device and the list of volume containers to + * be failed over. + * @param options The options parameters. + */ + beginFailover( + sourceDeviceName: string, + resourceGroupName: string, + managerName: string, + parameters: FailoverRequest, + options?: DevicesFailoverOptionalParams + ): Promise, void>>; + /** + * Failovers a set of volume containers from a specified source device to a target device. + * @param sourceDeviceName The source device name on which failover is performed. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters FailoverRequest containing the source device and the list of volume containers to + * be failed over. + * @param options The options parameters. + */ + beginFailoverAndWait( + sourceDeviceName: string, + resourceGroupName: string, + managerName: string, + parameters: FailoverRequest, + options?: DevicesFailoverOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/hardwareComponentGroups.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/hardwareComponentGroups.ts new file mode 100644 index 000000000000..612502336947 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/hardwareComponentGroups.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + HardwareComponentGroup, + HardwareComponentGroupsListByDeviceOptionalParams, + ControllerPowerStateChangeRequest, + HardwareComponentGroupsChangeControllerPowerStateOptionalParams +} from "../models"; + +/// +/** Interface representing a HardwareComponentGroups. */ +export interface HardwareComponentGroups { + /** + * Lists the hardware component groups at device-level. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: HardwareComponentGroupsListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Changes the power state of the controller. + * @param deviceName The device name + * @param hardwareComponentGroupName The hardware component group name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The controller power state change request. + * @param options The options parameters. + */ + beginChangeControllerPowerState( + deviceName: string, + hardwareComponentGroupName: string, + resourceGroupName: string, + managerName: string, + parameters: ControllerPowerStateChangeRequest, + options?: HardwareComponentGroupsChangeControllerPowerStateOptionalParams + ): Promise, void>>; + /** + * Changes the power state of the controller. + * @param deviceName The device name + * @param hardwareComponentGroupName The hardware component group name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The controller power state change request. + * @param options The options parameters. + */ + beginChangeControllerPowerStateAndWait( + deviceName: string, + hardwareComponentGroupName: string, + resourceGroupName: string, + managerName: string, + parameters: ControllerPowerStateChangeRequest, + options?: HardwareComponentGroupsChangeControllerPowerStateOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/index.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..1b7af3405d3b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/index.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./managers"; +export * from "./accessControlRecords"; +export * from "./alerts"; +export * from "./bandwidthSettings"; +export * from "./cloudAppliances"; +export * from "./devices"; +export * from "./deviceSettings"; +export * from "./backupPolicies"; +export * from "./backupSchedules"; +export * from "./backups"; +export * from "./hardwareComponentGroups"; +export * from "./jobs"; +export * from "./volumeContainers"; +export * from "./volumes"; +export * from "./storageAccountCredentials"; diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/jobs.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/jobs.ts new file mode 100644 index 000000000000..16476d970633 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/jobs.ts @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Job, + JobsListByDeviceOptionalParams, + JobsListByManagerOptionalParams, + JobsGetOptionalParams, + JobsGetResponse, + JobsCancelOptionalParams +} from "../models"; + +/// +/** Interface representing a Jobs. */ +export interface Jobs { + /** + * Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs + * is returned. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: JobsListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of + * jobs is returned. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: JobsListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the details of the specified job name. + * @param deviceName The device name + * @param jobName The job Name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + jobName: string, + resourceGroupName: string, + managerName: string, + options?: JobsGetOptionalParams + ): Promise; + /** + * Cancels a job on the device. + * @param deviceName The device name + * @param jobName The jobName. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginCancel( + deviceName: string, + jobName: string, + resourceGroupName: string, + managerName: string, + options?: JobsCancelOptionalParams + ): Promise, void>>; + /** + * Cancels a job on the device. + * @param deviceName The device name + * @param jobName The jobName. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginCancelAndWait( + deviceName: string, + jobName: string, + resourceGroupName: string, + managerName: string, + options?: JobsCancelOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/managers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/managers.ts new file mode 100644 index 000000000000..0e1954bffbfc --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/managers.ts @@ -0,0 +1,257 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Manager, + ManagersListOptionalParams, + ManagersListByResourceGroupOptionalParams, + Feature, + ManagersListFeatureSupportStatusOptionalParams, + Metrics, + ManagersListMetricsOptionalParams, + MetricDefinition, + ManagersListMetricDefinitionOptionalParams, + ManagersGetOptionalParams, + ManagersGetResponse, + ManagersCreateOrUpdateOptionalParams, + ManagersCreateOrUpdateResponse, + ManagersDeleteOptionalParams, + ManagerPatch, + ManagersUpdateOptionalParams, + ManagersUpdateResponse, + ManagersGetDevicePublicEncryptionKeyOptionalParams, + ManagersGetDevicePublicEncryptionKeyResponse, + ManagersGetEncryptionSettingsOptionalParams, + ManagersGetEncryptionSettingsResponse, + ManagersGetExtendedInfoOptionalParams, + ManagersGetExtendedInfoResponse, + ManagerExtendedInfo, + ManagersCreateExtendedInfoOptionalParams, + ManagersCreateExtendedInfoResponse, + ManagersDeleteExtendedInfoOptionalParams, + ManagersUpdateExtendedInfoOptionalParams, + ManagersUpdateExtendedInfoResponse, + ManagersGetActivationKeyOptionalParams, + ManagersGetActivationKeyResponse, + ManagersGetPublicEncryptionKeyOptionalParams, + ManagersGetPublicEncryptionKeyResponse, + ManagersRegenerateActivationKeyOptionalParams, + ManagersRegenerateActivationKeyResponse +} from "../models"; + +/// +/** Interface representing a Managers. */ +export interface Managers { + /** + * Retrieves all the managers in a subscription. + * @param options The options parameters. + */ + list( + options?: ManagersListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves all the managers in a resource group. + * @param resourceGroupName The resource group name + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ManagersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the features and their support status + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listFeatureSupportStatus( + resourceGroupName: string, + managerName: string, + options?: ManagersListFeatureSupportStatusOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the metrics for the specified manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param filter OData Filter options + * @param options The options parameters. + */ + listMetrics( + resourceGroupName: string, + managerName: string, + filter: string, + options?: ManagersListMetricsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the metric definitions for the specified manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetricDefinition( + resourceGroupName: string, + managerName: string, + options?: ManagersListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified manager name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + managerName: string, + options?: ManagersGetOptionalParams + ): Promise; + /** + * Creates or updates the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The manager. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + managerName: string, + parameters: Manager, + options?: ManagersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + managerName: string, + options?: ManagersDeleteOptionalParams + ): Promise; + /** + * Updates the StorSimple Manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The manager update parameters. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + managerName: string, + parameters: ManagerPatch, + options?: ManagersUpdateOptionalParams + ): Promise; + /** + * Returns the public encryption key of the device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getDevicePublicEncryptionKey( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: ManagersGetDevicePublicEncryptionKeyOptionalParams + ): Promise; + /** + * Returns the encryption settings of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getEncryptionSettings( + resourceGroupName: string, + managerName: string, + options?: ManagersGetEncryptionSettingsOptionalParams + ): Promise; + /** + * Returns the extended information of the specified manager name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getExtendedInfo( + resourceGroupName: string, + managerName: string, + options?: ManagersGetExtendedInfoOptionalParams + ): Promise; + /** + * Creates the extended info of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The manager extended information. + * @param options The options parameters. + */ + createExtendedInfo( + resourceGroupName: string, + managerName: string, + parameters: ManagerExtendedInfo, + options?: ManagersCreateExtendedInfoOptionalParams + ): Promise; + /** + * Deletes the extended info of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + deleteExtendedInfo( + resourceGroupName: string, + managerName: string, + options?: ManagersDeleteExtendedInfoOptionalParams + ): Promise; + /** + * Updates the extended info of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param ifMatch Pass the ETag of ExtendedInfo fetched from GET call + * @param parameters The manager extended information. + * @param options The options parameters. + */ + updateExtendedInfo( + resourceGroupName: string, + managerName: string, + ifMatch: string, + parameters: ManagerExtendedInfo, + options?: ManagersUpdateExtendedInfoOptionalParams + ): Promise; + /** + * Returns the activation key of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getActivationKey( + resourceGroupName: string, + managerName: string, + options?: ManagersGetActivationKeyOptionalParams + ): Promise; + /** + * Returns the symmetric encrypted public encryption key of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + getPublicEncryptionKey( + resourceGroupName: string, + managerName: string, + options?: ManagersGetPublicEncryptionKeyOptionalParams + ): Promise; + /** + * Re-generates and returns the activation key of the manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + regenerateActivationKey( + resourceGroupName: string, + managerName: string, + options?: ManagersRegenerateActivationKeyOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/operations.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..32c8fb594015 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/operations.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AvailableProviderOperation, + OperationsListOptionalParams +} from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available REST API operations of the Microsoft.StorSimple provider + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/storageAccountCredentials.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/storageAccountCredentials.ts new file mode 100644 index 000000000000..9d169487cbf8 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/storageAccountCredentials.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + StorageAccountCredential, + StorageAccountCredentialsListByManagerOptionalParams, + StorageAccountCredentialsGetOptionalParams, + StorageAccountCredentialsGetResponse, + StorageAccountCredentialsCreateOrUpdateOptionalParams, + StorageAccountCredentialsCreateOrUpdateResponse, + StorageAccountCredentialsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a StorageAccountCredentials. */ +export interface StorageAccountCredentials { + /** + * Gets all the storage account credentials in a manager. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByManager( + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsListByManagerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified storage account credential name. + * @param storageAccountCredentialName The name of storage account credential to be fetched. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + storageAccountCredentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsGetOptionalParams + ): Promise; + /** + * Creates or updates the storage account credential. + * @param storageAccountCredentialName The storage account credential name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The storage account credential to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdate( + storageAccountCredentialName: string, + resourceGroupName: string, + managerName: string, + parameters: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageAccountCredentialsCreateOrUpdateResponse + > + >; + /** + * Creates or updates the storage account credential. + * @param storageAccountCredentialName The storage account credential name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The storage account credential to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + storageAccountCredentialName: string, + resourceGroupName: string, + managerName: string, + parameters: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the storage account credential. + * @param storageAccountCredentialName The name of the storage account credential. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + storageAccountCredentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the storage account credential. + * @param storageAccountCredentialName The name of the storage account credential. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + storageAccountCredentialName: string, + resourceGroupName: string, + managerName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/volumeContainers.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/volumeContainers.ts new file mode 100644 index 000000000000..3d989e7584a0 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/volumeContainers.ts @@ -0,0 +1,157 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + VolumeContainer, + VolumeContainersListByDeviceOptionalParams, + Metrics, + VolumeContainersListMetricsOptionalParams, + MetricDefinition, + VolumeContainersListMetricDefinitionOptionalParams, + VolumeContainersGetOptionalParams, + VolumeContainersGetResponse, + VolumeContainersCreateOrUpdateOptionalParams, + VolumeContainersCreateOrUpdateResponse, + VolumeContainersDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a VolumeContainers. */ +export interface VolumeContainers { + /** + * Gets all the volume containers in a device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the metrics for the specified volume container. + * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param filter OData Filter options + * @param options The options parameters. + */ + listMetrics( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: VolumeContainersListMetricsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the metric definitions for the specified volume container. + * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetricDefinition( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified volume container name. + * @param deviceName The device name + * @param volumeContainerName The name of the volume container. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersGetOptionalParams + ): Promise; + /** + * Creates or updates the volume container. + * @param deviceName The device name + * @param volumeContainerName The name of the volume container. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The volume container to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + parameters: VolumeContainer, + options?: VolumeContainersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VolumeContainersCreateOrUpdateResponse + > + >; + /** + * Creates or updates the volume container. + * @param deviceName The device name + * @param volumeContainerName The name of the volume container. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters The volume container to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + parameters: VolumeContainer, + options?: VolumeContainersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the volume container. + * @param deviceName The device name + * @param volumeContainerName The name of the volume container. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the volume container. + * @param deviceName The device name + * @param volumeContainerName The name of the volume container. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumeContainersDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/volumes.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/volumes.ts new file mode 100644 index 000000000000..30f5910aabc4 --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/operationsInterfaces/volumes.ts @@ -0,0 +1,187 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Volume, + VolumesListByVolumeContainerOptionalParams, + Metrics, + VolumesListMetricsOptionalParams, + MetricDefinition, + VolumesListMetricDefinitionOptionalParams, + VolumesListByDeviceOptionalParams, + VolumesGetOptionalParams, + VolumesGetResponse, + VolumesCreateOrUpdateOptionalParams, + VolumesCreateOrUpdateResponse, + VolumesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Volumes. */ +export interface Volumes { + /** + * Retrieves all the volumes in a volume container. + * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByVolumeContainer( + deviceName: string, + volumeContainerName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListByVolumeContainerOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the metrics for the specified volume. + * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param volumeName The volume name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param filter OData Filter options + * @param options The options parameters. + */ + listMetrics( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + filter: string, + options?: VolumesListMetricsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the metric definitions for the specified volume. + * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param volumeName The volume name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listMetricDefinition( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListMetricDefinitionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves all the volumes in a device. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + listByDevice( + deviceName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesListByDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of the specified volume name. + * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param volumeName The volume name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + get( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesGetOptionalParams + ): Promise; + /** + * Creates or updates the volume. + * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param volumeName The volume name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters Volume to be created or updated. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + parameters: Volume, + options?: VolumesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VolumesCreateOrUpdateResponse + > + >; + /** + * Creates or updates the volume. + * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param volumeName The volume name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param parameters Volume to be created or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + parameters: Volume, + options?: VolumesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the volume. + * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param volumeName The volume name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the volume. + * @param deviceName The device name + * @param volumeContainerName The volume container name. + * @param volumeName The volume name. + * @param resourceGroupName The resource group name + * @param managerName The manager name + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + volumeContainerName: string, + volumeName: string, + resourceGroupName: string, + managerName: string, + options?: VolumesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/storSimple8000SeriesManagementClient.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/storSimple8000SeriesManagementClient.ts index abe8192f1fff..b683df5af5ce 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/storSimple8000SeriesManagementClient.ts +++ b/sdk/storsimple8000series/arm-storsimple8000series/src/storSimple8000SeriesManagementClient.ts @@ -1,72 +1,139 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { StorSimple8000SeriesManagementClientContext } from "./storSimple8000SeriesManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + ManagersImpl, + AccessControlRecordsImpl, + AlertsImpl, + BandwidthSettingsImpl, + CloudAppliancesImpl, + DevicesImpl, + DeviceSettingsImpl, + BackupPoliciesImpl, + BackupSchedulesImpl, + BackupsImpl, + HardwareComponentGroupsImpl, + JobsImpl, + VolumeContainersImpl, + VolumesImpl, + StorageAccountCredentialsImpl +} from "./operations"; +import { + Operations, + Managers, + AccessControlRecords, + Alerts, + BandwidthSettings, + CloudAppliances, + Devices, + DeviceSettings, + BackupPolicies, + BackupSchedules, + Backups, + HardwareComponentGroups, + Jobs, + VolumeContainers, + Volumes, + StorageAccountCredentials +} from "./operationsInterfaces"; +import { StorSimple8000SeriesManagementClientOptionalParams } from "./models"; - -class StorSimple8000SeriesManagementClient extends StorSimple8000SeriesManagementClientContext { - // Operation groups - operations: operations.Operations; - managers: operations.Managers; - accessControlRecords: operations.AccessControlRecords; - alerts: operations.Alerts; - bandwidthSettings: operations.BandwidthSettings; - cloudAppliances: operations.CloudAppliances; - devices: operations.Devices; - deviceSettings: operations.DeviceSettings; - backupPolicies: operations.BackupPolicies; - backupSchedules: operations.BackupSchedules; - backups: operations.Backups; - hardwareComponentGroups: operations.HardwareComponentGroups; - jobs: operations.Jobs; - volumeContainers: operations.VolumeContainers; - volumes: operations.Volumes; - storageAccountCredentials: operations.StorageAccountCredentials; +export class StorSimple8000SeriesManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the StorSimple8000SeriesManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId The subscription id - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.StorSimple8000SeriesManagementClientOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.managers = new operations.Managers(this); - this.accessControlRecords = new operations.AccessControlRecords(this); - this.alerts = new operations.Alerts(this); - this.bandwidthSettings = new operations.BandwidthSettings(this); - this.cloudAppliances = new operations.CloudAppliances(this); - this.devices = new operations.Devices(this); - this.deviceSettings = new operations.DeviceSettings(this); - this.backupPolicies = new operations.BackupPolicies(this); - this.backupSchedules = new operations.BackupSchedules(this); - this.backups = new operations.Backups(this); - this.hardwareComponentGroups = new operations.HardwareComponentGroups(this); - this.jobs = new operations.Jobs(this); - this.volumeContainers = new operations.VolumeContainers(this); - this.volumes = new operations.Volumes(this); - this.storageAccountCredentials = new operations.StorageAccountCredentials(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: StorSimple8000SeriesManagementClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: StorSimple8000SeriesManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-storsimple8000series/2.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - StorSimple8000SeriesManagementClient, - StorSimple8000SeriesManagementClientContext, - Models as StorSimple8000SeriesManagementModels, - Mappers as StorSimple8000SeriesManagementMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2017-06-01"; + this.operations = new OperationsImpl(this); + this.managers = new ManagersImpl(this); + this.accessControlRecords = new AccessControlRecordsImpl(this); + this.alerts = new AlertsImpl(this); + this.bandwidthSettings = new BandwidthSettingsImpl(this); + this.cloudAppliances = new CloudAppliancesImpl(this); + this.devices = new DevicesImpl(this); + this.deviceSettings = new DeviceSettingsImpl(this); + this.backupPolicies = new BackupPoliciesImpl(this); + this.backupSchedules = new BackupSchedulesImpl(this); + this.backups = new BackupsImpl(this); + this.hardwareComponentGroups = new HardwareComponentGroupsImpl(this); + this.jobs = new JobsImpl(this); + this.volumeContainers = new VolumeContainersImpl(this); + this.volumes = new VolumesImpl(this); + this.storageAccountCredentials = new StorageAccountCredentialsImpl(this); + } + + operations: Operations; + managers: Managers; + accessControlRecords: AccessControlRecords; + alerts: Alerts; + bandwidthSettings: BandwidthSettings; + cloudAppliances: CloudAppliances; + devices: Devices; + deviceSettings: DeviceSettings; + backupPolicies: BackupPolicies; + backupSchedules: BackupSchedules; + backups: Backups; + hardwareComponentGroups: HardwareComponentGroups; + jobs: Jobs; + volumeContainers: VolumeContainers; + volumes: Volumes; + storageAccountCredentials: StorageAccountCredentials; +} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/src/storSimple8000SeriesManagementClientContext.ts b/sdk/storsimple8000series/arm-storsimple8000series/src/storSimple8000SeriesManagementClientContext.ts deleted file mode 100644 index 3839ad510595..000000000000 --- a/sdk/storsimple8000series/arm-storsimple8000series/src/storSimple8000SeriesManagementClientContext.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-storsimple8000series"; -const packageVersion = "0.1.0"; - -export class StorSimple8000SeriesManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - apiVersion?: string; - subscriptionId: string; - - /** - * Initializes a new instance of the StorSimple8000SeriesManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The subscription id - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.StorSimple8000SeriesManagementClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2017-06-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/storsimple8000series/arm-storsimple8000series/test/sampleTest.ts b/sdk/storsimple8000series/arm-storsimple8000series/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/storsimple8000series/arm-storsimple8000series/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/storsimple8000series/arm-storsimple8000series/tsconfig.json b/sdk/storsimple8000series/arm-storsimple8000series/tsconfig.json index 87bbf5b5fa49..4e447c33668f 100644 --- a/sdk/storsimple8000series/arm-storsimple8000series/tsconfig.json +++ b/sdk/storsimple8000series/arm-storsimple8000series/tsconfig.json @@ -3,17 +3,18 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", - "importHelpers": true + "outDir": "./dist-esm", + "importHelpers": true, + "paths": { "@azure/arm-storsimple8000series": ["./src/index"] } }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/storsimple8000series/ci.yml b/sdk/storsimple8000series/ci.yml new file mode 100644 index 000000000000..c733d58345d6 --- /dev/null +++ b/sdk/storsimple8000series/ci.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/storsimple8000series/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/storsimple8000series/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: storsimple8000series + Artifacts: + - name: azure-arm-storsimple8000series + safeName: azurearmstorsimple8000series + \ No newline at end of file diff --git a/sdk/support/arm-support/CHANGELOG.md b/sdk/support/arm-support/CHANGELOG.md new file mode 100644 index 000000000000..64b542e4bca0 --- /dev/null +++ b/sdk/support/arm-support/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-01-21) + +The package of @azure/arm-support is using our next generation design principles since version 2.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/support/arm-support/LICENSE b/sdk/support/arm-support/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/support/arm-support/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/support/arm-support/README.md b/sdk/support/arm-support/README.md index 098fd7677fa1..23a8e52be59f 100644 --- a/sdk/support/arm-support/README.md +++ b/sdk/support/arm-support/README.md @@ -1,99 +1,98 @@ -## Azure MicrosoftSupport SDK for JavaScript +# Azure Service client library for JavaScript -This package contains an isomorphic SDK for MicrosoftSupport. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +Microsoft Azure Support Resource Provider. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/support/arm-support) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-support) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-support) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-support` package -### How to Install +Install the Azure Service client library for JavaScript with `npm`: ```bash npm install @azure/arm-support ``` -### How to use +### Create and authenticate a `MicrosoftSupport` -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" +npm install @azure/identity ``` -##### Sample code - -```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { MicrosoftSupport, MicrosoftSupportModels, MicrosoftSupportMappers } from "@azure/arm-support"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new MicrosoftSupport(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new MicrosoftSupport(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). -```bash -npm install @azure/ms-rest-browserauth -``` +## Key concepts -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-support sample - - - - - - - - +### MicrosoftSupport + +`MicrosoftSupport` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fsupport%2Farm-support%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/support/arm-support/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/support/arm-support/_meta.json b/sdk/support/arm-support/_meta.json new file mode 100644 index 000000000000..cb546fdc7774 --- /dev/null +++ b/sdk/support/arm-support/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "readme": "specification/support/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/support/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1 --generate-sample=true", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" +} \ No newline at end of file diff --git a/sdk/support/arm-support/api-extractor.json b/sdk/support/arm-support/api-extractor.json new file mode 100644 index 000000000000..a53949664cec --- /dev/null +++ b/sdk/support/arm-support/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-support.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/support/arm-support/package.json b/sdk/support/arm-support/package.json index 275ea5195a21..7b9aa837a2fc 100644 --- a/sdk/support/arm-support/package.json +++ b/sdk/support/arm-support/package.json @@ -1,58 +1,103 @@ { "name": "@azure/arm-support", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "MicrosoftSupport Library with typescript type definitions for node.js and browser.", - "version": "1.0.0", + "description": "A generated SDK for MicrosoftSupport.", + "version": "2.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-support.js", - "module": "./esm/microsoftSupport.js", - "types": "./esm/microsoftSupport.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-support.d.ts", "devDependencies": { - "typescript": "^3.5.3", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/support/arm-support", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-support.js.map'\" -o ./dist/arm-support.min.js ./dist/arm-support.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, - "autoPublish": true + "//metadata": { + "constantPaths": [ + { "path": "src/MicrosoftSupport.ts", "prefix": "packageDetails" } + ] + }, + "autoPublish": true, + "//sampleConfiguration": { + "productName": "", + "productSlugs": ["azure"], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-support?view=azure-node-preview" + } } diff --git a/sdk/support/arm-support/recordings/node/my_test/recording_sample_test.js b/sdk/support/arm-support/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/support/arm-support/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/support/arm-support/review/arm-support.api.md b/sdk/support/arm-support/review/arm-support.api.md new file mode 100644 index 000000000000..be1293044bb1 --- /dev/null +++ b/sdk/support/arm-support/review/arm-support.api.md @@ -0,0 +1,459 @@ +## API Report File for "@azure/arm-support" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export interface CheckNameAvailabilityInput { + name: string; + type: Type; +} + +// @public +export interface CheckNameAvailabilityOutput { + readonly message?: string; + readonly nameAvailable?: boolean; + readonly reason?: string; +} + +// @public +export interface CommunicationDetails { + body?: string; + readonly communicationDirection?: CommunicationDirection; + readonly communicationType?: CommunicationType; + readonly createdDate?: Date; + readonly id?: string; + readonly name?: string; + sender?: string; + subject?: string; + readonly type?: string; +} + +// @public +export type CommunicationDirection = string; + +// @public +export interface Communications { + beginCreate(supportTicketName: string, communicationName: string, createCommunicationParameters: CommunicationDetails, options?: CommunicationsCreateOptionalParams): Promise, CommunicationsCreateResponse>>; + beginCreateAndWait(supportTicketName: string, communicationName: string, createCommunicationParameters: CommunicationDetails, options?: CommunicationsCreateOptionalParams): Promise; + checkNameAvailability(supportTicketName: string, checkNameAvailabilityInput: CheckNameAvailabilityInput, options?: CommunicationsCheckNameAvailabilityOptionalParams): Promise; + get(supportTicketName: string, communicationName: string, options?: CommunicationsGetOptionalParams): Promise; + list(supportTicketName: string, options?: CommunicationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CommunicationsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunicationsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput; + +// @public +export interface CommunicationsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CommunicationsCreateResponse = CommunicationDetails; + +// @public +export interface CommunicationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunicationsGetResponse = CommunicationDetails; + +// @public +export interface CommunicationsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type CommunicationsListNextResponse = CommunicationsListResult; + +// @public +export interface CommunicationsListOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type CommunicationsListResponse = CommunicationsListResult; + +// @public +export interface CommunicationsListResult { + nextLink?: string; + value?: CommunicationDetails[]; +} + +// @public +export type CommunicationType = string; + +// @public +export interface ContactProfile { + additionalEmailAddresses?: string[]; + country: string; + firstName: string; + lastName: string; + phoneNumber?: string; + preferredContactMethod: PreferredContactMethod; + preferredSupportLanguage: string; + preferredTimeZone: string; + primaryEmailAddress: string; +} + +// @public +export interface ExceptionResponse { + error?: ServiceError; +} + +// @public +export enum KnownCommunicationDirection { + // (undocumented) + Inbound = "inbound", + // (undocumented) + Outbound = "outbound" +} + +// @public +export enum KnownCommunicationType { + // (undocumented) + Phone = "phone", + // (undocumented) + Web = "web" +} + +// @public +export enum KnownPreferredContactMethod { + // (undocumented) + Email = "email", + // (undocumented) + Phone = "phone" +} + +// @public +export enum KnownSeverityLevel { + // (undocumented) + Critical = "critical", + // (undocumented) + Highestcriticalimpact = "highestcriticalimpact", + // (undocumented) + Minimal = "minimal", + // (undocumented) + Moderate = "moderate" +} + +// @public +export enum KnownStatus { + // (undocumented) + Closed = "closed", + // (undocumented) + Open = "open" +} + +// @public (undocumented) +export class MicrosoftSupport extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftSupportOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + communications: Communications; + // (undocumented) + operations: Operations; + // (undocumented) + problemClassifications: ProblemClassifications; + // (undocumented) + services: Services; + // (undocumented) + subscriptionId: string; + // (undocumented) + supportTickets: SupportTickets; +} + +// @public +export interface MicrosoftSupportOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface Operation { + display?: OperationDisplay; + readonly name?: string; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationsListResult; + +// @public +export interface OperationsListResult { + value?: Operation[]; +} + +// @public +export type PreferredContactMethod = string; + +// @public +export interface ProblemClassification { + displayName?: string; + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ProblemClassifications { + get(serviceName: string, problemClassificationName: string, options?: ProblemClassificationsGetOptionalParams): Promise; + list(serviceName: string, options?: ProblemClassificationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ProblemClassificationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProblemClassificationsGetResponse = ProblemClassification; + +// @public +export interface ProblemClassificationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProblemClassificationsListResponse = ProblemClassificationsListResult; + +// @public +export interface ProblemClassificationsListResult { + value?: ProblemClassification[]; +} + +// @public +export interface QuotaChangeRequest { + payload?: string; + region?: string; +} + +// @public +export interface QuotaTicketDetails { + quotaChangeRequests?: QuotaChangeRequest[]; + quotaChangeRequestSubType?: string; + quotaChangeRequestVersion?: string; +} + +// @public +export interface Service { + displayName?: string; + readonly id?: string; + readonly name?: string; + resourceTypes?: string[]; + readonly type?: string; +} + +// @public +export interface ServiceError { + code?: string; + readonly details?: ServiceErrorDetail[]; + message?: string; + target?: string; +} + +// @public +export interface ServiceErrorDetail { + readonly code?: string; + readonly message?: string; + target?: string; +} + +// @public +export interface ServiceLevelAgreement { + readonly expirationTime?: Date; + readonly slaMinutes?: number; + readonly startTime?: Date; +} + +// @public +export interface Services { + get(serviceName: string, options?: ServicesGetOptionalParams): Promise; + list(options?: ServicesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ServicesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesGetResponse = Service; + +// @public +export interface ServicesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesListResponse = ServicesListResult; + +// @public +export interface ServicesListResult { + value?: Service[]; +} + +// @public +export type SeverityLevel = string; + +// @public +export type Status = string; + +// @public +export interface SupportEngineer { + readonly emailAddress?: string; +} + +// @public +export interface SupportTicketDetails { + contactDetails?: ContactProfile; + readonly createdDate?: Date; + description?: string; + readonly enrollmentId?: string; + readonly id?: string; + readonly modifiedDate?: Date; + readonly name?: string; + readonly problemClassificationDisplayName?: string; + problemClassificationId?: string; + problemStartTime?: Date; + quotaTicketDetails?: QuotaTicketDetails; + require24X7Response?: boolean; + readonly serviceDisplayName?: string; + serviceId?: string; + serviceLevelAgreement?: ServiceLevelAgreement; + severity?: SeverityLevel; + readonly status?: string; + supportEngineer?: SupportEngineer; + readonly supportPlanType?: string; + supportTicketId?: string; + technicalTicketDetails?: TechnicalTicketDetails; + title?: string; + readonly type?: string; +} + +// @public +export interface SupportTickets { + beginCreate(supportTicketName: string, createSupportTicketParameters: SupportTicketDetails, options?: SupportTicketsCreateOptionalParams): Promise, SupportTicketsCreateResponse>>; + beginCreateAndWait(supportTicketName: string, createSupportTicketParameters: SupportTicketDetails, options?: SupportTicketsCreateOptionalParams): Promise; + checkNameAvailability(checkNameAvailabilityInput: CheckNameAvailabilityInput, options?: SupportTicketsCheckNameAvailabilityOptionalParams): Promise; + get(supportTicketName: string, options?: SupportTicketsGetOptionalParams): Promise; + list(options?: SupportTicketsListOptionalParams): PagedAsyncIterableIterator; + update(supportTicketName: string, updateSupportTicket: UpdateSupportTicket, options?: SupportTicketsUpdateOptionalParams): Promise; +} + +// @public +export interface SupportTicketsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SupportTicketsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput; + +// @public +export interface SupportTicketsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SupportTicketsCreateResponse = SupportTicketDetails; + +// @public +export interface SupportTicketsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SupportTicketsGetResponse = SupportTicketDetails; + +// @public +export interface SupportTicketsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type SupportTicketsListNextResponse = SupportTicketsListResult; + +// @public +export interface SupportTicketsListOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type SupportTicketsListResponse = SupportTicketsListResult; + +// @public +export interface SupportTicketsListResult { + nextLink?: string; + value?: SupportTicketDetails[]; +} + +// @public +export interface SupportTicketsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SupportTicketsUpdateResponse = SupportTicketDetails; + +// @public +export interface TechnicalTicketDetails { + resourceId?: string; +} + +// @public +export type Type = "Microsoft.Support/supportTickets" | "Microsoft.Support/communications"; + +// @public +export interface UpdateContactProfile { + additionalEmailAddresses?: string[]; + country?: string; + firstName?: string; + lastName?: string; + phoneNumber?: string; + preferredContactMethod?: PreferredContactMethod; + preferredSupportLanguage?: string; + preferredTimeZone?: string; + primaryEmailAddress?: string; +} + +// @public +export interface UpdateSupportTicket { + contactDetails?: UpdateContactProfile; + severity?: SeverityLevel; + status?: Status; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/support/arm-support/rollup.config.js b/sdk/support/arm-support/rollup.config.js index d1cdb7454709..9be1955eb7f1 100644 --- a/sdk/support/arm-support/rollup.config.js +++ b/sdk/support/arm-support/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/microsoftSupport.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-support.js", - format: "umd", - name: "Azure.ArmSupport", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/support/arm-support/sample.env b/sdk/support/arm-support/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/support/arm-support/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/support/arm-support/samples-dev/addCommunicationToSubscriptionTicket.ts b/sdk/support/arm-support/samples-dev/addCommunicationToSubscriptionTicket.ts new file mode 100644 index 000000000000..9971f4f8a52d --- /dev/null +++ b/sdk/support/arm-support/samples-dev/addCommunicationToSubscriptionTicket.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Adds a new customer communication to an Azure support ticket. + * + * @summary Adds a new customer communication to an Azure support ticket. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSupportTicketCommunication.json + */ +import { CommunicationDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function addCommunicationToSubscriptionTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const communicationName = "testcommunication"; + const createCommunicationParameters: CommunicationDetails = { + body: "This is a test message from a customer!", + sender: "user@contoso.com", + subject: "This is a test message from a customer!" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.communications.beginCreateAndWait( + supportTicketName, + communicationName, + createCommunicationParameters + ); + console.log(result); +} + +addCommunicationToSubscriptionTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/checksWhetherNameIsAvailableForCommunicationResource.ts b/sdk/support/arm-support/samples-dev/checksWhetherNameIsAvailableForCommunicationResource.ts new file mode 100644 index 000000000000..7da7711ea00d --- /dev/null +++ b/sdk/support/arm-support/samples-dev/checksWhetherNameIsAvailableForCommunicationResource.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding a new communication to the support ticket. + * + * @summary Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding a new communication to the support ticket. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityForSupportTicketCommunication.json + */ +import { + CheckNameAvailabilityInput, + MicrosoftSupport +} from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function checksWhetherNameIsAvailableForCommunicationResource() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const checkNameAvailabilityInput: CheckNameAvailabilityInput = { + name: "sampleName", + type: "Microsoft.Support/communications" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.communications.checkNameAvailability( + supportTicketName, + checkNameAvailabilityInput + ); + console.log(result); +} + +checksWhetherNameIsAvailableForCommunicationResource().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/checksWhetherNameIsAvailableForSupportTicketResource.ts b/sdk/support/arm-support/samples-dev/checksWhetherNameIsAvailableForSupportTicketResource.ts new file mode 100644 index 000000000000..f814e22d1d14 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/checksWhetherNameIsAvailableForSupportTicketResource.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Check the availability of a resource name. This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription. + * + * @summary Check the availability of a resource name. This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityWithSubscription.json + */ +import { + CheckNameAvailabilityInput, + MicrosoftSupport +} from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function checksWhetherNameIsAvailableForSupportTicketResource() { + const subscriptionId = "subid"; + const checkNameAvailabilityInput: CheckNameAvailabilityInput = { + name: "sampleName", + type: "Microsoft.Support/supportTickets" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.checkNameAvailability( + checkNameAvailabilityInput + ); + console.log(result); +} + +checksWhetherNameIsAvailableForSupportTicketResource().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/createATicketForBillingRelatedIssues.ts b/sdk/support/arm-support/samples-dev/createATicketForBillingRelatedIssues.ts new file mode 100644 index 000000000000..34516017c36a --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketForBillingRelatedIssues.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBillingSupportTicketForSubscription.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketForBillingRelatedIssues() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid", + serviceId: "/providers/Microsoft.Support/services/billing_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketForBillingRelatedIssues().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/createATicketForSubscriptionManagementRelatedIssues.ts b/sdk/support/arm-support/samples-dev/createATicketForSubscriptionManagementRelatedIssues.ts new file mode 100644 index 000000000000..b63e964f18c5 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketForSubscriptionManagementRelatedIssues.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketForSubscriptionManagementRelatedIssues() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid", + serviceId: + "/providers/Microsoft.Support/services/subscription_management_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketForSubscriptionManagementRelatedIssues().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/createATicketForTechnicalIssueRelatedToASpecificResource.ts b/sdk/support/arm-support/samples-dev/createATicketForTechnicalIssueRelatedToASpecificResource.ts new file mode 100644 index 000000000000..f04be53522e1 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketForTechnicalIssueRelatedToASpecificResource.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateTechnicalSupportTicketForSubscription.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketForTechnicalIssueRelatedToASpecificResource() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid", + serviceId: + "/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc", + severity: "moderate", + technicalTicketDetails: { + resourceId: + "/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver" + }, + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketForTechnicalIssueRelatedToASpecificResource().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.ts new file mode 100644 index 000000000000..b3b689c6415e --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"AccountName":"test","NewLimit":200,"Type":"Jobs"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.ts new file mode 100644 index 000000000000..f098cc4a802d --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "SQLMI", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"NewLimit":200, "Metadata":null, "Type":"vCore"}', + region: "EastUS" + }, + { + payload: '{"NewLimit":200, "Metadata":null, "Type":"Subnet"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.ts new file mode 100644 index 000000000000..625399a8cf61 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSubscription.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Subscription", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { payload: '{"NewLimit":200,"Type":"Account"}', region: "EastUS" } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForComputeVMCores.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForComputeVMCores.ts new file mode 100644 index 000000000000..c6ea993340b3 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForComputeVMCores.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateCoresQuotaTicketForSubscription.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForComputeVMCores() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { payload: '{"SKU":"DSv3 Series","NewLimit":104}', region: "EastUS" } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForComputeVMCores().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.ts new file mode 100644 index 000000000000..148732dba08c --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "DTUs", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"ServerName":"testserver","NewLimit":54000}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.ts new file mode 100644 index 000000000000..212a7dc268e3 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "DTUs", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"ServerName":"testserver","NewLimit":54000}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.ts new file mode 100644 index 000000000000..abfd853c5655 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"AccountName":"test","NewLimit":200,"Type":"LowPriority"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.ts new file mode 100644 index 000000000000..8af9beeff08c --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "BatchAml", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { payload: '{"NewLimit":200,"Type":"LowPriority"}', region: "EastUS" } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.ts new file mode 100644 index 000000000000..97b68dedd741 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForPoolsForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"AccountName":"test","NewLimit":200,"Type":"Pools"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForPoolsForABatchAccount().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.ts new file mode 100644 index 000000000000..a1df8bec50c9 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Servers", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [{ payload: '{"NewLimit":200}', region: "EastUS" }] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.ts new file mode 100644 index 000000000000..03714c9ffece --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForServersForSqlDatabase() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Servers", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [{ payload: '{"NewLimit":200}', region: "EastUS" }] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForServersForSqlDatabase().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.ts new file mode 100644 index 000000000000..910683fdc4ba --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateGenericQuotaTicket.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: + "Increase the maximum throughput per container limit to 10000 for account foo bar", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid", + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.ts new file mode 100644 index 000000000000..be6f35af5ffa --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: + '{"AccountName":"test","VMFamily":"standardA0_A7Family","NewLimit":200,"Type":"Dedicated"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.ts b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.ts new file mode 100644 index 000000000000..0c555c976686 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "BatchAml", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: + '{"VMFamily":"standardA0_A7Family","NewLimit":200,"Type":"Dedicated"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/getAllOperations.ts b/sdk/support/arm-support/samples-dev/getAllOperations.ts new file mode 100644 index 000000000000..29734338b812 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/getAllOperations.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This lists all the available Microsoft Support REST API operations. + * + * @summary This lists all the available Microsoft Support REST API operations. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListOperations.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAllOperations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAllOperations().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/getCommunicationDetailsForASubscriptionSupportTicket.ts b/sdk/support/arm-support/samples-dev/getCommunicationDetailsForASubscriptionSupportTicket.ts new file mode 100644 index 000000000000..44a494ae23c4 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/getCommunicationDetailsForASubscriptionSupportTicket.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns communication details for a support ticket. + * + * @summary Returns communication details for a support ticket. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getCommunicationDetailsForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const communicationName = "testmessage"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.communications.get( + supportTicketName, + communicationName + ); + console.log(result); +} + +getCommunicationDetailsForASubscriptionSupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/getDetailsOfASubscriptionTicket.ts b/sdk/support/arm-support/samples-dev/getDetailsOfASubscriptionTicket.ts new file mode 100644 index 000000000000..0455e6316900 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/getDetailsOfASubscriptionTicket.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetSubscriptionSupportTicketDetails.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getDetailsOfASubscriptionTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.get(supportTicketName); + console.log(result); +} + +getDetailsOfASubscriptionTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/getsDetailsOfProblemClassificationForAzureService.ts b/sdk/support/arm-support/samples-dev/getsDetailsOfProblemClassificationForAzureService.ts new file mode 100644 index 000000000000..89b045abedde --- /dev/null +++ b/sdk/support/arm-support/samples-dev/getsDetailsOfProblemClassificationForAzureService.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Get problem classification details for a specific Azure service. + * + * @summary Get problem classification details for a specific Azure service. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetProblemClassification.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getsDetailsOfProblemClassificationForAzureService() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const serviceName = "service_guid"; + const problemClassificationName = "problemClassification_guid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.problemClassifications.get( + serviceName, + problemClassificationName + ); + console.log(result); +} + +getsDetailsOfProblemClassificationForAzureService().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/getsDetailsOfTheAzureService.ts b/sdk/support/arm-support/samples-dev/getsDetailsOfTheAzureService.ts new file mode 100644 index 000000000000..b9454da56179 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/getsDetailsOfTheAzureService.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a specific Azure service for support ticket creation. + * + * @summary Gets a specific Azure service for support ticket creation. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetService.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getsDetailsOfTheAzureService() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const serviceName = "service_guid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.services.get(serviceName); + console.log(result); +} + +getsDetailsOfTheAzureService().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.ts b/sdk/support/arm-support/samples-dev/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.ts new file mode 100644 index 000000000000..f46d4bc52b56 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the problem classifications (categories) available for a specific Azure service. Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @summary Lists all the problem classifications (categories) available for a specific Azure service. Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListProblemClassifications.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const serviceName = "service_guid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.problemClassifications.list(serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/getsListOfServicesForWhichASupportTicketCanBeCreated.ts b/sdk/support/arm-support/samples-dev/getsListOfServicesForWhichASupportTicketCanBeCreated.ts new file mode 100644 index 000000000000..1ac1c31291da --- /dev/null +++ b/sdk/support/arm-support/samples-dev/getsListOfServicesForWhichASupportTicketCanBeCreated.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's [New support request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. Always use the service and its corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @summary Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's [New support request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. Always use the service and its corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListServices.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getsListOfServicesForWhichASupportTicketCanBeCreated() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getsListOfServicesForWhichASupportTicketCanBeCreated().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/listCommunicationsForASubscriptionSupportTicket.ts b/sdk/support/arm-support/samples-dev/listCommunicationsForASubscriptionSupportTicket.ts new file mode 100644 index 000000000000..a27f153f2cf7 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/listCommunicationsForASubscriptionSupportTicket.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListCommunicationsForSubscriptionSupportTicket.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listCommunicationsForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.communications.list(supportTicketName)) { + resArray.push(item); + } + console.log(resArray); +} + +listCommunicationsForASubscriptionSupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.ts b/sdk/support/arm-support/samples-dev/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.ts new file mode 100644 index 000000000000..fc6bb83fa6f1 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription() { + const subscriptionId = "subid"; + const filter = "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.supportTickets.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/listSupportTicketsForASubscription.ts b/sdk/support/arm-support/samples-dev/listSupportTicketsForASubscription.ts new file mode 100644 index 000000000000..d3e421ddfe48 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/listSupportTicketsForASubscription.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listSupportTicketsForASubscription() { + const subscriptionId = "subid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.supportTickets.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listSupportTicketsForASubscription().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/listSupportTicketsInOpenStateForASubscription.ts b/sdk/support/arm-support/samples-dev/listSupportTicketsInOpenStateForASubscription.ts new file mode 100644 index 000000000000..a24c27e8279e --- /dev/null +++ b/sdk/support/arm-support/samples-dev/listSupportTicketsInOpenStateForASubscription.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listSupportTicketsInOpenStateForASubscription() { + const subscriptionId = "subid"; + const filter = "status eq 'Open'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.supportTickets.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listSupportTicketsInOpenStateForASubscription().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.ts b/sdk/support/arm-support/samples-dev/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.ts new file mode 100644 index 000000000000..bdfccbe78801 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const filter = + "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.communications.list( + supportTicketName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket().catch( + console.error +); diff --git a/sdk/support/arm-support/samples-dev/listWebCommunicationsForASubscriptionSupportTicket.ts b/sdk/support/arm-support/samples-dev/listWebCommunicationsForASubscriptionSupportTicket.ts new file mode 100644 index 000000000000..a2985f623a45 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/listWebCommunicationsForASubscriptionSupportTicket.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicket.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listWebCommunicationsForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const filter = "communicationType eq 'web'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.communications.list( + supportTicketName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +listWebCommunicationsForASubscriptionSupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/updateContactDetailsOfASupportTicket.ts b/sdk/support/arm-support/samples-dev/updateContactDetailsOfASupportTicket.ts new file mode 100644 index 000000000000..6ca81a2a915d --- /dev/null +++ b/sdk/support/arm-support/samples-dev/updateContactDetailsOfASupportTicket.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * + * @summary This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateContactDetailsOfSupportTicketForSubscription.json + */ +import { UpdateSupportTicket, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateContactDetailsOfASupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const updateSupportTicket: UpdateSupportTicket = { + contactDetails: { + additionalEmailAddresses: ["tname@contoso.com", "teamtest@contoso.com"], + country: "USA", + firstName: "first name", + lastName: "last name", + phoneNumber: "123-456-7890", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "test.name@contoso.com" + } + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.update( + supportTicketName, + updateSupportTicket + ); + console.log(result); +} + +updateContactDetailsOfASupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/updateSeverityOfASupportTicket.ts b/sdk/support/arm-support/samples-dev/updateSeverityOfASupportTicket.ts new file mode 100644 index 000000000000..08f3d5990ee7 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/updateSeverityOfASupportTicket.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * + * @summary This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateSeverityOfSupportTicketForSubscription.json + */ +import { UpdateSupportTicket, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateSeverityOfASupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const updateSupportTicket: UpdateSupportTicket = { severity: "critical" }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.update( + supportTicketName, + updateSupportTicket + ); + console.log(result); +} + +updateSeverityOfASupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples-dev/updateStatusOfASupportTicket.ts b/sdk/support/arm-support/samples-dev/updateStatusOfASupportTicket.ts new file mode 100644 index 000000000000..128921f477a4 --- /dev/null +++ b/sdk/support/arm-support/samples-dev/updateStatusOfASupportTicket.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * + * @summary This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateStatusOfSupportTicketForSubscription.json + */ +import { UpdateSupportTicket, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateStatusOfASupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const updateSupportTicket: UpdateSupportTicket = { status: "closed" }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.update( + supportTicketName, + updateSupportTicket + ); + console.log(result); +} + +updateStatusOfASupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/README.md b/sdk/support/arm-support/samples/v2/javascript/README.md new file mode 100644 index 000000000000..c050b2fb8dee --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/README.md @@ -0,0 +1,120 @@ +# client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [addCommunicationToSubscriptionTicket.js][addcommunicationtosubscriptionticket] | Adds a new customer communication to an Azure support ticket. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSupportTicketCommunication.json | +| [checksWhetherNameIsAvailableForCommunicationResource.js][checkswhethernameisavailableforcommunicationresource] | Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding a new communication to the support ticket. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityForSupportTicketCommunication.json | +| [checksWhetherNameIsAvailableForSupportTicketResource.js][checkswhethernameisavailableforsupportticketresource] | Check the availability of a resource name. This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityWithSubscription.json | +| [createATicketForBillingRelatedIssues.js][createaticketforbillingrelatedissues] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBillingSupportTicketForSubscription.json | +| [createATicketForSubscriptionManagementRelatedIssues.js][createaticketforsubscriptionmanagementrelatedissues] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json | +| [createATicketForTechnicalIssueRelatedToASpecificResource.js][createaticketfortechnicalissuerelatedtoaspecificresource] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateTechnicalSupportTicketForSubscription.json | +| [createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.js][createatickettorequestquotaincreaseforactivejobsandjobschedulesforabatchaccount] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json | +| [createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.js][createatickettorequestquotaincreaseforazuresqlmanagedinstance] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json | +| [createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.js][createatickettorequestquotaincreaseforbatchaccountsforasubscription] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSubscription.json | +| [createATicketToRequestQuotaIncreaseForComputeVMCores.js][createatickettorequestquotaincreaseforcomputevmcores] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateCoresQuotaTicketForSubscription.json | +| [createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.js][createatickettorequestquotaincreasefordtusforazuresynapseanalytics] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json | +| [createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.js][createatickettorequestquotaincreasefordtusforsqldatabase] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json | +| [createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.js][createatickettorequestquotaincreaseforlowprioritycoresforabatchaccount] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json | +| [createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.js][createatickettorequestquotaincreaseforlowprioritycoresformachinelearningservice] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json | +| [createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.js][createatickettorequestquotaincreaseforpoolsforabatchaccount] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json | +| [createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.js][createatickettorequestquotaincreaseforserversforazuresynapseanalytics] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json | +| [createATicketToRequestQuotaIncreaseForServersForSqlDatabase.js][createatickettorequestquotaincreaseforserversforsqldatabase] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json | +| [createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.js][createatickettorequestquotaincreaseforservicesthatdonotrequireadditionaldetailsinthequotaticketdetailsobject] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateGenericQuotaTicket.json | +| [createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.js][createatickettorequestquotaincreaseforspecificvmfamilycoresforabatchaccount] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json | +| [createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.js][createatickettorequestquotaincreaseforspecificvmfamilycoresformachinelearningservice] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json | +| [getAllOperations.js][getalloperations] | This lists all the available Microsoft Support REST API operations. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListOperations.json | +| [getCommunicationDetailsForASubscriptionSupportTicket.js][getcommunicationdetailsforasubscriptionsupportticket] | Returns communication details for a support ticket. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json | +| [getDetailsOfASubscriptionTicket.js][getdetailsofasubscriptionticket] | Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetSubscriptionSupportTicketDetails.json | +| [getsDetailsOfProblemClassificationForAzureService.js][getsdetailsofproblemclassificationforazureservice] | Get problem classification details for a specific Azure service. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetProblemClassification.json | +| [getsDetailsOfTheAzureService.js][getsdetailsoftheazureservice] | Gets a specific Azure service for support ticket creation. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetService.json | +| [getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.js][getslistofproblemclassificationsforaserviceforwhichasupportticketcanbecreated] | Lists all the problem classifications (categories) available for a specific Azure service. Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListProblemClassifications.json | +| [getsListOfServicesForWhichASupportTicketCanBeCreated.js][getslistofservicesforwhichasupportticketcanbecreated] | Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's [New support request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. Always use the service and its corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListServices.json | +| [listCommunicationsForASubscriptionSupportTicket.js][listcommunicationsforasubscriptionsupportticket] | Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListCommunicationsForSubscriptionSupportTicket.json | +| [listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.js][listsupportticketscreatedonorafteracertaindateandinopenstateforasubscription] | Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json | +| [listSupportTicketsForASubscription.js][listsupportticketsforasubscription] | Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json | +| [listSupportTicketsInOpenStateForASubscription.js][listsupportticketsinopenstateforasubscription] | Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json | +| [listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.js][listwebcommunicationcreatedonorafteraspecificdateforasubscriptionsupportticket] | Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json | +| [listWebCommunicationsForASubscriptionSupportTicket.js][listwebcommunicationsforasubscriptionsupportticket] | Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicket.json | +| [updateContactDetailsOfASupportTicket.js][updatecontactdetailsofasupportticket] | This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateContactDetailsOfSupportTicketForSubscription.json | +| [updateSeverityOfASupportTicket.js][updateseverityofasupportticket] | This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateSeverityOfSupportTicketForSubscription.json | +| [updateStatusOfASupportTicket.js][updatestatusofasupportticket] | This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateStatusOfSupportTicketForSubscription.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node addCommunicationToSubscriptionTicket.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node addCommunicationToSubscriptionTicket.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[addcommunicationtosubscriptionticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/addCommunicationToSubscriptionTicket.js +[checkswhethernameisavailableforcommunicationresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/checksWhetherNameIsAvailableForCommunicationResource.js +[checkswhethernameisavailableforsupportticketresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/checksWhetherNameIsAvailableForSupportTicketResource.js +[createaticketforbillingrelatedissues]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketForBillingRelatedIssues.js +[createaticketforsubscriptionmanagementrelatedissues]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketForSubscriptionManagementRelatedIssues.js +[createaticketfortechnicalissuerelatedtoaspecificresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketForTechnicalIssueRelatedToASpecificResource.js +[createatickettorequestquotaincreaseforactivejobsandjobschedulesforabatchaccount]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.js +[createatickettorequestquotaincreaseforazuresqlmanagedinstance]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.js +[createatickettorequestquotaincreaseforbatchaccountsforasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.js +[createatickettorequestquotaincreaseforcomputevmcores]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForComputeVMCores.js +[createatickettorequestquotaincreasefordtusforazuresynapseanalytics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.js +[createatickettorequestquotaincreasefordtusforsqldatabase]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.js +[createatickettorequestquotaincreaseforlowprioritycoresforabatchaccount]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.js +[createatickettorequestquotaincreaseforlowprioritycoresformachinelearningservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.js +[createatickettorequestquotaincreaseforpoolsforabatchaccount]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.js +[createatickettorequestquotaincreaseforserversforazuresynapseanalytics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.js +[createatickettorequestquotaincreaseforserversforsqldatabase]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.js +[createatickettorequestquotaincreaseforservicesthatdonotrequireadditionaldetailsinthequotaticketdetailsobject]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.js +[createatickettorequestquotaincreaseforspecificvmfamilycoresforabatchaccount]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.js +[createatickettorequestquotaincreaseforspecificvmfamilycoresformachinelearningservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.js +[getalloperations]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/getAllOperations.js +[getcommunicationdetailsforasubscriptionsupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/getCommunicationDetailsForASubscriptionSupportTicket.js +[getdetailsofasubscriptionticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/getDetailsOfASubscriptionTicket.js +[getsdetailsofproblemclassificationforazureservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/getsDetailsOfProblemClassificationForAzureService.js +[getsdetailsoftheazureservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/getsDetailsOfTheAzureService.js +[getslistofproblemclassificationsforaserviceforwhichasupportticketcanbecreated]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.js +[getslistofservicesforwhichasupportticketcanbecreated]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/getsListOfServicesForWhichASupportTicketCanBeCreated.js +[listcommunicationsforasubscriptionsupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/listCommunicationsForASubscriptionSupportTicket.js +[listsupportticketscreatedonorafteracertaindateandinopenstateforasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.js +[listsupportticketsforasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsForASubscription.js +[listsupportticketsinopenstateforasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsInOpenStateForASubscription.js +[listwebcommunicationcreatedonorafteraspecificdateforasubscriptionsupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.js +[listwebcommunicationsforasubscriptionsupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/listWebCommunicationsForASubscriptionSupportTicket.js +[updatecontactdetailsofasupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/updateContactDetailsOfASupportTicket.js +[updateseverityofasupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/updateSeverityOfASupportTicket.js +[updatestatusofasupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/javascript/updateStatusOfASupportTicket.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-support?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/support/arm-support/README.md diff --git a/sdk/support/arm-support/samples/v2/javascript/addCommunicationToSubscriptionTicket.js b/sdk/support/arm-support/samples/v2/javascript/addCommunicationToSubscriptionTicket.js new file mode 100644 index 000000000000..51bca1207ca7 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/addCommunicationToSubscriptionTicket.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Adds a new customer communication to an Azure support ticket. + * + * @summary Adds a new customer communication to an Azure support ticket. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSupportTicketCommunication.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function addCommunicationToSubscriptionTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const communicationName = "testcommunication"; + const createCommunicationParameters = { + body: "This is a test message from a customer!", + sender: "user@contoso.com", + subject: "This is a test message from a customer!", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.communications.beginCreateAndWait( + supportTicketName, + communicationName, + createCommunicationParameters + ); + console.log(result); +} + +addCommunicationToSubscriptionTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/checksWhetherNameIsAvailableForCommunicationResource.js b/sdk/support/arm-support/samples/v2/javascript/checksWhetherNameIsAvailableForCommunicationResource.js new file mode 100644 index 000000000000..fe59891d2d9f --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/checksWhetherNameIsAvailableForCommunicationResource.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding a new communication to the support ticket. + * + * @summary Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding a new communication to the support ticket. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityForSupportTicketCommunication.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function checksWhetherNameIsAvailableForCommunicationResource() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const checkNameAvailabilityInput = { + name: "sampleName", + type: "Microsoft.Support/communications", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.communications.checkNameAvailability( + supportTicketName, + checkNameAvailabilityInput + ); + console.log(result); +} + +checksWhetherNameIsAvailableForCommunicationResource().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/checksWhetherNameIsAvailableForSupportTicketResource.js b/sdk/support/arm-support/samples/v2/javascript/checksWhetherNameIsAvailableForSupportTicketResource.js new file mode 100644 index 000000000000..036d6a1fc47e --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/checksWhetherNameIsAvailableForSupportTicketResource.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Check the availability of a resource name. This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription. + * + * @summary Check the availability of a resource name. This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityWithSubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function checksWhetherNameIsAvailableForSupportTicketResource() { + const subscriptionId = "subid"; + const checkNameAvailabilityInput = { + name: "sampleName", + type: "Microsoft.Support/supportTickets", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.checkNameAvailability(checkNameAvailabilityInput); + console.log(result); +} + +checksWhetherNameIsAvailableForSupportTicketResource().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketForBillingRelatedIssues.js b/sdk/support/arm-support/samples/v2/javascript/createATicketForBillingRelatedIssues.js new file mode 100644 index 000000000000..1fca8bcca073 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketForBillingRelatedIssues.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBillingSupportTicketForSubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketForBillingRelatedIssues() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid", + serviceId: "/providers/Microsoft.Support/services/billing_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketForBillingRelatedIssues().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketForSubscriptionManagementRelatedIssues.js b/sdk/support/arm-support/samples/v2/javascript/createATicketForSubscriptionManagementRelatedIssues.js new file mode 100644 index 000000000000..d951a66c9c0d --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketForSubscriptionManagementRelatedIssues.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketForSubscriptionManagementRelatedIssues() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid", + serviceId: "/providers/Microsoft.Support/services/subscription_management_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketForSubscriptionManagementRelatedIssues().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketForTechnicalIssueRelatedToASpecificResource.js b/sdk/support/arm-support/samples/v2/javascript/createATicketForTechnicalIssueRelatedToASpecificResource.js new file mode 100644 index 000000000000..f05397f63b57 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketForTechnicalIssueRelatedToASpecificResource.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateTechnicalSupportTicketForSubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketForTechnicalIssueRelatedToASpecificResource() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid", + serviceId: "/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc", + severity: "moderate", + technicalTicketDetails: { + resourceId: + "/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver", + }, + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketForTechnicalIssueRelatedToASpecificResource().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.js new file mode 100644 index 000000000000..53f8ebe7871c --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"AccountName":"test","NewLimit":200,"Type":"Jobs"}', + region: "EastUS", + }, + ], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.js new file mode 100644 index 000000000000..4e09722adfc1 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "SQLMI", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"NewLimit":200, "Metadata":null, "Type":"vCore"}', + region: "EastUS", + }, + { + payload: '{"NewLimit":200, "Metadata":null, "Type":"Subnet"}', + region: "EastUS", + }, + ], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.js new file mode 100644 index 000000000000..716e429613fd --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Subscription", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [{ payload: '{"NewLimit":200,"Type":"Account"}', region: "EastUS" }], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForComputeVMCores.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForComputeVMCores.js new file mode 100644 index 000000000000..acdcd01d53fd --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForComputeVMCores.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateCoresQuotaTicketForSubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForComputeVMCores() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [{ payload: '{"SKU":"DSv3 Series","NewLimit":104}', region: "EastUS" }], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForComputeVMCores().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.js new file mode 100644 index 000000000000..fd1719cb4e78 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "DTUs", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"ServerName":"testserver","NewLimit":54000}', + region: "EastUS", + }, + ], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.js new file mode 100644 index 000000000000..72da4c96ba43 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "DTUs", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"ServerName":"testserver","NewLimit":54000}', + region: "EastUS", + }, + ], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.js new file mode 100644 index 000000000000..b9086aff7085 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"AccountName":"test","NewLimit":200,"Type":"LowPriority"}', + region: "EastUS", + }, + ], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.js new file mode 100644 index 000000000000..16b372278963 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "BatchAml", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [{ payload: '{"NewLimit":200,"Type":"LowPriority"}', region: "EastUS" }], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.js new file mode 100644 index 000000000000..3f374d7ea4c9 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForPoolsForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"AccountName":"test","NewLimit":200,"Type":"Pools"}', + region: "EastUS", + }, + ], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForPoolsForABatchAccount().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.js new file mode 100644 index 000000000000..d5f799915fc8 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Servers", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [{ payload: '{"NewLimit":200}', region: "EastUS" }], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.js new file mode 100644 index 000000000000..120d1c3574f0 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForServersForSqlDatabase() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Servers", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [{ payload: '{"NewLimit":200}', region: "EastUS" }], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForServersForSqlDatabase().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.js new file mode 100644 index 000000000000..ae9ac4147c1e --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateGenericQuotaTicket.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "Increase the maximum throughput per container limit to 10000 for account foo bar", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid", + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.js new file mode 100644 index 000000000000..396038d7f7df --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: + '{"AccountName":"test","VMFamily":"standardA0_A7Family","NewLimit":200,"Type":"Dedicated"}', + region: "EastUS", + }, + ], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.js b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.js new file mode 100644 index 000000000000..ba3bdb529479 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com", + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "BatchAml", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"VMFamily":"standardA0_A7Family","NewLimit":200,"Type":"Dedicated"}', + region: "EastUS", + }, + ], + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title", + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/javascript/getAllOperations.js b/sdk/support/arm-support/samples/v2/javascript/getAllOperations.js new file mode 100644 index 000000000000..6a2519070d4a --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/getAllOperations.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This lists all the available Microsoft Support REST API operations. + * + * @summary This lists all the available Microsoft Support REST API operations. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListOperations.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getAllOperations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAllOperations().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/getCommunicationDetailsForASubscriptionSupportTicket.js b/sdk/support/arm-support/samples/v2/javascript/getCommunicationDetailsForASubscriptionSupportTicket.js new file mode 100644 index 000000000000..bc3315bbbcfd --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/getCommunicationDetailsForASubscriptionSupportTicket.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns communication details for a support ticket. + * + * @summary Returns communication details for a support ticket. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getCommunicationDetailsForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const communicationName = "testmessage"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.communications.get(supportTicketName, communicationName); + console.log(result); +} + +getCommunicationDetailsForASubscriptionSupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/getDetailsOfASubscriptionTicket.js b/sdk/support/arm-support/samples/v2/javascript/getDetailsOfASubscriptionTicket.js new file mode 100644 index 000000000000..0c17a2c34c54 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/getDetailsOfASubscriptionTicket.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetSubscriptionSupportTicketDetails.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getDetailsOfASubscriptionTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.get(supportTicketName); + console.log(result); +} + +getDetailsOfASubscriptionTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/getsDetailsOfProblemClassificationForAzureService.js b/sdk/support/arm-support/samples/v2/javascript/getsDetailsOfProblemClassificationForAzureService.js new file mode 100644 index 000000000000..b90f0489ddf9 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/getsDetailsOfProblemClassificationForAzureService.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Get problem classification details for a specific Azure service. + * + * @summary Get problem classification details for a specific Azure service. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetProblemClassification.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getsDetailsOfProblemClassificationForAzureService() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const serviceName = "service_guid"; + const problemClassificationName = "problemClassification_guid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.problemClassifications.get(serviceName, problemClassificationName); + console.log(result); +} + +getsDetailsOfProblemClassificationForAzureService().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/getsDetailsOfTheAzureService.js b/sdk/support/arm-support/samples/v2/javascript/getsDetailsOfTheAzureService.js new file mode 100644 index 000000000000..6b27d0515c6e --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/getsDetailsOfTheAzureService.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a specific Azure service for support ticket creation. + * + * @summary Gets a specific Azure service for support ticket creation. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetService.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getsDetailsOfTheAzureService() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const serviceName = "service_guid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.services.get(serviceName); + console.log(result); +} + +getsDetailsOfTheAzureService().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.js b/sdk/support/arm-support/samples/v2/javascript/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.js new file mode 100644 index 000000000000..598ae138c030 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the problem classifications (categories) available for a specific Azure service. Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @summary Lists all the problem classifications (categories) available for a specific Azure service. Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListProblemClassifications.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const serviceName = "service_guid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.problemClassifications.list(serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/javascript/getsListOfServicesForWhichASupportTicketCanBeCreated.js b/sdk/support/arm-support/samples/v2/javascript/getsListOfServicesForWhichASupportTicketCanBeCreated.js new file mode 100644 index 000000000000..ce8b4a4c3cb8 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/getsListOfServicesForWhichASupportTicketCanBeCreated.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's [New support request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. Always use the service and its corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @summary Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's [New support request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. Always use the service and its corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListServices.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getsListOfServicesForWhichASupportTicketCanBeCreated() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getsListOfServicesForWhichASupportTicketCanBeCreated().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/listCommunicationsForASubscriptionSupportTicket.js b/sdk/support/arm-support/samples/v2/javascript/listCommunicationsForASubscriptionSupportTicket.js new file mode 100644 index 000000000000..b246e18b4403 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/listCommunicationsForASubscriptionSupportTicket.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListCommunicationsForSubscriptionSupportTicket.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listCommunicationsForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.communications.list(supportTicketName)) { + resArray.push(item); + } + console.log(resArray); +} + +listCommunicationsForASubscriptionSupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.js b/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.js new file mode 100644 index 000000000000..66a5c0150496 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription() { + const subscriptionId = "subid"; + const filter = "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.supportTickets.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsForASubscription.js b/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsForASubscription.js new file mode 100644 index 000000000000..5874b33a4d20 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsForASubscription.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listSupportTicketsForASubscription() { + const subscriptionId = "subid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.supportTickets.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listSupportTicketsForASubscription().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsInOpenStateForASubscription.js b/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsInOpenStateForASubscription.js new file mode 100644 index 000000000000..e58c64c949f1 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/listSupportTicketsInOpenStateForASubscription.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listSupportTicketsInOpenStateForASubscription() { + const subscriptionId = "subid"; + const filter = "status eq 'Open'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.supportTickets.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listSupportTicketsInOpenStateForASubscription().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.js b/sdk/support/arm-support/samples/v2/javascript/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.js new file mode 100644 index 000000000000..9d80ed13cb83 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const filter = "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.communications.list(supportTicketName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/javascript/listWebCommunicationsForASubscriptionSupportTicket.js b/sdk/support/arm-support/samples/v2/javascript/listWebCommunicationsForASubscriptionSupportTicket.js new file mode 100644 index 000000000000..89155ff14633 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/listWebCommunicationsForASubscriptionSupportTicket.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicket.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listWebCommunicationsForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const filter = "communicationType eq 'web'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.communications.list(supportTicketName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +listWebCommunicationsForASubscriptionSupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/package.json b/sdk/support/arm-support/samples/v2/javascript/package.json new file mode 100644 index 000000000000..cc97a7992fca --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "azure-arm-support-samples-js", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/support/arm-support" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/support/arm-support", + "dependencies": { + "@azure/arm-support": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/support/arm-support/samples/v2/javascript/sample.env b/sdk/support/arm-support/samples/v2/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/support/arm-support/samples/v2/javascript/updateContactDetailsOfASupportTicket.js b/sdk/support/arm-support/samples/v2/javascript/updateContactDetailsOfASupportTicket.js new file mode 100644 index 000000000000..b9ac6df6c333 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/updateContactDetailsOfASupportTicket.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * + * @summary This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateContactDetailsOfSupportTicketForSubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function updateContactDetailsOfASupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const updateSupportTicket = { + contactDetails: { + additionalEmailAddresses: ["tname@contoso.com", "teamtest@contoso.com"], + country: "USA", + firstName: "first name", + lastName: "last name", + phoneNumber: "123-456-7890", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "test.name@contoso.com", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.update(supportTicketName, updateSupportTicket); + console.log(result); +} + +updateContactDetailsOfASupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/updateSeverityOfASupportTicket.js b/sdk/support/arm-support/samples/v2/javascript/updateSeverityOfASupportTicket.js new file mode 100644 index 000000000000..5a2b9b56c11b --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/updateSeverityOfASupportTicket.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * + * @summary This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateSeverityOfSupportTicketForSubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function updateSeverityOfASupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const updateSupportTicket = { severity: "critical" }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.update(supportTicketName, updateSupportTicket); + console.log(result); +} + +updateSeverityOfASupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/javascript/updateStatusOfASupportTicket.js b/sdk/support/arm-support/samples/v2/javascript/updateStatusOfASupportTicket.js new file mode 100644 index 000000000000..c94c727edad4 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/javascript/updateStatusOfASupportTicket.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * + * @summary This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateStatusOfSupportTicketForSubscription.json + */ +const { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function updateStatusOfASupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const updateSupportTicket = { status: "closed" }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.update(supportTicketName, updateSupportTicket); + console.log(result); +} + +updateStatusOfASupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/README.md b/sdk/support/arm-support/samples/v2/typescript/README.md new file mode 100644 index 000000000000..d7a0cac0241a --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/README.md @@ -0,0 +1,133 @@ +# client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [addCommunicationToSubscriptionTicket.ts][addcommunicationtosubscriptionticket] | Adds a new customer communication to an Azure support ticket. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSupportTicketCommunication.json | +| [checksWhetherNameIsAvailableForCommunicationResource.ts][checkswhethernameisavailableforcommunicationresource] | Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding a new communication to the support ticket. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityForSupportTicketCommunication.json | +| [checksWhetherNameIsAvailableForSupportTicketResource.ts][checkswhethernameisavailableforsupportticketresource] | Check the availability of a resource name. This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityWithSubscription.json | +| [createATicketForBillingRelatedIssues.ts][createaticketforbillingrelatedissues] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBillingSupportTicketForSubscription.json | +| [createATicketForSubscriptionManagementRelatedIssues.ts][createaticketforsubscriptionmanagementrelatedissues] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json | +| [createATicketForTechnicalIssueRelatedToASpecificResource.ts][createaticketfortechnicalissuerelatedtoaspecificresource] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateTechnicalSupportTicketForSubscription.json | +| [createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.ts][createatickettorequestquotaincreaseforactivejobsandjobschedulesforabatchaccount] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json | +| [createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.ts][createatickettorequestquotaincreaseforazuresqlmanagedinstance] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json | +| [createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.ts][createatickettorequestquotaincreaseforbatchaccountsforasubscription] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSubscription.json | +| [createATicketToRequestQuotaIncreaseForComputeVMCores.ts][createatickettorequestquotaincreaseforcomputevmcores] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateCoresQuotaTicketForSubscription.json | +| [createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.ts][createatickettorequestquotaincreasefordtusforazuresynapseanalytics] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json | +| [createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.ts][createatickettorequestquotaincreasefordtusforsqldatabase] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json | +| [createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.ts][createatickettorequestquotaincreaseforlowprioritycoresforabatchaccount] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json | +| [createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.ts][createatickettorequestquotaincreaseforlowprioritycoresformachinelearningservice] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json | +| [createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.ts][createatickettorequestquotaincreaseforpoolsforabatchaccount] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json | +| [createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.ts][createatickettorequestquotaincreaseforserversforazuresynapseanalytics] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json | +| [createATicketToRequestQuotaIncreaseForServersForSqlDatabase.ts][createatickettorequestquotaincreaseforserversforsqldatabase] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json | +| [createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.ts][createatickettorequestquotaincreaseforservicesthatdonotrequireadditionaldetailsinthequotaticketdetailsobject] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateGenericQuotaTicket.json | +| [createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.ts][createatickettorequestquotaincreaseforspecificvmfamilycoresforabatchaccount] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json | +| [createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.ts][createatickettorequestquotaincreaseforspecificvmfamilycoresformachinelearningservice] | Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json | +| [getAllOperations.ts][getalloperations] | This lists all the available Microsoft Support REST API operations. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListOperations.json | +| [getCommunicationDetailsForASubscriptionSupportTicket.ts][getcommunicationdetailsforasubscriptionsupportticket] | Returns communication details for a support ticket. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json | +| [getDetailsOfASubscriptionTicket.ts][getdetailsofasubscriptionticket] | Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetSubscriptionSupportTicketDetails.json | +| [getsDetailsOfProblemClassificationForAzureService.ts][getsdetailsofproblemclassificationforazureservice] | Get problem classification details for a specific Azure service. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetProblemClassification.json | +| [getsDetailsOfTheAzureService.ts][getsdetailsoftheazureservice] | Gets a specific Azure service for support ticket creation. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetService.json | +| [getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.ts][getslistofproblemclassificationsforaserviceforwhichasupportticketcanbecreated] | Lists all the problem classifications (categories) available for a specific Azure service. Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListProblemClassifications.json | +| [getsListOfServicesForWhichASupportTicketCanBeCreated.ts][getslistofservicesforwhichasupportticketcanbecreated] | Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's [New support request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. Always use the service and its corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListServices.json | +| [listCommunicationsForASubscriptionSupportTicket.ts][listcommunicationsforasubscriptionsupportticket] | Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListCommunicationsForSubscriptionSupportTicket.json | +| [listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.ts][listsupportticketscreatedonorafteracertaindateandinopenstateforasubscription] | Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json | +| [listSupportTicketsForASubscription.ts][listsupportticketsforasubscription] | Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json | +| [listSupportTicketsInOpenStateForASubscription.ts][listsupportticketsinopenstateforasubscription] | Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json | +| [listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.ts][listwebcommunicationcreatedonorafteraspecificdateforasubscriptionsupportticket] | Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json | +| [listWebCommunicationsForASubscriptionSupportTicket.ts][listwebcommunicationsforasubscriptionsupportticket] | Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicket.json | +| [updateContactDetailsOfASupportTicket.ts][updatecontactdetailsofasupportticket] | This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateContactDetailsOfSupportTicketForSubscription.json | +| [updateSeverityOfASupportTicket.ts][updateseverityofasupportticket] | This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateSeverityOfSupportTicketForSubscription.json | +| [updateStatusOfASupportTicket.ts][updatestatusofasupportticket] | This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateStatusOfSupportTicketForSubscription.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/addCommunicationToSubscriptionTicket.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/addCommunicationToSubscriptionTicket.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[addcommunicationtosubscriptionticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/addCommunicationToSubscriptionTicket.ts +[checkswhethernameisavailableforcommunicationresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/checksWhetherNameIsAvailableForCommunicationResource.ts +[checkswhethernameisavailableforsupportticketresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/checksWhetherNameIsAvailableForSupportTicketResource.ts +[createaticketforbillingrelatedissues]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketForBillingRelatedIssues.ts +[createaticketforsubscriptionmanagementrelatedissues]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketForSubscriptionManagementRelatedIssues.ts +[createaticketfortechnicalissuerelatedtoaspecificresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketForTechnicalIssueRelatedToASpecificResource.ts +[createatickettorequestquotaincreaseforactivejobsandjobschedulesforabatchaccount]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.ts +[createatickettorequestquotaincreaseforazuresqlmanagedinstance]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.ts +[createatickettorequestquotaincreaseforbatchaccountsforasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.ts +[createatickettorequestquotaincreaseforcomputevmcores]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForComputeVMCores.ts +[createatickettorequestquotaincreasefordtusforazuresynapseanalytics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.ts +[createatickettorequestquotaincreasefordtusforsqldatabase]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.ts +[createatickettorequestquotaincreaseforlowprioritycoresforabatchaccount]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.ts +[createatickettorequestquotaincreaseforlowprioritycoresformachinelearningservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.ts +[createatickettorequestquotaincreaseforpoolsforabatchaccount]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.ts +[createatickettorequestquotaincreaseforserversforazuresynapseanalytics]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.ts +[createatickettorequestquotaincreaseforserversforsqldatabase]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.ts +[createatickettorequestquotaincreaseforservicesthatdonotrequireadditionaldetailsinthequotaticketdetailsobject]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.ts +[createatickettorequestquotaincreaseforspecificvmfamilycoresforabatchaccount]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.ts +[createatickettorequestquotaincreaseforspecificvmfamilycoresformachinelearningservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.ts +[getalloperations]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/getAllOperations.ts +[getcommunicationdetailsforasubscriptionsupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/getCommunicationDetailsForASubscriptionSupportTicket.ts +[getdetailsofasubscriptionticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/getDetailsOfASubscriptionTicket.ts +[getsdetailsofproblemclassificationforazureservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/getsDetailsOfProblemClassificationForAzureService.ts +[getsdetailsoftheazureservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/getsDetailsOfTheAzureService.ts +[getslistofproblemclassificationsforaserviceforwhichasupportticketcanbecreated]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.ts +[getslistofservicesforwhichasupportticketcanbecreated]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/getsListOfServicesForWhichASupportTicketCanBeCreated.ts +[listcommunicationsforasubscriptionsupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/listCommunicationsForASubscriptionSupportTicket.ts +[listsupportticketscreatedonorafteracertaindateandinopenstateforasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.ts +[listsupportticketsforasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsForASubscription.ts +[listsupportticketsinopenstateforasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsInOpenStateForASubscription.ts +[listwebcommunicationcreatedonorafteraspecificdateforasubscriptionsupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.ts +[listwebcommunicationsforasubscriptionsupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/listWebCommunicationsForASubscriptionSupportTicket.ts +[updatecontactdetailsofasupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/updateContactDetailsOfASupportTicket.ts +[updateseverityofasupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/updateSeverityOfASupportTicket.ts +[updatestatusofasupportticket]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/support/arm-support/samples/v2/typescript/src/updateStatusOfASupportTicket.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-support?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/support/arm-support/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/support/arm-support/samples/v2/typescript/package.json b/sdk/support/arm-support/samples/v2/typescript/package.json new file mode 100644 index 000000000000..b870069bf9e9 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "azure-arm-support-samples-ts", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/support/arm-support" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/support/arm-support", + "dependencies": { + "@azure/arm-support": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.4.0", + "rimraf": "latest" + } +} diff --git a/sdk/support/arm-support/samples/v2/typescript/sample.env b/sdk/support/arm-support/samples/v2/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/support/arm-support/samples/v2/typescript/src/addCommunicationToSubscriptionTicket.ts b/sdk/support/arm-support/samples/v2/typescript/src/addCommunicationToSubscriptionTicket.ts new file mode 100644 index 000000000000..9971f4f8a52d --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/addCommunicationToSubscriptionTicket.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Adds a new customer communication to an Azure support ticket. + * + * @summary Adds a new customer communication to an Azure support ticket. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSupportTicketCommunication.json + */ +import { CommunicationDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function addCommunicationToSubscriptionTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const communicationName = "testcommunication"; + const createCommunicationParameters: CommunicationDetails = { + body: "This is a test message from a customer!", + sender: "user@contoso.com", + subject: "This is a test message from a customer!" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.communications.beginCreateAndWait( + supportTicketName, + communicationName, + createCommunicationParameters + ); + console.log(result); +} + +addCommunicationToSubscriptionTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/checksWhetherNameIsAvailableForCommunicationResource.ts b/sdk/support/arm-support/samples/v2/typescript/src/checksWhetherNameIsAvailableForCommunicationResource.ts new file mode 100644 index 000000000000..7da7711ea00d --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/checksWhetherNameIsAvailableForCommunicationResource.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding a new communication to the support ticket. + * + * @summary Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding a new communication to the support ticket. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityForSupportTicketCommunication.json + */ +import { + CheckNameAvailabilityInput, + MicrosoftSupport +} from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function checksWhetherNameIsAvailableForCommunicationResource() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const checkNameAvailabilityInput: CheckNameAvailabilityInput = { + name: "sampleName", + type: "Microsoft.Support/communications" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.communications.checkNameAvailability( + supportTicketName, + checkNameAvailabilityInput + ); + console.log(result); +} + +checksWhetherNameIsAvailableForCommunicationResource().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/checksWhetherNameIsAvailableForSupportTicketResource.ts b/sdk/support/arm-support/samples/v2/typescript/src/checksWhetherNameIsAvailableForSupportTicketResource.ts new file mode 100644 index 000000000000..f814e22d1d14 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/checksWhetherNameIsAvailableForSupportTicketResource.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Check the availability of a resource name. This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription. + * + * @summary Check the availability of a resource name. This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityWithSubscription.json + */ +import { + CheckNameAvailabilityInput, + MicrosoftSupport +} from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function checksWhetherNameIsAvailableForSupportTicketResource() { + const subscriptionId = "subid"; + const checkNameAvailabilityInput: CheckNameAvailabilityInput = { + name: "sampleName", + type: "Microsoft.Support/supportTickets" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.checkNameAvailability( + checkNameAvailabilityInput + ); + console.log(result); +} + +checksWhetherNameIsAvailableForSupportTicketResource().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketForBillingRelatedIssues.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketForBillingRelatedIssues.ts new file mode 100644 index 000000000000..34516017c36a --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketForBillingRelatedIssues.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBillingSupportTicketForSubscription.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketForBillingRelatedIssues() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid", + serviceId: "/providers/Microsoft.Support/services/billing_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketForBillingRelatedIssues().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketForSubscriptionManagementRelatedIssues.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketForSubscriptionManagementRelatedIssues.ts new file mode 100644 index 000000000000..b63e964f18c5 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketForSubscriptionManagementRelatedIssues.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketForSubscriptionManagementRelatedIssues() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid", + serviceId: + "/providers/Microsoft.Support/services/subscription_management_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketForSubscriptionManagementRelatedIssues().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketForTechnicalIssueRelatedToASpecificResource.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketForTechnicalIssueRelatedToASpecificResource.ts new file mode 100644 index 000000000000..f04be53522e1 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketForTechnicalIssueRelatedToASpecificResource.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateTechnicalSupportTicketForSubscription.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketForTechnicalIssueRelatedToASpecificResource() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid", + serviceId: + "/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc", + severity: "moderate", + technicalTicketDetails: { + resourceId: + "/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver" + }, + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketForTechnicalIssueRelatedToASpecificResource().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.ts new file mode 100644 index 000000000000..b3b689c6415e --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"AccountName":"test","NewLimit":200,"Type":"Jobs"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.ts new file mode 100644 index 000000000000..f098cc4a802d --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "SQLMI", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"NewLimit":200, "Metadata":null, "Type":"vCore"}', + region: "EastUS" + }, + { + payload: '{"NewLimit":200, "Metadata":null, "Type":"Subnet"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.ts new file mode 100644 index 000000000000..625399a8cf61 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSubscription.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Subscription", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { payload: '{"NewLimit":200,"Type":"Account"}', region: "EastUS" } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForComputeVMCores.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForComputeVMCores.ts new file mode 100644 index 000000000000..c6ea993340b3 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForComputeVMCores.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateCoresQuotaTicketForSubscription.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForComputeVMCores() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { payload: '{"SKU":"DSv3 Series","NewLimit":104}', region: "EastUS" } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForComputeVMCores().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.ts new file mode 100644 index 000000000000..148732dba08c --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "DTUs", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"ServerName":"testserver","NewLimit":54000}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.ts new file mode 100644 index 000000000000..212a7dc268e3 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "DTUs", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"ServerName":"testserver","NewLimit":54000}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.ts new file mode 100644 index 000000000000..abfd853c5655 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"AccountName":"test","NewLimit":200,"Type":"LowPriority"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.ts new file mode 100644 index 000000000000..8af9beeff08c --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "BatchAml", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { payload: '{"NewLimit":200,"Type":"LowPriority"}', region: "EastUS" } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.ts new file mode 100644 index 000000000000..97b68dedd741 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForPoolsForABatchAccount.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForPoolsForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: '{"AccountName":"test","NewLimit":200,"Type":"Pools"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForPoolsForABatchAccount().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.ts new file mode 100644 index 000000000000..a1df8bec50c9 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Servers", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [{ payload: '{"NewLimit":200}', region: "EastUS" }] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.ts new file mode 100644 index 000000000000..03714c9ffece --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServersForSqlDatabase.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForServersForSqlDatabase() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Servers", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [{ payload: '{"NewLimit":200}', region: "EastUS" }] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForServersForSqlDatabase().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.ts new file mode 100644 index 000000000000..910683fdc4ba --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateGenericQuotaTicket.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: + "Increase the maximum throughput per container limit to 10000 for account foo bar", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid", + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.ts new file mode 100644 index 000000000000..be6f35af5ffa --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "Account", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: + '{"AccountName":"test","VMFamily":"standardA0_A7Family","NewLimit":200,"Type":"Dedicated"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.ts b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.ts new file mode 100644 index 000000000000..0c555c976686 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * + * @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.

Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.

Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.

**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json + */ +import { SupportTicketDetails, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const createSupportTicketParameters: SupportTicketDetails = { + description: "my description", + contactDetails: { + country: "usa", + firstName: "abc", + lastName: "xyz", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "abc@contoso.com" + }, + problemClassificationId: + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid", + quotaTicketDetails: { + quotaChangeRequestSubType: "BatchAml", + quotaChangeRequestVersion: "1.0", + quotaChangeRequests: [ + { + payload: + '{"VMFamily":"standardA0_A7Family","NewLimit":200,"Type":"Dedicated"}', + region: "EastUS" + } + ] + }, + serviceId: "/providers/Microsoft.Support/services/quota_service_guid", + severity: "moderate", + title: "my title" + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.beginCreateAndWait( + supportTicketName, + createSupportTicketParameters + ); + console.log(result); +} + +createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/getAllOperations.ts b/sdk/support/arm-support/samples/v2/typescript/src/getAllOperations.ts new file mode 100644 index 000000000000..29734338b812 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/getAllOperations.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This lists all the available Microsoft Support REST API operations. + * + * @summary This lists all the available Microsoft Support REST API operations. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListOperations.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAllOperations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAllOperations().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/getCommunicationDetailsForASubscriptionSupportTicket.ts b/sdk/support/arm-support/samples/v2/typescript/src/getCommunicationDetailsForASubscriptionSupportTicket.ts new file mode 100644 index 000000000000..44a494ae23c4 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/getCommunicationDetailsForASubscriptionSupportTicket.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Returns communication details for a support ticket. + * + * @summary Returns communication details for a support ticket. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getCommunicationDetailsForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const communicationName = "testmessage"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.communications.get( + supportTicketName, + communicationName + ); + console.log(result); +} + +getCommunicationDetailsForASubscriptionSupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/getDetailsOfASubscriptionTicket.ts b/sdk/support/arm-support/samples/v2/typescript/src/getDetailsOfASubscriptionTicket.ts new file mode 100644 index 000000000000..0455e6316900 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/getDetailsOfASubscriptionTicket.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetSubscriptionSupportTicketDetails.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getDetailsOfASubscriptionTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.get(supportTicketName); + console.log(result); +} + +getDetailsOfASubscriptionTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/getsDetailsOfProblemClassificationForAzureService.ts b/sdk/support/arm-support/samples/v2/typescript/src/getsDetailsOfProblemClassificationForAzureService.ts new file mode 100644 index 000000000000..89b045abedde --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/getsDetailsOfProblemClassificationForAzureService.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Get problem classification details for a specific Azure service. + * + * @summary Get problem classification details for a specific Azure service. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetProblemClassification.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getsDetailsOfProblemClassificationForAzureService() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const serviceName = "service_guid"; + const problemClassificationName = "problemClassification_guid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.problemClassifications.get( + serviceName, + problemClassificationName + ); + console.log(result); +} + +getsDetailsOfProblemClassificationForAzureService().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/getsDetailsOfTheAzureService.ts b/sdk/support/arm-support/samples/v2/typescript/src/getsDetailsOfTheAzureService.ts new file mode 100644 index 000000000000..b9454da56179 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/getsDetailsOfTheAzureService.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a specific Azure service for support ticket creation. + * + * @summary Gets a specific Azure service for support ticket creation. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetService.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getsDetailsOfTheAzureService() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const serviceName = "service_guid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.services.get(serviceName); + console.log(result); +} + +getsDetailsOfTheAzureService().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.ts b/sdk/support/arm-support/samples/v2/typescript/src/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.ts new file mode 100644 index 000000000000..f46d4bc52b56 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the problem classifications (categories) available for a specific Azure service. Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @summary Lists all the problem classifications (categories) available for a specific Azure service. Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListProblemClassifications.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const serviceName = "service_guid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.problemClassifications.list(serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/getsListOfServicesForWhichASupportTicketCanBeCreated.ts b/sdk/support/arm-support/samples/v2/typescript/src/getsListOfServicesForWhichASupportTicketCanBeCreated.ts new file mode 100644 index 000000000000..1ac1c31291da --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/getsListOfServicesForWhichASupportTicketCanBeCreated.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's [New support request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. Always use the service and its corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @summary Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's [New support request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. Always use the service and its corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListServices.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getsListOfServicesForWhichASupportTicketCanBeCreated() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getsListOfServicesForWhichASupportTicketCanBeCreated().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/listCommunicationsForASubscriptionSupportTicket.ts b/sdk/support/arm-support/samples/v2/typescript/src/listCommunicationsForASubscriptionSupportTicket.ts new file mode 100644 index 000000000000..a27f153f2cf7 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/listCommunicationsForASubscriptionSupportTicket.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListCommunicationsForSubscriptionSupportTicket.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listCommunicationsForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.communications.list(supportTicketName)) { + resArray.push(item); + } + console.log(resArray); +} + +listCommunicationsForASubscriptionSupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.ts b/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.ts new file mode 100644 index 000000000000..fc6bb83fa6f1 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription() { + const subscriptionId = "subid"; + const filter = "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.supportTickets.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsForASubscription.ts b/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsForASubscription.ts new file mode 100644 index 000000000000..d3e421ddfe48 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsForASubscription.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listSupportTicketsForASubscription() { + const subscriptionId = "subid"; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.supportTickets.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listSupportTicketsForASubscription().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsInOpenStateForASubscription.ts b/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsInOpenStateForASubscription.ts new file mode 100644 index 000000000000..a24c27e8279e --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/listSupportTicketsInOpenStateForASubscription.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listSupportTicketsInOpenStateForASubscription() { + const subscriptionId = "subid"; + const filter = "status eq 'Open'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.supportTickets.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listSupportTicketsInOpenStateForASubscription().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.ts b/sdk/support/arm-support/samples/v2/typescript/src/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.ts new file mode 100644 index 000000000000..bdfccbe78801 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const filter = + "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.communications.list( + supportTicketName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket().catch( + console.error +); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/listWebCommunicationsForASubscriptionSupportTicket.ts b/sdk/support/arm-support/samples/v2/typescript/src/listWebCommunicationsForASubscriptionSupportTicket.ts new file mode 100644 index 000000000000..a2985f623a45 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/listWebCommunicationsForASubscriptionSupportTicket.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * + * @summary Lists all communications (attachments not included) for a support ticket.

You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.

Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicket.json + */ +import { MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listWebCommunicationsForASubscriptionSupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const filter = "communicationType eq 'web'"; + const options = { filter: filter }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.communications.list( + supportTicketName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +listWebCommunicationsForASubscriptionSupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/updateContactDetailsOfASupportTicket.ts b/sdk/support/arm-support/samples/v2/typescript/src/updateContactDetailsOfASupportTicket.ts new file mode 100644 index 000000000000..6ca81a2a915d --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/updateContactDetailsOfASupportTicket.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * + * @summary This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateContactDetailsOfSupportTicketForSubscription.json + */ +import { UpdateSupportTicket, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateContactDetailsOfASupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const updateSupportTicket: UpdateSupportTicket = { + contactDetails: { + additionalEmailAddresses: ["tname@contoso.com", "teamtest@contoso.com"], + country: "USA", + firstName: "first name", + lastName: "last name", + phoneNumber: "123-456-7890", + preferredContactMethod: "email", + preferredSupportLanguage: "en-US", + preferredTimeZone: "Pacific Standard Time", + primaryEmailAddress: "test.name@contoso.com" + } + }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.update( + supportTicketName, + updateSupportTicket + ); + console.log(result); +} + +updateContactDetailsOfASupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/updateSeverityOfASupportTicket.ts b/sdk/support/arm-support/samples/v2/typescript/src/updateSeverityOfASupportTicket.ts new file mode 100644 index 000000000000..08f3d5990ee7 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/updateSeverityOfASupportTicket.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * + * @summary This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateSeverityOfSupportTicketForSubscription.json + */ +import { UpdateSupportTicket, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateSeverityOfASupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const updateSupportTicket: UpdateSupportTicket = { severity: "critical" }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.update( + supportTicketName, + updateSupportTicket + ); + console.log(result); +} + +updateSeverityOfASupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/src/updateStatusOfASupportTicket.ts b/sdk/support/arm-support/samples/v2/typescript/src/updateStatusOfASupportTicket.ts new file mode 100644 index 000000000000..128921f477a4 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/src/updateStatusOfASupportTicket.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * + * @summary This API allows you to update the severity level, ticket status, and your contact information in the support ticket.

Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer. + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateStatusOfSupportTicketForSubscription.json + */ +import { UpdateSupportTicket, MicrosoftSupport } from "@azure/arm-support"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateStatusOfASupportTicket() { + const subscriptionId = "subid"; + const supportTicketName = "testticket"; + const updateSupportTicket: UpdateSupportTicket = { status: "closed" }; + const credential = new DefaultAzureCredential(); + const client = new MicrosoftSupport(credential, subscriptionId); + const result = await client.supportTickets.update( + supportTicketName, + updateSupportTicket + ); + console.log(result); +} + +updateStatusOfASupportTicket().catch(console.error); diff --git a/sdk/support/arm-support/samples/v2/typescript/tsconfig.json b/sdk/support/arm-support/samples/v2/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/support/arm-support/samples/v2/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/support/arm-support/src/index.ts b/sdk/support/arm-support/src/index.ts new file mode 100644 index 000000000000..4338b89000eb --- /dev/null +++ b/sdk/support/arm-support/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { MicrosoftSupport } from "./microsoftSupport"; +export * from "./operationsInterfaces"; diff --git a/sdk/support/arm-support/src/lroImpl.ts b/sdk/support/arm-support/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/support/arm-support/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/support/arm-support/src/microsoftSupport.ts b/sdk/support/arm-support/src/microsoftSupport.ts index 4b52aeb0dd1e..5d87d19647cc 100644 --- a/sdk/support/arm-support/src/microsoftSupport.ts +++ b/sdk/support/arm-support/src/microsoftSupport.ts @@ -1,50 +1,95 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { MicrosoftSupportContext } from "./microsoftSupportContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + ServicesImpl, + ProblemClassificationsImpl, + SupportTicketsImpl, + CommunicationsImpl +} from "./operations"; +import { + Operations, + Services, + ProblemClassifications, + SupportTickets, + Communications +} from "./operationsInterfaces"; +import { MicrosoftSupportOptionalParams } from "./models"; - -class MicrosoftSupport extends MicrosoftSupportContext { - // Operation groups - operations: operations.Operations; - services: operations.Services; - problemClassifications: operations.ProblemClassifications; - supportTickets: operations.SupportTickets; - communications: operations.Communications; +export class MicrosoftSupport extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the MicrosoftSupport class. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Azure subscription Id. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MicrosoftSupportOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.services = new operations.Services(this); - this.problemClassifications = new operations.ProblemClassifications(this); - this.supportTickets = new operations.SupportTickets(this); - this.communications = new operations.Communications(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: MicrosoftSupportOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MicrosoftSupportOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-support/2.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - MicrosoftSupport, - MicrosoftSupportContext, - Models as MicrosoftSupportModels, - Mappers as MicrosoftSupportMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2020-04-01"; + this.operations = new OperationsImpl(this); + this.services = new ServicesImpl(this); + this.problemClassifications = new ProblemClassificationsImpl(this); + this.supportTickets = new SupportTicketsImpl(this); + this.communications = new CommunicationsImpl(this); + } + + operations: Operations; + services: Services; + problemClassifications: ProblemClassifications; + supportTickets: SupportTickets; + communications: Communications; +} diff --git a/sdk/support/arm-support/src/microsoftSupportContext.ts b/sdk/support/arm-support/src/microsoftSupportContext.ts deleted file mode 100644 index 2ba89d1d59f5..000000000000 --- a/sdk/support/arm-support/src/microsoftSupportContext.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-support"; -const packageVersion = "1.0.0"; - -export class MicrosoftSupportContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the MicrosoftSupport class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId Azure subscription Id. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MicrosoftSupportOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2020-04-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/support/arm-support/src/models/communicationsMappers.ts b/sdk/support/arm-support/src/models/communicationsMappers.ts deleted file mode 100644 index 1fe4bc2a7c5a..000000000000 --- a/sdk/support/arm-support/src/models/communicationsMappers.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CheckNameAvailabilityInput, - CheckNameAvailabilityOutput, - CommunicationDetails, - CommunicationsListResult, - ContactProfile, - ExceptionResponse, - QuotaChangeRequest, - QuotaTicketDetails, - ServiceError, - ServiceErrorDetail, - ServiceLevelAgreement, - SupportEngineer, - SupportTicketDetails, - TechnicalTicketDetails -} from "../models/mappers"; diff --git a/sdk/support/arm-support/src/models/index.ts b/sdk/support/arm-support/src/models/index.ts index 0a2c2da2c521..b2ab9bb31503 100644 --- a/sdk/support/arm-support/src/models/index.ts +++ b/sdk/support/arm-support/src/models/index.ts @@ -1,1050 +1,653 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +/** The list of operations supported by Microsoft Support resource provider. */ +export interface OperationsListResult { + /** The list of operations supported by Microsoft Support resource provider. */ + value?: Operation[]; +} -/** - * The object that describes the operation. - */ +/** The operation supported by Microsoft Support resource provider. */ +export interface Operation { + /** + * Operation name: {provider}/{resource}/{operation}. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** The object that describes the operation. */ + display?: OperationDisplay; +} + +/** The object that describes the operation. */ export interface OperationDisplay { /** * The description of the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly description?: string; /** * The action that users can perform, based on their permission level. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly operation?: string; /** * Service provider: Microsoft Support. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provider?: string; /** * Resource on which the operation is performed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resource?: string; } -/** - * The operation supported by Microsoft Support resource provider. - */ -export interface Operation { +/** The API error. */ +export interface ExceptionResponse { + /** The API error details. */ + error?: ServiceError; +} + +/** The API error details. */ +export interface ServiceError { + /** The error code. */ + code?: string; + /** The error message. */ + message?: string; + /** The target of the error. */ + target?: string; /** - * Operation name: {provider}/{resource}/{operation}. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly details?: ServiceErrorDetail[]; +} + +/** The error details. */ +export interface ServiceErrorDetail { /** - * The object that describes the operation. + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - display?: OperationDisplay; + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** The target of the error. */ + target?: string; } -/** - * Object that represents a Service resource. - */ +/** Collection of Service resources. */ +export interface ServicesListResult { + /** List of Service resources. */ + value?: Service[]; +} + +/** Object that represents a Service resource. */ export interface Service { /** * Id of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * Name of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * Type of the resource 'Microsoft.Support/services'. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** - * Localized name of the Azure service. - */ + /** Localized name of the Azure service. */ displayName?: string; - /** - * ARM Resource types. - */ + /** ARM Resource types. */ resourceTypes?: string[]; } -/** - * ProblemClassification resource object. - */ +/** Collection of ProblemClassification resources. */ +export interface ProblemClassificationsListResult { + /** List of ProblemClassification resources. */ + value?: ProblemClassification[]; +} + +/** ProblemClassification resource object. */ export interface ProblemClassification { /** * Id of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * Name of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * Type of the resource 'Microsoft.Support/problemClassification'. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** - * Localized name of problem classification. - */ + /** Localized name of problem classification. */ displayName?: string; } -/** - * Input of CheckNameAvailability API. - */ +/** Input of CheckNameAvailability API. */ export interface CheckNameAvailabilityInput { - /** - * The resource name to validate. - */ + /** The resource name to validate. */ name: string; - /** - * The type of resource. Possible values include: 'Microsoft.Support/supportTickets', - * 'Microsoft.Support/communications' - */ + /** The type of resource. */ type: Type; } -/** - * Output of check name availability API. - */ +/** Output of check name availability API. */ export interface CheckNameAvailabilityOutput { /** * Indicates whether the name is available. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nameAvailable?: boolean; /** * The reason why the name is not available. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly reason?: string; /** * The detailed error message describing why the name is not available. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly message?: string; } -/** - * Contact information associated with the support ticket. - */ -export interface ContactProfile { - /** - * First name. - */ - firstName: string; - /** - * Last name. - */ - lastName: string; - /** - * Preferred contact method. Possible values include: 'email', 'phone' - */ - preferredContactMethod: PreferredContactMethod; - /** - * Primary email address. - */ - primaryEmailAddress: string; - /** - * Additional email addresses listed will be copied on any correspondence about the support - * ticket. - */ - additionalEmailAddresses?: string[]; - /** - * Phone number. This is required if preferred contact method is phone. - */ - phoneNumber?: string; - /** - * Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index - * Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). - */ - preferredTimeZone: string; - /** - * Country of the user. This is the ISO 3166-1 alpha-3 code. - */ - country: string; - /** - * Preferred language of support from Azure. Support languages vary based on the severity you - * choose for your support ticket. Learn more at [Azure Severity and - * responsiveness](https://azure.microsoft.com/support/plans/response). Use the standard - * language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' - * for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for - * Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for - * German. - */ - preferredSupportLanguage: string; -} - -/** - * Service Level Agreement details for a support ticket. - */ -export interface ServiceLevelAgreement { - /** - * Time in UTC (ISO 8601 format) when the service level agreement starts. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly startTime?: Date; - /** - * Time in UTC (ISO 8601 format) when the service level agreement expires. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly expirationTime?: Date; - /** - * Service Level Agreement in minutes. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly slaMinutes?: number; -} - -/** - * Support engineer information. - */ -export interface SupportEngineer { - /** - * Email address of the Azure Support engineer assigned to the support ticket. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly emailAddress?: string; -} - -/** - * Additional information for technical support ticket. - */ -export interface TechnicalTicketDetails { - /** - * This is the resource Id of the Azure service resource (For example: A virtual machine resource - * or an HDInsight resource) for which the support ticket is created. - */ - resourceId?: string; -} - -/** - * This property is required for providing the region and new quota limits. - */ -export interface QuotaChangeRequest { - /** - * Region for which the quota increase request is being made. - */ - region?: string; - /** - * Payload of the quota increase request. - */ - payload?: string; -} - -/** - * Additional set of information required for quota increase support ticket for certain quota - * types, e.g.: Virtual machine cores. Get complete details about Quota payload support request - * along with examples at [Support quota request](https://aka.ms/supportrpquotarequestpayload). - */ -export interface QuotaTicketDetails { - /** - * Required for certain quota types when there is a sub type, such as Batch, for which you are - * requesting a quota increase. - */ - quotaChangeRequestSubType?: string; - /** - * Quota change request version. - */ - quotaChangeRequestVersion?: string; - /** - * This property is required for providing the region and new quota limits. - */ - quotaChangeRequests?: QuotaChangeRequest[]; +/** Object that represents a collection of SupportTicket resources. */ +export interface SupportTicketsListResult { + /** List of SupportTicket resources. */ + value?: SupportTicketDetails[]; + /** The URI to fetch the next page of SupportTicket resources. */ + nextLink?: string; } -/** - * Object that represents SupportTicketDetails resource. - */ -export interface SupportTicketDetails extends BaseResource { +/** Object that represents SupportTicketDetails resource. */ +export interface SupportTicketDetails { /** * Id of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * Name of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * Type of the resource 'Microsoft.Support/supportTickets'. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** - * System generated support ticket Id that is unique. - */ + /** System generated support ticket Id that is unique. */ supportTicketId?: string; - /** - * Detailed description of the question or issue. - */ - description: string; - /** - * Each Azure service has its own set of issue categories, also known as problem classification. - * This parameter is the unique Id for the type of problem you are experiencing. - */ - problemClassificationId: string; + /** Detailed description of the question or issue. */ + description?: string; + /** Each Azure service has its own set of issue categories, also known as problem classification. This parameter is the unique Id for the type of problem you are experiencing. */ + problemClassificationId?: string; /** * Localized name of problem classification. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly problemClassificationDisplayName?: string; - /** - * A value that indicates the urgency of the case, which in turn determines the response time - * according to the service level agreement of the technical support plan you have with Azure. - * Note: 'Highest critical impact' severity is reserved only for our Premium customers. Possible - * values include: 'minimal', 'moderate', 'critical', 'highestcriticalimpact' - */ - severity: SeverityLevel; + /** A value that indicates the urgency of the case, which in turn determines the response time according to the service level agreement of the technical support plan you have with Azure. Note: 'Highest critical impact', also known as the 'Emergency - Severe impact' level in the Azure portal is reserved only for our Premium customers. */ + severity?: SeverityLevel; /** * Enrollment Id associated with the support ticket. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly enrollmentId?: string; - /** - * Indicates if this requires a 24x7 response from Azure. - */ + /** Indicates if this requires a 24x7 response from Azure. */ require24X7Response?: boolean; - /** - * Contact information of the user requesting to create a support ticket. - */ - contactDetails: ContactProfile; - /** - * Service Level Agreement information for this support ticket. - */ + /** Contact information of the user requesting to create a support ticket. */ + contactDetails?: ContactProfile; + /** Service Level Agreement information for this support ticket. */ serviceLevelAgreement?: ServiceLevelAgreement; - /** - * Information about the support engineer working on this support ticket. - */ + /** Information about the support engineer working on this support ticket. */ supportEngineer?: SupportEngineer; /** * Support plan type associated with the support ticket. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly supportPlanType?: string; - /** - * Title of the support ticket. - */ - title: string; - /** - * Time in UTC (ISO 8601 format) when the problem started. - */ + /** Title of the support ticket. */ + title?: string; + /** Time in UTC (ISO 8601 format) when the problem started. */ problemStartTime?: Date; - /** - * This is the resource Id of the Azure service resource associated with the support ticket. - */ - serviceId: string; + /** This is the resource Id of the Azure service resource associated with the support ticket. */ + serviceId?: string; /** * Localized name of the Azure service. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly serviceDisplayName?: string; /** * Status of the support ticket. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly status?: string; /** * Time in UTC (ISO 8601 format) when the support ticket was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly createdDate?: Date; /** * Time in UTC (ISO 8601 format) when the support ticket was last modified. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly modifiedDate?: Date; - /** - * Additional ticket details associated with a technical support ticket request. - */ + /** Additional ticket details associated with a technical support ticket request. */ technicalTicketDetails?: TechnicalTicketDetails; - /** - * Additional ticket details associated with a quota support ticket request. - */ + /** Additional ticket details associated with a quota support ticket request. */ quotaTicketDetails?: QuotaTicketDetails; } -/** - * Object that represents a Communication resource. - */ -export interface CommunicationDetails extends BaseResource { - /** - * Id of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Name of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Type of the resource 'Microsoft.Support/communications'. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * Communication type. Possible values include: 'web', 'phone' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly communicationType?: CommunicationType; - /** - * Direction of communication. Possible values include: 'inbound', 'outbound' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly communicationDirection?: CommunicationDirection; - /** - * Email address of the sender. This property is required if called by a service principal. - */ - sender?: string; - /** - * Subject of the communication. - */ - subject: string; - /** - * Body of the communication. - */ - body: string; - /** - * Time in UTC (ISO 8601 format) when the communication was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly createdDate?: Date; +/** Contact information associated with the support ticket. */ +export interface ContactProfile { + /** First name. */ + firstName: string; + /** Last name. */ + lastName: string; + /** Preferred contact method. */ + preferredContactMethod: PreferredContactMethod; + /** Primary email address. */ + primaryEmailAddress: string; + /** Additional email addresses listed will be copied on any correspondence about the support ticket. */ + additionalEmailAddresses?: string[]; + /** Phone number. This is required if preferred contact method is phone. */ + phoneNumber?: string; + /** Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). */ + preferredTimeZone: string; + /** Country of the user. This is the ISO 3166-1 alpha-3 code. */ + country: string; + /** Preferred language of support from Azure. Support languages vary based on the severity you choose for your support ticket. Learn more at [Azure Severity and responsiveness](https://azure.microsoft.com/support/plans/response). Use the standard language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for German. */ + preferredSupportLanguage: string; } -/** - * The error details. - */ -export interface ServiceErrorDetail { +/** Service Level Agreement details for a support ticket. */ +export interface ServiceLevelAgreement { /** - * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Time in UTC (ISO 8601 format) when the service level agreement starts. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly startTime?: Date; /** - * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Time in UTC (ISO 8601 format) when the service level agreement expires. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly expirationTime?: Date; /** - * The target of the error. + * Service Level Agreement in minutes. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - target?: string; + readonly slaMinutes?: number; } -/** - * The API error details. - */ -export interface ServiceError { - /** - * The error code. - */ - code?: string; - /** - * The error message. - */ - message?: string; - /** - * The target of the error. - */ - target?: string; +/** Support engineer information. */ +export interface SupportEngineer { /** - * The list of error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Email address of the Azure Support engineer assigned to the support ticket. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ServiceErrorDetail[]; + readonly emailAddress?: string; } -/** - * The API error. - */ -export interface ExceptionResponse { - /** - * The API error details. - */ - error?: ServiceError; +/** Additional information for technical support ticket. */ +export interface TechnicalTicketDetails { + /** This is the resource Id of the Azure service resource (For example: A virtual machine resource or an HDInsight resource) for which the support ticket is created. */ + resourceId?: string; } -/** - * Contact information associated with the support ticket. - */ +/** Additional set of information required for quota increase support ticket for certain quota types, e.g.: Virtual machine cores. Get complete details about Quota payload support request along with examples at [Support quota request](https://aka.ms/supportrpquotarequestpayload). */ +export interface QuotaTicketDetails { + /** Required for certain quota types when there is a sub type, such as Batch, for which you are requesting a quota increase. */ + quotaChangeRequestSubType?: string; + /** Quota change request version. */ + quotaChangeRequestVersion?: string; + /** This property is required for providing the region and new quota limits. */ + quotaChangeRequests?: QuotaChangeRequest[]; +} + +/** This property is required for providing the region and new quota limits. */ +export interface QuotaChangeRequest { + /** Region for which the quota increase request is being made. */ + region?: string; + /** Payload of the quota increase request. */ + payload?: string; +} + +/** Updates severity, ticket status, and contact details in the support ticket. */ +export interface UpdateSupportTicket { + /** Severity level. */ + severity?: SeverityLevel; + /** Status to be updated on the ticket. */ + status?: Status; + /** Contact details to be updated on the support ticket. */ + contactDetails?: UpdateContactProfile; +} + +/** Contact information associated with the support ticket. */ export interface UpdateContactProfile { - /** - * First name. - */ + /** First name. */ firstName?: string; - /** - * Last name. - */ + /** Last name. */ lastName?: string; - /** - * Preferred contact method. Possible values include: 'email', 'phone' - */ + /** Preferred contact method. */ preferredContactMethod?: PreferredContactMethod; - /** - * Primary email address. - */ + /** Primary email address. */ primaryEmailAddress?: string; - /** - * Email addresses listed will be copied on any correspondence about the support ticket. - */ + /** Email addresses listed will be copied on any correspondence about the support ticket. */ additionalEmailAddresses?: string[]; - /** - * Phone number. This is required if preferred contact method is phone. - */ + /** Phone number. This is required if preferred contact method is phone. */ phoneNumber?: string; - /** - * Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index - * Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). - */ + /** Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). */ preferredTimeZone?: string; - /** - * Country of the user. This is the ISO 3166-1 alpha-3 code. - */ + /** Country of the user. This is the ISO 3166-1 alpha-3 code. */ country?: string; - /** - * Preferred language of support from Azure. Support languages vary based on the severity you - * choose for your support ticket. Learn more at [Azure Severity and - * responsiveness](https://azure.microsoft.com/support/plans/response/). Use the standard - * language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' - * for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for - * Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for - * German. - */ + /** Preferred language of support from Azure. Support languages vary based on the severity you choose for your support ticket. Learn more at [Azure Severity and responsiveness](https://azure.microsoft.com/support/plans/response/). Use the standard language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for German. */ preferredSupportLanguage?: string; } -/** - * Updates severity, ticket status, and contact details in the support ticket. - */ -export interface UpdateSupportTicket { - /** - * Severity level. Possible values include: 'minimal', 'moderate', 'critical', - * 'highestcriticalimpact' - */ - severity?: SeverityLevel; +/** Collection of Communication resources. */ +export interface CommunicationsListResult { + /** List of Communication resources. */ + value?: CommunicationDetails[]; + /** The URI to fetch the next page of Communication resources. */ + nextLink?: string; +} + +/** Object that represents a Communication resource. */ +export interface CommunicationDetails { /** - * Status to be updated on the ticket. Possible values include: 'open', 'closed' + * Id of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status?: Status; + readonly id?: string; /** - * Contact details to be updated on the support ticket. + * Name of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - contactDetails?: UpdateContactProfile; -} - -/** - * Optional Parameters. - */ -export interface SupportTicketsListOptionalParams extends msRest.RequestOptionsBase { + readonly name?: string; /** - * The number of values to return in the collection. Default is 25 and max is 100. + * Type of the resource 'Microsoft.Support/communications'. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly type?: string; /** - * The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn - * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_ filter can - * only be used with Equals ('eq') operator. For _CreatedDate_ filter, the supported operators - * are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine - * them using the logical 'AND'. + * Communication type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface CommunicationsListOptionalParams extends msRest.RequestOptionsBase { + readonly communicationType?: CommunicationType; /** - * The number of values to return in the collection. Default is 10 and max is 10. + * Direction of communication. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly communicationDirection?: CommunicationDirection; + /** Email address of the sender. This property is required if called by a service principal. */ + sender?: string; + /** Subject of the communication. */ + subject?: string; + /** Body of the communication. */ + body?: string; /** - * The filter to apply on the operation. You can filter by communicationType and createdDate - * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater - * Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType - * and CreatedDate filters by Logical And ('and') operator. + * Time in UTC (ISO 8601 format) when the communication was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly createdDate?: Date; } -/** - * An interface representing MicrosoftSupportOptions. - */ -export interface MicrosoftSupportOptions extends AzureServiceClientOptions { - baseUri?: string; +/** Known values of {@link SeverityLevel} that the service accepts. */ +export enum KnownSeverityLevel { + Minimal = "minimal", + Moderate = "moderate", + Critical = "critical", + Highestcriticalimpact = "highestcriticalimpact" } /** - * @interface - * The list of operations supported by Microsoft Support resource provider. - * @extends Array + * Defines values for SeverityLevel. \ + * {@link KnownSeverityLevel} can be used interchangeably with SeverityLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **minimal** \ + * **moderate** \ + * **critical** \ + * **highestcriticalimpact** */ -export interface OperationsListResult extends Array { -} +export type SeverityLevel = string; -/** - * @interface - * Collection of Service resources. - * @extends Array - */ -export interface ServicesListResult extends Array { +/** Known values of {@link PreferredContactMethod} that the service accepts. */ +export enum KnownPreferredContactMethod { + Email = "email", + Phone = "phone" } /** - * @interface - * Collection of ProblemClassification resources. - * @extends Array + * Defines values for PreferredContactMethod. \ + * {@link KnownPreferredContactMethod} can be used interchangeably with PreferredContactMethod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **email** \ + * **phone** */ -export interface ProblemClassificationsListResult extends Array { +export type PreferredContactMethod = string; + +/** Known values of {@link Status} that the service accepts. */ +export enum KnownStatus { + Open = "open", + Closed = "closed" } /** - * @interface - * Object that represents a collection of SupportTicket resources. - * @extends Array + * Defines values for Status. \ + * {@link KnownStatus} can be used interchangeably with Status, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **open** \ + * **closed** */ -export interface SupportTicketsListResult extends Array { - /** - * The URI to fetch the next page of SupportTicket resources. - */ - nextLink?: string; +export type Status = string; + +/** Known values of {@link CommunicationType} that the service accepts. */ +export enum KnownCommunicationType { + Web = "web", + Phone = "phone" } /** - * @interface - * Collection of Communication resources. - * @extends Array + * Defines values for CommunicationType. \ + * {@link KnownCommunicationType} can be used interchangeably with CommunicationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **web** \ + * **phone** */ -export interface CommunicationsListResult extends Array { - /** - * The URI to fetch the next page of Communication resources. - */ - nextLink?: string; +export type CommunicationType = string; + +/** Known values of {@link CommunicationDirection} that the service accepts. */ +export enum KnownCommunicationDirection { + Inbound = "inbound", + Outbound = "outbound" } /** - * Defines values for Type. - * Possible values include: 'Microsoft.Support/supportTickets', 'Microsoft.Support/communications' - * @readonly - * @enum {string} + * Defines values for CommunicationDirection. \ + * {@link KnownCommunicationDirection} can be used interchangeably with CommunicationDirection, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **inbound** \ + * **outbound** */ -export type Type = 'Microsoft.Support/supportTickets' | 'Microsoft.Support/communications'; +export type CommunicationDirection = string; +/** Defines values for Type. */ +export type Type = + | "Microsoft.Support/supportTickets" + | "Microsoft.Support/communications"; -/** - * Defines values for SeverityLevel. - * Possible values include: 'minimal', 'moderate', 'critical', 'highestcriticalimpact' - * @readonly - * @enum {string} - */ -export type SeverityLevel = 'minimal' | 'moderate' | 'critical' | 'highestcriticalimpact'; +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for PreferredContactMethod. - * Possible values include: 'email', 'phone' - * @readonly - * @enum {string} - */ -export type PreferredContactMethod = 'email' | 'phone'; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationsListResult; -/** - * Defines values for CommunicationType. - * Possible values include: 'web', 'phone' - * @readonly - * @enum {string} - */ -export type CommunicationType = 'web' | 'phone'; +/** Optional parameters. */ +export interface ServicesListOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for CommunicationDirection. - * Possible values include: 'inbound', 'outbound' - * @readonly - * @enum {string} - */ -export type CommunicationDirection = 'inbound' | 'outbound'; +/** Contains response data for the list operation. */ +export type ServicesListResponse = ServicesListResult; -/** - * Defines values for Status. - * Possible values include: 'open', 'closed' - * @readonly - * @enum {string} - */ -export type Status = 'open' | 'closed'; +/** Optional parameters. */ +export interface ServicesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationsListResult; - }; -}; +/** Contains response data for the get operation. */ +export type ServicesGetResponse = Service; -/** - * Contains response data for the list operation. - */ -export type ServicesListResponse = ServicesListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServicesListResult; - }; -}; +/** Optional parameters. */ +export interface ProblemClassificationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ServicesGetResponse = Service & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Service; - }; -}; +/** Contains response data for the list operation. */ +export type ProblemClassificationsListResponse = ProblemClassificationsListResult; -/** - * Contains response data for the list operation. - */ -export type ProblemClassificationsListResponse = ProblemClassificationsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProblemClassificationsListResult; - }; -}; +/** Optional parameters. */ +export interface ProblemClassificationsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ProblemClassificationsGetResponse = ProblemClassification & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProblemClassification; - }; -}; +/** Contains response data for the get operation. */ +export type ProblemClassificationsGetResponse = ProblemClassification; -/** - * Contains response data for the checkNameAvailability operation. - */ -export type SupportTicketsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CheckNameAvailabilityOutput; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type SupportTicketsListResponse = SupportTicketsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SupportTicketsListResult; - }; -}; +/** Contains response data for the checkNameAvailability operation. */ +export type SupportTicketsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput; -/** - * Contains response data for the get operation. - */ -export type SupportTicketsGetResponse = SupportTicketDetails & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SupportTicketDetails; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsListOptionalParams + extends coreClient.OperationOptions { + /** The number of values to return in the collection. Default is 25 and max is 100. */ + top?: number; + /** The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_ filter can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine them using the logical 'AND'. */ + filter?: string; +} -/** - * Contains response data for the update operation. - */ -export type SupportTicketsUpdateResponse = SupportTicketDetails & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SupportTicketDetails; - }; -}; +/** Contains response data for the list operation. */ +export type SupportTicketsListResponse = SupportTicketsListResult; -/** - * Contains response data for the create operation. - */ -export type SupportTicketsCreateResponse = SupportTicketDetails & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SupportTicketDetails; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreate operation. - */ -export type SupportTicketsBeginCreateResponse = SupportTicketDetails & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SupportTicketDetails; - }; -}; +/** Contains response data for the get operation. */ +export type SupportTicketsGetResponse = SupportTicketDetails; -/** - * Contains response data for the listNext operation. - */ -export type SupportTicketsListNextResponse = SupportTicketsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SupportTicketsListResult; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the checkNameAvailability operation. - */ -export type CommunicationsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CheckNameAvailabilityOutput; - }; -}; +/** Contains response data for the update operation. */ +export type SupportTicketsUpdateResponse = SupportTicketDetails; -/** - * Contains response data for the list operation. - */ -export type CommunicationsListResponse = CommunicationsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CommunicationsListResult; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the get operation. - */ -export type CommunicationsGetResponse = CommunicationDetails & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CommunicationDetails; - }; -}; +/** Contains response data for the create operation. */ +export type SupportTicketsCreateResponse = SupportTicketDetails; -/** - * Contains response data for the create operation. - */ -export type CommunicationsCreateResponse = CommunicationDetails & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CommunicationDetails; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsListNextOptionalParams + extends coreClient.OperationOptions { + /** The number of values to return in the collection. Default is 25 and max is 100. */ + top?: number; + /** The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_ filter can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine them using the logical 'AND'. */ + filter?: string; +} -/** - * Contains response data for the beginCreate operation. - */ -export type CommunicationsBeginCreateResponse = CommunicationDetails & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CommunicationDetails; - }; -}; +/** Contains response data for the listNext operation. */ +export type SupportTicketsListNextResponse = SupportTicketsListResult; -/** - * Contains response data for the listNext operation. - */ -export type CommunicationsListNextResponse = CommunicationsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CommunicationsListResult; - }; -}; +/** Optional parameters. */ +export interface CommunicationsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type CommunicationsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput; + +/** Optional parameters. */ +export interface CommunicationsListOptionalParams + extends coreClient.OperationOptions { + /** The number of values to return in the collection. Default is 10 and max is 10. */ + top?: number; + /** The filter to apply on the operation. You can filter by communicationType and createdDate properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator. */ + filter?: string; +} + +/** Contains response data for the list operation. */ +export type CommunicationsListResponse = CommunicationsListResult; + +/** Optional parameters. */ +export interface CommunicationsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CommunicationsGetResponse = CommunicationDetails; + +/** Optional parameters. */ +export interface CommunicationsCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type CommunicationsCreateResponse = CommunicationDetails; + +/** Optional parameters. */ +export interface CommunicationsListNextOptionalParams + extends coreClient.OperationOptions { + /** The number of values to return in the collection. Default is 10 and max is 10. */ + top?: number; + /** The filter to apply on the operation. You can filter by communicationType and createdDate properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator. */ + filter?: string; +} + +/** Contains response data for the listNext operation. */ +export type CommunicationsListNextResponse = CommunicationsListResult; + +/** Optional parameters. */ +export interface MicrosoftSupportOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/support/arm-support/src/models/mappers.ts b/sdk/support/arm-support/src/models/mappers.ts index 548fdd7e7103..e9261af013d9 100644 --- a/sdk/support/arm-support/src/models/mappers.ts +++ b/sdk/support/arm-support/src/models/mappers.ts @@ -1,47 +1,86 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; +export const OperationsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", className: "OperationDisplay", modelProperties: { description: { - readOnly: true, serializedName: "description", + readOnly: true, type: { name: "String" } }, operation: { - readOnly: true, serializedName: "operation", + readOnly: true, type: { name: "String" } }, provider: { - readOnly: true, serializedName: "provider", + readOnly: true, type: { name: "String" } }, resource: { - readOnly: true, serializedName: "resource", + readOnly: true, type: { name: "String" } @@ -50,53 +89,134 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const ExceptionResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "ExceptionResponse", modelProperties: { - name: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ServiceError" + } + } + } + } +}; + +export const ServiceError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServiceErrorDetail" + } + } + } + } + } + } +}; + +export const ServiceErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceErrorDetail", + modelProperties: { + code: { + serializedName: "code", readOnly: true, - serializedName: "name", type: { name: "String" } }, - display: { - serializedName: "display", + message: { + serializedName: "message", + readOnly: true, type: { - name: "Composite", - className: "OperationDisplay" + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + } + } + } +}; + +export const ServicesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServicesListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Service" + } + } } } } } }; -export const Service: msRest.CompositeMapper = { - serializedName: "Service", +export const Service: coreClient.CompositeMapper = { type: { name: "Composite", className: "Service", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } @@ -122,29 +242,49 @@ export const Service: msRest.CompositeMapper = { } }; -export const ProblemClassification: msRest.CompositeMapper = { - serializedName: "ProblemClassification", +export const ProblemClassificationsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProblemClassificationsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProblemClassification" + } + } + } + } + } + } +}; + +export const ProblemClassification: coreClient.CompositeMapper = { type: { name: "Composite", className: "ProblemClassification", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } @@ -159,22 +299,21 @@ export const ProblemClassification: msRest.CompositeMapper = { } }; -export const CheckNameAvailabilityInput: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityInput", +export const CheckNameAvailabilityInput: coreClient.CompositeMapper = { type: { name: "Composite", className: "CheckNameAvailabilityInput", modelProperties: { name: { - required: true, serializedName: "name", + required: true, type: { name: "String" } }, type: { - required: true, serializedName: "type", + required: true, type: { name: "Enum", allowedValues: [ @@ -187,29 +326,28 @@ export const CheckNameAvailabilityInput: msRest.CompositeMapper = { } }; -export const CheckNameAvailabilityOutput: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityOutput", +export const CheckNameAvailabilityOutput: coreClient.CompositeMapper = { type: { name: "Composite", className: "CheckNameAvailabilityOutput", modelProperties: { nameAvailable: { - readOnly: true, serializedName: "nameAvailable", + readOnly: true, type: { name: "Boolean" } }, reason: { - readOnly: true, serializedName: "reason", + readOnly: true, type: { name: "String" } }, message: { - readOnly: true, serializedName: "message", + readOnly: true, type: { name: "String" } @@ -218,266 +356,93 @@ export const CheckNameAvailabilityOutput: msRest.CompositeMapper = { } }; -export const ContactProfile: msRest.CompositeMapper = { - serializedName: "ContactProfile", +export const SupportTicketsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ContactProfile", + className: "SupportTicketsListResult", modelProperties: { - firstName: { - required: true, - serializedName: "firstName", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SupportTicketDetails" + } + } } }, - lastName: { - required: true, - serializedName: "lastName", + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - preferredContactMethod: { - required: true, - serializedName: "preferredContactMethod", + } + } + } +}; + +export const SupportTicketDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SupportTicketDetails", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - primaryEmailAddress: { - required: true, - serializedName: "primaryEmailAddress", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - additionalEmailAddresses: { - serializedName: "additionalEmailAddresses", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - phoneNumber: { - serializedName: "phoneNumber", + supportTicketId: { + serializedName: "properties.supportTicketId", type: { name: "String" } }, - preferredTimeZone: { - required: true, - serializedName: "preferredTimeZone", + description: { + serializedName: "properties.description", type: { name: "String" } }, - country: { - required: true, - serializedName: "country", + problemClassificationId: { + serializedName: "properties.problemClassificationId", type: { name: "String" } }, - preferredSupportLanguage: { - required: true, - serializedName: "preferredSupportLanguage", - type: { - name: "String" - } - } - } - } -}; - -export const ServiceLevelAgreement: msRest.CompositeMapper = { - serializedName: "ServiceLevelAgreement", - type: { - name: "Composite", - className: "ServiceLevelAgreement", - modelProperties: { - startTime: { - readOnly: true, - serializedName: "startTime", - type: { - name: "DateTime" - } - }, - expirationTime: { - readOnly: true, - serializedName: "expirationTime", - type: { - name: "DateTime" - } - }, - slaMinutes: { - readOnly: true, - serializedName: "slaMinutes", - type: { - name: "Number" - } - } - } - } -}; - -export const SupportEngineer: msRest.CompositeMapper = { - serializedName: "SupportEngineer", - type: { - name: "Composite", - className: "SupportEngineer", - modelProperties: { - emailAddress: { - readOnly: true, - serializedName: "emailAddress", - type: { - name: "String" - } - } - } - } -}; - -export const TechnicalTicketDetails: msRest.CompositeMapper = { - serializedName: "TechnicalTicketDetails", - type: { - name: "Composite", - className: "TechnicalTicketDetails", - modelProperties: { - resourceId: { - serializedName: "resourceId", - type: { - name: "String" - } - } - } - } -}; - -export const QuotaChangeRequest: msRest.CompositeMapper = { - serializedName: "QuotaChangeRequest", - type: { - name: "Composite", - className: "QuotaChangeRequest", - modelProperties: { - region: { - serializedName: "region", - type: { - name: "String" - } - }, - payload: { - serializedName: "payload", - type: { - name: "String" - } - } - } - } -}; - -export const QuotaTicketDetails: msRest.CompositeMapper = { - serializedName: "QuotaTicketDetails", - type: { - name: "Composite", - className: "QuotaTicketDetails", - modelProperties: { - quotaChangeRequestSubType: { - serializedName: "quotaChangeRequestSubType", - type: { - name: "String" - } - }, - quotaChangeRequestVersion: { - serializedName: "quotaChangeRequestVersion", - type: { - name: "String" - } - }, - quotaChangeRequests: { - serializedName: "quotaChangeRequests", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "QuotaChangeRequest" - } - } - } - } - } - } -}; - -export const SupportTicketDetails: msRest.CompositeMapper = { - serializedName: "SupportTicketDetails", - type: { - name: "Composite", - className: "SupportTicketDetails", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } - }, - supportTicketId: { - serializedName: "properties.supportTicketId", - type: { - name: "String" - } - }, - description: { - required: true, - serializedName: "properties.description", - type: { - name: "String" - } - }, - problemClassificationId: { - required: true, - serializedName: "properties.problemClassificationId", - type: { - name: "String" - } - }, - problemClassificationDisplayName: { - readOnly: true, - serializedName: "properties.problemClassificationDisplayName", + problemClassificationDisplayName: { + serializedName: "properties.problemClassificationDisplayName", + readOnly: true, type: { name: "String" } }, severity: { - required: true, serializedName: "properties.severity", type: { name: "String" } }, enrollmentId: { - readOnly: true, serializedName: "properties.enrollmentId", + readOnly: true, type: { name: "String" } @@ -489,7 +454,6 @@ export const SupportTicketDetails: msRest.CompositeMapper = { } }, contactDetails: { - required: true, serializedName: "properties.contactDetails", type: { name: "Composite", @@ -511,14 +475,13 @@ export const SupportTicketDetails: msRest.CompositeMapper = { } }, supportPlanType: { - readOnly: true, serializedName: "properties.supportPlanType", + readOnly: true, type: { name: "String" } }, title: { - required: true, serializedName: "properties.title", type: { name: "String" @@ -531,36 +494,35 @@ export const SupportTicketDetails: msRest.CompositeMapper = { } }, serviceId: { - required: true, serializedName: "properties.serviceId", type: { name: "String" } }, serviceDisplayName: { - readOnly: true, serializedName: "properties.serviceDisplayName", + readOnly: true, type: { name: "String" } }, status: { - readOnly: true, serializedName: "properties.status", + readOnly: true, type: { name: "String" } }, createdDate: { - readOnly: true, serializedName: "properties.createdDate", + readOnly: true, type: { name: "DateTime" } }, modifiedDate: { - readOnly: true, serializedName: "properties.modifiedDate", + readOnly: true, type: { name: "DateTime" } @@ -583,100 +545,119 @@ export const SupportTicketDetails: msRest.CompositeMapper = { } }; -export const CommunicationDetails: msRest.CompositeMapper = { - serializedName: "CommunicationDetails", +export const ContactProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CommunicationDetails", + className: "ContactProfile", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + firstName: { + serializedName: "firstName", + required: true, type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + lastName: { + serializedName: "lastName", + required: true, type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + preferredContactMethod: { + serializedName: "preferredContactMethod", + required: true, type: { name: "String" } }, - communicationType: { - readOnly: true, - serializedName: "properties.communicationType", + primaryEmailAddress: { + serializedName: "primaryEmailAddress", + required: true, type: { name: "String" } }, - communicationDirection: { - readOnly: true, - serializedName: "properties.communicationDirection", + additionalEmailAddresses: { + serializedName: "additionalEmailAddresses", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - sender: { - serializedName: "properties.sender", + phoneNumber: { + serializedName: "phoneNumber", type: { name: "String" } }, - subject: { + preferredTimeZone: { + serializedName: "preferredTimeZone", required: true, - serializedName: "properties.subject", type: { name: "String" } }, - body: { + country: { + serializedName: "country", required: true, - serializedName: "properties.body", type: { name: "String" } }, - createdDate: { - readOnly: true, - serializedName: "properties.createdDate", + preferredSupportLanguage: { + serializedName: "preferredSupportLanguage", + required: true, type: { - name: "DateTime" + name: "String" } } } } }; -export const ServiceErrorDetail: msRest.CompositeMapper = { - serializedName: "ServiceErrorDetail", +export const ServiceLevelAgreement: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceErrorDetail", + className: "ServiceLevelAgreement", modelProperties: { - code: { + startTime: { + serializedName: "startTime", readOnly: true, - serializedName: "code", type: { - name: "String" + name: "DateTime" } }, - message: { + expirationTime: { + serializedName: "expirationTime", readOnly: true, - serializedName: "message", type: { - name: "String" + name: "DateTime" } }, - target: { - serializedName: "target", + slaMinutes: { + serializedName: "slaMinutes", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const SupportEngineer: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SupportEngineer", + modelProperties: { + emailAddress: { + serializedName: "emailAddress", + readOnly: true, type: { name: "String" } @@ -685,39 +666,46 @@ export const ServiceErrorDetail: msRest.CompositeMapper = { } }; -export const ServiceError: msRest.CompositeMapper = { - serializedName: "ServiceError", +export const TechnicalTicketDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceError", + className: "TechnicalTicketDetails", modelProperties: { - code: { - serializedName: "code", + resourceId: { + serializedName: "resourceId", type: { name: "String" } - }, - message: { - serializedName: "message", + } + } + } +}; + +export const QuotaTicketDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QuotaTicketDetails", + modelProperties: { + quotaChangeRequestSubType: { + serializedName: "quotaChangeRequestSubType", type: { name: "String" } }, - target: { - serializedName: "target", + quotaChangeRequestVersion: { + serializedName: "quotaChangeRequestVersion", type: { name: "String" } }, - details: { - readOnly: true, - serializedName: "details", + quotaChangeRequests: { + serializedName: "quotaChangeRequests", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ServiceErrorDetail" + className: "QuotaChangeRequest" } } } @@ -726,25 +714,56 @@ export const ServiceError: msRest.CompositeMapper = { } }; -export const ExceptionResponse: msRest.CompositeMapper = { - serializedName: "ExceptionResponse", +export const QuotaChangeRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExceptionResponse", + className: "QuotaChangeRequest", modelProperties: { - error: { - serializedName: "error", + region: { + serializedName: "region", + type: { + name: "String" + } + }, + payload: { + serializedName: "payload", + type: { + name: "String" + } + } + } + } +}; + +export const UpdateSupportTicket: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UpdateSupportTicket", + modelProperties: { + severity: { + serializedName: "severity", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + contactDetails: { + serializedName: "contactDetails", type: { name: "Composite", - className: "ServiceError" + className: "UpdateContactProfile" } } } } }; -export const UpdateContactProfile: msRest.CompositeMapper = { - serializedName: "UpdateContactProfile", +export const UpdateContactProfile: coreClient.CompositeMapper = { type: { name: "Composite", className: "UpdateContactProfile", @@ -812,152 +831,97 @@ export const UpdateContactProfile: msRest.CompositeMapper = { } }; -export const UpdateSupportTicket: msRest.CompositeMapper = { - serializedName: "UpdateSupportTicket", - type: { - name: "Composite", - className: "UpdateSupportTicket", - modelProperties: { - severity: { - serializedName: "severity", - type: { - name: "String" - } - }, - status: { - serializedName: "status", - type: { - name: "String" - } - }, - contactDetails: { - serializedName: "contactDetails", - type: { - name: "Composite", - className: "UpdateContactProfile" - } - } - } - } -}; - -export const OperationsListResult: msRest.CompositeMapper = { - serializedName: "OperationsListResult", +export const CommunicationsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationsListResult", + className: "CommunicationsListResult", modelProperties: { value: { - serializedName: "", + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Operation" + className: "CommunicationDetails" } } } - } - } - } -}; - -export const ServicesListResult: msRest.CompositeMapper = { - serializedName: "ServicesListResult", - type: { - name: "Composite", - className: "ServicesListResult", - modelProperties: { - value: { - serializedName: "", + }, + nextLink: { + serializedName: "nextLink", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Service" - } - } + name: "String" } } } } }; -export const ProblemClassificationsListResult: msRest.CompositeMapper = { - serializedName: "ProblemClassificationsListResult", +export const CommunicationDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProblemClassificationsListResult", + className: "CommunicationDetails", modelProperties: { - value: { - serializedName: "", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProblemClassification" - } - } + name: "String" } - } - } - } -}; - -export const SupportTicketsListResult: msRest.CompositeMapper = { - serializedName: "SupportTicketsListResult", - type: { - name: "Composite", - className: "SupportTicketsListResult", - modelProperties: { - value: { - serializedName: "", + }, + name: { + serializedName: "name", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SupportTicketDetails" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const CommunicationsListResult: msRest.CompositeMapper = { - serializedName: "CommunicationsListResult", - type: { - name: "Composite", - className: "CommunicationsListResult", - modelProperties: { - value: { - serializedName: "", + }, + communicationType: { + serializedName: "properties.communicationType", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CommunicationDetails" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + communicationDirection: { + serializedName: "properties.communicationDirection", + readOnly: true, + type: { + name: "String" + } + }, + sender: { + serializedName: "properties.sender", + type: { + name: "String" + } + }, + subject: { + serializedName: "properties.subject", + type: { + name: "String" + } + }, + body: { + serializedName: "properties.body", type: { name: "String" } + }, + createdDate: { + serializedName: "properties.createdDate", + readOnly: true, + type: { + name: "DateTime" + } } } } diff --git a/sdk/support/arm-support/src/models/operationsMappers.ts b/sdk/support/arm-support/src/models/operationsMappers.ts deleted file mode 100644 index b6e72b14c6ce..000000000000 --- a/sdk/support/arm-support/src/models/operationsMappers.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ExceptionResponse, - Operation, - OperationDisplay, - OperationsListResult, - ServiceError, - ServiceErrorDetail -} from "../models/mappers"; diff --git a/sdk/support/arm-support/src/models/parameters.ts b/sdk/support/arm-support/src/models/parameters.ts index aafb28438615..c5116f0ed029 100644 --- a/sdk/support/arm-support/src/models/parameters.ts +++ b/sdk/support/arm-support/src/models/parameters.ts @@ -1,117 +1,174 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + CheckNameAvailabilityInput as CheckNameAvailabilityInputMapper, + UpdateSupportTicket as UpdateSupportTicketMapper, + SupportTicketDetails as SupportTicketDetailsMapper, + CommunicationDetails as CommunicationDetailsMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2020-04-01", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const communicationName: msRest.OperationURLParameter = { - parameterPath: "communicationName", + +export const serviceName: OperationURLParameter = { + parameterPath: "serviceName", mapper: { + serializedName: "serviceName", required: true, - serializedName: "communicationName", type: { name: "String" } } }; -export const filter: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "filter" - ], + +export const problemClassificationName: OperationURLParameter = { + parameterPath: "problemClassificationName", mapper: { - serializedName: "$filter", + serializedName: "problemClassificationName", + required: true, type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "nextLink", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } - }, - skipEncoding: true + } }; -export const problemClassificationName: msRest.OperationURLParameter = { - parameterPath: "problemClassificationName", + +export const checkNameAvailabilityInput: OperationParameter = { + parameterPath: "checkNameAvailabilityInput", + mapper: CheckNameAvailabilityInputMapper +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "problemClassificationName", type: { name: "String" } } }; -export const serviceName: msRest.OperationURLParameter = { - parameterPath: "serviceName", + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], mapper: { - required: true, - serializedName: "serviceName", + serializedName: "$top", type: { - name: "String" + name: "Number" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], mapper: { - required: true, - serializedName: "subscriptionId", + serializedName: "$filter", type: { name: "String" } } }; -export const supportTicketName: msRest.OperationURLParameter = { + +export const supportTicketName: OperationURLParameter = { parameterPath: "supportTicketName", mapper: { - required: true, serializedName: "supportTicketName", + required: true, type: { name: "String" } } }; -export const top: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "top" - ], + +export const updateSupportTicket: OperationParameter = { + parameterPath: "updateSupportTicket", + mapper: UpdateSupportTicketMapper +}; + +export const createSupportTicketParameters: OperationParameter = { + parameterPath: "createSupportTicketParameters", + mapper: SupportTicketDetailsMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const communicationName: OperationURLParameter = { + parameterPath: "communicationName", mapper: { - serializedName: "$top", + serializedName: "communicationName", + required: true, type: { - name: "Number" + name: "String" } } }; + +export const createCommunicationParameters: OperationParameter = { + parameterPath: "createCommunicationParameters", + mapper: CommunicationDetailsMapper +}; diff --git a/sdk/support/arm-support/src/models/problemClassificationsMappers.ts b/sdk/support/arm-support/src/models/problemClassificationsMappers.ts deleted file mode 100644 index 0df8bd073f1f..000000000000 --- a/sdk/support/arm-support/src/models/problemClassificationsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ExceptionResponse, - ProblemClassification, - ProblemClassificationsListResult, - ServiceError, - ServiceErrorDetail -} from "../models/mappers"; diff --git a/sdk/support/arm-support/src/models/servicesMappers.ts b/sdk/support/arm-support/src/models/servicesMappers.ts deleted file mode 100644 index 69ec00ba73a6..000000000000 --- a/sdk/support/arm-support/src/models/servicesMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ExceptionResponse, - Service, - ServiceError, - ServiceErrorDetail, - ServicesListResult -} from "../models/mappers"; diff --git a/sdk/support/arm-support/src/models/supportTicketsMappers.ts b/sdk/support/arm-support/src/models/supportTicketsMappers.ts deleted file mode 100644 index 25fe954adb6c..000000000000 --- a/sdk/support/arm-support/src/models/supportTicketsMappers.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CheckNameAvailabilityInput, - CheckNameAvailabilityOutput, - CommunicationDetails, - ContactProfile, - ExceptionResponse, - QuotaChangeRequest, - QuotaTicketDetails, - ServiceError, - ServiceErrorDetail, - ServiceLevelAgreement, - SupportEngineer, - SupportTicketDetails, - SupportTicketsListResult, - TechnicalTicketDetails, - UpdateContactProfile, - UpdateSupportTicket -} from "../models/mappers"; diff --git a/sdk/support/arm-support/src/operations/communications.ts b/sdk/support/arm-support/src/operations/communications.ts index ce7693cb8649..9ac1cbf1bfe3 100644 --- a/sdk/support/arm-support/src/operations/communications.ts +++ b/sdk/support/arm-support/src/operations/communications.ts @@ -1,141 +1,155 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/communicationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Communications } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MicrosoftSupportContext } from "../microsoftSupportContext"; +import { MicrosoftSupport } from "../microsoftSupport"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + CommunicationDetails, + CommunicationsListNextOptionalParams, + CommunicationsListOptionalParams, + CheckNameAvailabilityInput, + CommunicationsCheckNameAvailabilityOptionalParams, + CommunicationsCheckNameAvailabilityResponse, + CommunicationsListResponse, + CommunicationsGetOptionalParams, + CommunicationsGetResponse, + CommunicationsCreateOptionalParams, + CommunicationsCreateResponse, + CommunicationsListNextResponse +} from "../models"; -/** Class representing a Communications. */ -export class Communications { - private readonly client: MicrosoftSupportContext; +/// +/** Class containing Communications operations. */ +export class CommunicationsImpl implements Communications { + private readonly client: MicrosoftSupport; /** - * Create a Communications. - * @param {MicrosoftSupportContext} client Reference to the service client. + * Initialize a new instance of the class Communications class. + * @param client Reference to the service client */ - constructor(client: MicrosoftSupportContext) { + constructor(client: MicrosoftSupport) { this.client = client; } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of - * the name for adding a new communication to the support ticket. + * Lists all communications (attachments not included) for a support ticket.

You can also + * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter + * parameter. The only type of communication supported today is _Web_. Output will be a paged result + * with _nextLink_, using which you can retrieve the next set of Communication results. + *

Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailability(supportTicketName: string, checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options?: msRest.RequestOptionsBase): Promise; - /** - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. - * @param callback The callback + * @param options The options parameters. */ - checkNameAvailability(supportTicketName: string, checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, callback: msRest.ServiceCallback): void; - /** - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. - * @param options The optional parameters - * @param callback The callback - */ - checkNameAvailability(supportTicketName: string, checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(supportTicketName: string, checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - supportTicketName, - checkNameAvailabilityInput, - options + public list( + supportTicketName: string, + options?: CommunicationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(supportTicketName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(supportTicketName, options); + } + }; } - /** - * Lists all communications (attachments not included) for a support ticket.

You can - * also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the - * $filter parameter. The only type of communication supported today is _Web_. Output will be a - * paged result with _nextLink_, using which you can retrieve the next set of Communication - * results.

Support ticket data is available for 12 months after ticket creation. If a - * ticket was created more than 12 months ago, a request for data might cause an error. - * @param supportTicketName Support ticket name. - * @param [options] The optional parameters - * @returns Promise - */ - list(supportTicketName: string, options?: Models.CommunicationsListOptionalParams): Promise; - /** - * @param supportTicketName Support ticket name. - * @param callback The callback - */ - list(supportTicketName: string, callback: msRest.ServiceCallback): void; - /** - * @param supportTicketName Support ticket name. - * @param options The optional parameters - * @param callback The callback - */ - list(supportTicketName: string, options: Models.CommunicationsListOptionalParams, callback: msRest.ServiceCallback): void; - list(supportTicketName: string, options?: Models.CommunicationsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + private async *listPagingPage( + supportTicketName: string, + options?: CommunicationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(supportTicketName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( supportTicketName, + continuationToken, options - }, - listOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + supportTicketName: string, + options?: CommunicationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(supportTicketName, options)) { + yield* page; + } } /** - * Returns communication details for a support ticket. - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param [options] The optional parameters - * @returns Promise - */ - get(supportTicketName: string, communicationName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the + * name for adding a new communication to the support ticket. * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param callback The callback + * @param checkNameAvailabilityInput Input to check. + * @param options The options parameters. */ - get(supportTicketName: string, communicationName: string, callback: msRest.ServiceCallback): void; + checkNameAvailability( + supportTicketName: string, + checkNameAvailabilityInput: CheckNameAvailabilityInput, + options?: CommunicationsCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { supportTicketName, checkNameAvailabilityInput, options }, + checkNameAvailabilityOperationSpec + ); + } + /** + * Lists all communications (attachments not included) for a support ticket.

You can also + * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter + * parameter. The only type of communication supported today is _Web_. Output will be a paged result + * with _nextLink_, using which you can retrieve the next set of Communication results. + *

Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(supportTicketName: string, communicationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(supportTicketName: string, communicationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + supportTicketName: string, + options?: CommunicationsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - supportTicketName, - communicationName, - options - }, - getOperationSpec, - callback) as Promise; + { supportTicketName, options }, + listOperationSpec + ); } /** - * Adds a new customer communication to an Azure support ticket. + * Returns communication details for a support ticket. * @param supportTicketName Support ticket name. * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(supportTicketName: string, communicationName: string, createCommunicationParameters: Models.CommunicationDetails, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(supportTicketName,communicationName,createCommunicationParameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + get( + supportTicketName: string, + communicationName: string, + options?: CommunicationsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { supportTicketName, communicationName, options }, + getOperationSpec + ); } /** @@ -143,77 +157,121 @@ export class Communications { * @param supportTicketName Support ticket name. * @param communicationName Communication name. * @param createCommunicationParameters Communication object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreate(supportTicketName: string, communicationName: string, createCommunicationParameters: Models.CommunicationDetails, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginCreate( + supportTicketName: string, + communicationName: string, + createCommunicationParameters: CommunicationDetails, + options?: CommunicationsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CommunicationsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { supportTicketName, communicationName, createCommunicationParameters, options }, - beginCreateOperationSpec, - options); + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Lists all communications (attachments not included) for a support ticket.

You can - * also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the - * $filter parameter. The only type of communication supported today is _Web_. Output will be a - * paged result with _nextLink_, using which you can retrieve the next set of Communication - * results.

Support ticket data is available for 12 months after ticket creation. If a - * ticket was created more than 12 months ago, a request for data might cause an error. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * Adds a new customer communication to an Azure support ticket. + * @param supportTicketName Support ticket name. + * @param communicationName Communication name. + * @param createCommunicationParameters Communication object. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + async beginCreateAndWait( + supportTicketName: string, + communicationName: string, + createCommunicationParameters: CommunicationDetails, + options?: CommunicationsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + supportTicketName, + communicationName, + createCommunicationParameters, + options + ); + return poller.pollUntilDone(); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param supportTicketName Support ticket name. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + supportTicketName: string, + nextLink: string, + options?: CommunicationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { supportTicketName, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/checkNameAvailability", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/checkNameAvailability", - urlParameters: [ - Parameters.supportTicketName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "checkNameAvailabilityInput", - mapper: { - ...Mappers.CheckNameAvailabilityInput, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CheckNameAvailabilityOutput @@ -222,24 +280,21 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + requestBody: Parameters.checkNameAvailabilityInput, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications", - urlParameters: [ - Parameters.supportTicketName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.CommunicationsListResult @@ -248,23 +303,19 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName + ], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}", - urlParameters: [ - Parameters.supportTicketName, - Parameters.communicationName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.CommunicationDetails @@ -273,52 +324,52 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, - serializer -}; - -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.supportTicketName, - Parameters.communicationName, - Parameters.subscriptionId + Parameters.communicationName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "createCommunicationParameters", - mapper: { - ...Mappers.CommunicationDetails, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.CommunicationDetails }, - 202: {}, + 201: { + bodyMapper: Mappers.CommunicationDetails + }, + 202: { + bodyMapper: Mappers.CommunicationDetails + }, + 204: { + bodyMapper: Mappers.CommunicationDetails + }, default: { bodyMapper: Mappers.ExceptionResponse } }, + requestBody: Parameters.createCommunicationParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName, + Parameters.communicationName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.CommunicationsListResult @@ -327,5 +378,13 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/support/arm-support/src/operations/index.ts b/sdk/support/arm-support/src/operations/index.ts index c3dc4a3c928e..a2bdb16ecc1c 100644 --- a/sdk/support/arm-support/src/operations/index.ts +++ b/sdk/support/arm-support/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./operations"; diff --git a/sdk/support/arm-support/src/operations/operations.ts b/sdk/support/arm-support/src/operations/operations.ts index a92e538c1c82..4f09fbf397ca 100644 --- a/sdk/support/arm-support/src/operations/operations.ts +++ b/sdk/support/arm-support/src/operations/operations.ts @@ -1,67 +1,88 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MicrosoftSupportContext } from "../microsoftSupportContext"; +import { MicrosoftSupport } from "../microsoftSupport"; +import { + Operation, + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: MicrosoftSupportContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: MicrosoftSupport; /** - * Create a Operations. - * @param {MicrosoftSupportContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: MicrosoftSupportContext) { + constructor(client: MicrosoftSupport) { this.client = client; } /** * This lists all the available Microsoft Support REST API operations. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** - * @param options The optional parameters - * @param callback The callback + * This lists all the available Microsoft Support REST API operations. + * @param options The options parameters. */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Support/operations", httpMethod: "GET", - path: "providers/Microsoft.Support/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationsListResult @@ -70,5 +91,8 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/support/arm-support/src/operations/problemClassifications.ts b/sdk/support/arm-support/src/operations/problemClassifications.ts index a853ea0add74..b5ef37bfe971 100644 --- a/sdk/support/arm-support/src/operations/problemClassifications.ts +++ b/sdk/support/arm-support/src/operations/problemClassifications.ts @@ -1,111 +1,123 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/problemClassificationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ProblemClassifications } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MicrosoftSupportContext } from "../microsoftSupportContext"; +import { MicrosoftSupport } from "../microsoftSupport"; +import { + ProblemClassification, + ProblemClassificationsListOptionalParams, + ProblemClassificationsListResponse, + ProblemClassificationsGetOptionalParams, + ProblemClassificationsGetResponse +} from "../models"; -/** Class representing a ProblemClassifications. */ -export class ProblemClassifications { - private readonly client: MicrosoftSupportContext; +/// +/** Class containing ProblemClassifications operations. */ +export class ProblemClassificationsImpl implements ProblemClassifications { + private readonly client: MicrosoftSupport; /** - * Create a ProblemClassifications. - * @param {MicrosoftSupportContext} client Reference to the service client. + * Initialize a new instance of the class ProblemClassifications class. + * @param client Reference to the service client */ - constructor(client: MicrosoftSupportContext) { + constructor(client: MicrosoftSupport) { this.client = client; } /** - * Lists all the problem classifications (categories) available for a specific Azure service. - * Always use the service and problem classifications obtained programmatically. This practice - * ensures that you always have the most recent set of service and problem classification Ids. + * Lists all the problem classifications (categories) available for a specific Azure service. Always + * use the service and problem classifications obtained programmatically. This practice ensures that + * you always have the most recent set of service and problem classification Ids. * @param serviceName Name of the Azure service for which the problem classifications need to be - * retrieved. - * @param [options] The optional parameters - * @returns Promise + * retrieved. + * @param options The options parameters. */ - list(serviceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param serviceName Name of the Azure service for which the problem classifications need to be - * retrieved. - * @param callback The callback - */ - list(serviceName: string, callback: msRest.ServiceCallback): void; + public list( + serviceName: string, + options?: ProblemClassificationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(serviceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(serviceName, options); + } + }; + } + + private async *listPagingPage( + serviceName: string, + options?: ProblemClassificationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(serviceName, options); + yield result.value || []; + } + + private async *listPagingAll( + serviceName: string, + options?: ProblemClassificationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(serviceName, options)) { + yield* page; + } + } + /** + * Lists all the problem classifications (categories) available for a specific Azure service. Always + * use the service and problem classifications obtained programmatically. This practice ensures that + * you always have the most recent set of service and problem classification Ids. * @param serviceName Name of the Azure service for which the problem classifications need to be - * retrieved. - * @param options The optional parameters - * @param callback The callback + * retrieved. + * @param options The options parameters. */ - list(serviceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(serviceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + serviceName: string, + options?: ProblemClassificationsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - serviceName, - options - }, - listOperationSpec, - callback) as Promise; + { serviceName, options }, + listOperationSpec + ); } /** * Get problem classification details for a specific Azure service. * @param serviceName Name of the Azure service available for support. * @param problemClassificationName Name of problem classification. - * @param [options] The optional parameters - * @returns Promise - */ - get(serviceName: string, problemClassificationName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param serviceName Name of the Azure service available for support. - * @param problemClassificationName Name of problem classification. - * @param callback The callback + * @param options The options parameters. */ - get(serviceName: string, problemClassificationName: string, callback: msRest.ServiceCallback): void; - /** - * @param serviceName Name of the Azure service available for support. - * @param problemClassificationName Name of problem classification. - * @param options The optional parameters - * @param callback The callback - */ - get(serviceName: string, problemClassificationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(serviceName: string, problemClassificationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + serviceName: string, + problemClassificationName: string, + options?: ProblemClassificationsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - serviceName, - problemClassificationName, - options - }, - getOperationSpec, - callback) as Promise; + { serviceName, problemClassificationName, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Support/services/{serviceName}/problemClassifications", httpMethod: "GET", - path: "providers/Microsoft.Support/services/{serviceName}/problemClassifications", - urlParameters: [ - Parameters.serviceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ProblemClassificationsListResult @@ -114,22 +126,15 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.serviceName], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Support/services/{serviceName}/problemClassifications/{problemClassificationName}", httpMethod: "GET", - path: "providers/Microsoft.Support/services/{serviceName}/problemClassifications/{problemClassificationName}", - urlParameters: [ - Parameters.serviceName, - Parameters.problemClassificationName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ProblemClassification @@ -138,5 +143,12 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.serviceName, + Parameters.problemClassificationName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/support/arm-support/src/operations/services.ts b/sdk/support/arm-support/src/operations/services.ts index c7d891a03a0d..e17fbe46d560 100644 --- a/sdk/support/arm-support/src/operations/services.ts +++ b/sdk/support/arm-support/src/operations/services.ts @@ -1,101 +1,117 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/servicesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Services } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MicrosoftSupportContext } from "../microsoftSupportContext"; +import { MicrosoftSupport } from "../microsoftSupport"; +import { + Service, + ServicesListOptionalParams, + ServicesListResponse, + ServicesGetOptionalParams, + ServicesGetResponse +} from "../models"; -/** Class representing a Services. */ -export class Services { - private readonly client: MicrosoftSupportContext; +/// +/** Class containing Services operations. */ +export class ServicesImpl implements Services { + private readonly client: MicrosoftSupport; /** - * Create a Services. - * @param {MicrosoftSupportContext} client Reference to the service client. + * Initialize a new instance of the class Services class. + * @param client Reference to the service client */ - constructor(client: MicrosoftSupportContext) { + constructor(client: MicrosoftSupport) { this.client = client; } /** - * Lists all the Azure services available for support ticket creation. For **Technical** issues, - * select the Service Id that maps to the Azure service/product as displayed in the **Services** - * drop-down list on the Azure portal's [New support - * request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) - * page. Always use the service and its corresponding problem classification(s) obtained - * programmatically for support ticket creation. This practice ensures that you always have the - * most recent set of service and problem classification Ids. - * @param [options] The optional parameters - * @returns Promise + * Lists all the Azure services available for support ticket creation. For **Technical** issues, select + * the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down + * list on the Azure portal's [New support + * request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. + * Always use the service and its corresponding problem classification(s) obtained programmatically for + * support ticket creation. This practice ensures that you always have the most recent set of service + * and problem classification Ids. + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: ServicesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ServicesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: ServicesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** - * Gets a specific Azure service for support ticket creation. - * @param serviceName Name of the Azure service. - * @param [options] The optional parameters - * @returns Promise - */ - get(serviceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param serviceName Name of the Azure service. - * @param callback The callback + * Lists all the Azure services available for support ticket creation. For **Technical** issues, select + * the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down + * list on the Azure portal's [New support + * request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. + * Always use the service and its corresponding problem classification(s) obtained programmatically for + * support ticket creation. This practice ensures that you always have the most recent set of service + * and problem classification Ids. + * @param options The options parameters. */ - get(serviceName: string, callback: msRest.ServiceCallback): void; + private _list( + options?: ServicesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** + * Gets a specific Azure service for support ticket creation. * @param serviceName Name of the Azure service. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(serviceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(serviceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + serviceName: string, + options?: ServicesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - serviceName, - options - }, - getOperationSpec, - callback) as Promise; + { serviceName, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Support/services", httpMethod: "GET", - path: "providers/Microsoft.Support/services", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ServicesListResult @@ -104,21 +120,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Support/services/{serviceName}", httpMethod: "GET", - path: "providers/Microsoft.Support/services/{serviceName}", - urlParameters: [ - Parameters.serviceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.Service @@ -127,5 +136,8 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.serviceName], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/support/arm-support/src/operations/supportTickets.ts b/sdk/support/arm-support/src/operations/supportTickets.ts index b6c2eeb6c063..6141bca6e44a 100644 --- a/sdk/support/arm-support/src/operations/supportTickets.ts +++ b/sdk/support/arm-support/src/operations/supportTickets.ts @@ -1,275 +1,306 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/supportTicketsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SupportTickets } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MicrosoftSupportContext } from "../microsoftSupportContext"; +import { MicrosoftSupport } from "../microsoftSupport"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + SupportTicketDetails, + SupportTicketsListNextOptionalParams, + SupportTicketsListOptionalParams, + CheckNameAvailabilityInput, + SupportTicketsCheckNameAvailabilityOptionalParams, + SupportTicketsCheckNameAvailabilityResponse, + SupportTicketsListResponse, + SupportTicketsGetOptionalParams, + SupportTicketsGetResponse, + UpdateSupportTicket, + SupportTicketsUpdateOptionalParams, + SupportTicketsUpdateResponse, + SupportTicketsCreateOptionalParams, + SupportTicketsCreateResponse, + SupportTicketsListNextResponse +} from "../models"; -/** Class representing a SupportTickets. */ -export class SupportTickets { - private readonly client: MicrosoftSupportContext; +/// +/** Class containing SupportTickets operations. */ +export class SupportTicketsImpl implements SupportTickets { + private readonly client: MicrosoftSupport; /** - * Create a SupportTickets. - * @param {MicrosoftSupportContext} client Reference to the service client. + * Initialize a new instance of the class SupportTickets class. + * @param client Reference to the service client */ - constructor(client: MicrosoftSupportContext) { + constructor(client: MicrosoftSupport) { this.client = client; } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of - * the name for support ticket creation for the selected subscription. - * @param checkNameAvailabilityInput Input to check. - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailability(checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options?: msRest.RequestOptionsBase): Promise; - /** - * @param checkNameAvailabilityInput Input to check. - * @param callback The callback - */ - checkNameAvailability(checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, callback: msRest.ServiceCallback): void; - /** - * @param checkNameAvailabilityInput Input to check. - * @param options The optional parameters - * @param callback The callback + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by + * _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with + * _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket + * data is available for 18 months after ticket creation. If a ticket was created more than 18 months + * ago, a request for data might cause an error. + * @param options The options parameters. */ - checkNameAvailability(checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - checkNameAvailabilityInput, - options + public list( + options?: SupportTicketsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: SupportTicketsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: SupportTicketsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets - * by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with - * _nextLink_, using which you can retrieve the next set of support tickets.

Support - * ticket data is available for 12 months after ticket creation. If a ticket was created more than - * 12 months ago, a request for data might cause an error. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: Models.SupportTicketsListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * Check the availability of a resource name. This API should be used to check the uniqueness of the + * name for support ticket creation for the selected subscription. + * @param checkNameAvailabilityInput Input to check. + * @param options The options parameters. */ - list(options: Models.SupportTicketsListOptionalParams, callback: msRest.ServiceCallback): void; - list(options?: Models.SupportTicketsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + checkNameAvailability( + checkNameAvailabilityInput: CheckNameAvailabilityInput, + options?: SupportTicketsCheckNameAvailabilityOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + { checkNameAvailabilityInput, options }, + checkNameAvailabilityOperationSpec + ); } /** - * Get ticket details for an Azure subscription. Support ticket data is available for 12 months - * after ticket creation. If a ticket was created more than 12 months ago, a request for data might - * cause an error. - * @param supportTicketName Support ticket name. - * @param [options] The optional parameters - * @returns Promise - */ - get(supportTicketName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param supportTicketName Support ticket name. - * @param callback The callback + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by + * _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with + * _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket + * data is available for 18 months after ticket creation. If a ticket was created more than 18 months + * ago, a request for data might cause an error. + * @param options The options parameters. */ - get(supportTicketName: string, callback: msRest.ServiceCallback): void; + private _list( + options?: SupportTicketsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** + * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after + * ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an + * error. * @param supportTicketName Support ticket name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(supportTicketName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(supportTicketName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + supportTicketName: string, + options?: SupportTicketsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - supportTicketName, - options - }, - getOperationSpec, - callback) as Promise; + { supportTicketName, options }, + getOperationSpec + ); } /** - * This API allows you to update the severity level, ticket status, and your contact information in - * the support ticket.

Note: The severity levels cannot be changed if a support ticket is - * actively being worked upon by an Azure support engineer. In such a case, contact your support - * engineer to request severity update by adding a new communication using the Communications - * API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When - * an engineer is actively working on the ticket, send your ticket closure request by sending a - * note to your engineer. - * @param supportTicketName Support ticket name. - * @param updateSupportTicket UpdateSupportTicket object. - * @param [options] The optional parameters - * @returns Promise - */ - update(supportTicketName: string, updateSupportTicket: Models.UpdateSupportTicket, options?: msRest.RequestOptionsBase): Promise; - /** - * @param supportTicketName Support ticket name. - * @param updateSupportTicket UpdateSupportTicket object. - * @param callback The callback - */ - update(supportTicketName: string, updateSupportTicket: Models.UpdateSupportTicket, callback: msRest.ServiceCallback): void; - /** + * This API allows you to update the severity level, ticket status, and your contact information in the + * support ticket.

Note: The severity levels cannot be changed if a support ticket is actively + * being worked upon by an Azure support engineer. In such a case, contact your support engineer to + * request severity update by adding a new communication using the Communications + * API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an + * engineer is actively working on the ticket, send your ticket closure request by sending a note to + * your engineer. * @param supportTicketName Support ticket name. * @param updateSupportTicket UpdateSupportTicket object. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(supportTicketName: string, updateSupportTicket: Models.UpdateSupportTicket, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(supportTicketName: string, updateSupportTicket: Models.UpdateSupportTicket, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + supportTicketName: string, + updateSupportTicket: UpdateSupportTicket, + options?: SupportTicketsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - supportTicketName, - updateSupportTicket, - options - }, - updateOperationSpec, - callback) as Promise; + { supportTicketName, updateSupportTicket, options }, + updateOperationSpec + ); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, - * and Subscription Management issues for the specified subscription. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always - * call the Services and ProblemClassifications API to get the most recent set of services and - * problem categories required for support ticket creation.

Adding attachments is not - * currently supported via the API. To add a file to an existing support ticket, visit the [Manage - * support + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and + * Subscription Management issues for the specified subscription. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem + * categories required for support ticket creation.

Adding attachments is not currently + * supported via the API. To add a file to an existing support ticket, visit the [Manage support * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) - * page in the Azure portal, select the support ticket, and use the file upload control to add a - * new file.

Providing consent to share diagnostic information with Azure support is - * currently not supported via the API. The Azure support engineer working on your ticket will - * reach out to you for consent if your issue requires gathering diagnostic information from your - * Azure resources.

**Creating a support ticket for on-behalf-of**: Include + * page in the Azure portal, select the support ticket, and use the file upload control to add a new + * file.

Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for + * consent if your issue requires gathering diagnostic information from your Azure + * resources.

**Creating a support ticket for on-behalf-of**: Include * _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). * The primary token will be from the tenant for whom a support ticket is being raised against the - * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be - * from the Cloud solution provider (CSP) partner tenant. + * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from + * the Cloud solution provider (CSP) partner tenant. * @param supportTicketName Support ticket name. * @param createSupportTicketParameters Support ticket request payload. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(supportTicketName: string, createSupportTicketParameters: Models.SupportTicketDetails, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(supportTicketName,createSupportTicketParameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreate( + supportTicketName: string, + createSupportTicketParameters: SupportTicketDetails, + options?: SupportTicketsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SupportTicketsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { supportTicketName, createSupportTicketParameters, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, - * and Subscription Management issues for the specified subscription. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always - * call the Services and ProblemClassifications API to get the most recent set of services and - * problem categories required for support ticket creation.

Adding attachments is not - * currently supported via the API. To add a file to an existing support ticket, visit the [Manage - * support + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and + * Subscription Management issues for the specified subscription. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem + * categories required for support ticket creation.

Adding attachments is not currently + * supported via the API. To add a file to an existing support ticket, visit the [Manage support * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) - * page in the Azure portal, select the support ticket, and use the file upload control to add a - * new file.

Providing consent to share diagnostic information with Azure support is - * currently not supported via the API. The Azure support engineer working on your ticket will - * reach out to you for consent if your issue requires gathering diagnostic information from your - * Azure resources.

**Creating a support ticket for on-behalf-of**: Include + * page in the Azure portal, select the support ticket, and use the file upload control to add a new + * file.

Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for + * consent if your issue requires gathering diagnostic information from your Azure + * resources.

**Creating a support ticket for on-behalf-of**: Include * _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). * The primary token will be from the tenant for whom a support ticket is being raised against the - * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be - * from the Cloud solution provider (CSP) partner tenant. + * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from + * the Cloud solution provider (CSP) partner tenant. * @param supportTicketName Support ticket name. * @param createSupportTicketParameters Support ticket request payload. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreate(supportTicketName: string, createSupportTicketParameters: Models.SupportTicketDetails, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - supportTicketName, - createSupportTicketParameters, - options - }, - beginCreateOperationSpec, - options); + async beginCreateAndWait( + supportTicketName: string, + createSupportTicketParameters: SupportTicketDetails, + options?: SupportTicketsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + supportTicketName, + createSupportTicketParameters, + options + ); + return poller.pollUntilDone(); } /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets - * by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with - * _nextLink_, using which you can retrieve the next set of support tickets.

Support - * ticket data is available for 12 months after ticket creation. If a ticket was created more than - * 12 months ago, a request for data might cause an error. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: SupportTicketsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/checkNameAvailability", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/checkNameAvailability", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "checkNameAvailabilityInput", - mapper: { - ...Mappers.CheckNameAvailabilityInput, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CheckNameAvailabilityOutput @@ -278,23 +309,17 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + requestBody: Parameters.checkNameAvailabilityInput, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.SupportTicketsListResult @@ -303,22 +328,15 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", - urlParameters: [ - Parameters.supportTicketName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.SupportTicketDetails @@ -327,29 +345,19 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName + ], + headerParameters: [Parameters.accept], serializer }; - -const updateOperationSpec: msRest.OperationSpec = { +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", - urlParameters: [ - Parameters.supportTicketName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "updateSupportTicket", - mapper: { - ...Mappers.UpdateSupportTicket, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.SupportTicketDetails @@ -358,51 +366,52 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + requestBody: Parameters.updateSupportTicket, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginCreateOperationSpec: msRest.OperationSpec = { +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", - urlParameters: [ - Parameters.supportTicketName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "createSupportTicketParameters", - mapper: { - ...Mappers.SupportTicketDetails, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.SupportTicketDetails }, - 202: {}, + 201: { + bodyMapper: Mappers.SupportTicketDetails + }, + 202: { + bodyMapper: Mappers.SupportTicketDetails + }, + 204: { + bodyMapper: Mappers.SupportTicketDetails + }, default: { bodyMapper: Mappers.ExceptionResponse } }, + requestBody: Parameters.createSupportTicketParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SupportTicketsListResult @@ -411,5 +420,12 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/support/arm-support/src/operationsInterfaces/communications.ts b/sdk/support/arm-support/src/operationsInterfaces/communications.ts new file mode 100644 index 000000000000..a4241c24682c --- /dev/null +++ b/sdk/support/arm-support/src/operationsInterfaces/communications.ts @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + CommunicationDetails, + CommunicationsListOptionalParams, + CheckNameAvailabilityInput, + CommunicationsCheckNameAvailabilityOptionalParams, + CommunicationsCheckNameAvailabilityResponse, + CommunicationsGetOptionalParams, + CommunicationsGetResponse, + CommunicationsCreateOptionalParams, + CommunicationsCreateResponse +} from "../models"; + +/// +/** Interface representing a Communications. */ +export interface Communications { + /** + * Lists all communications (attachments not included) for a support ticket.

You can also + * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter + * parameter. The only type of communication supported today is _Web_. Output will be a paged result + * with _nextLink_, using which you can retrieve the next set of Communication results. + *

Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. + * @param supportTicketName Support ticket name. + * @param options The options parameters. + */ + list( + supportTicketName: string, + options?: CommunicationsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the + * name for adding a new communication to the support ticket. + * @param supportTicketName Support ticket name. + * @param checkNameAvailabilityInput Input to check. + * @param options The options parameters. + */ + checkNameAvailability( + supportTicketName: string, + checkNameAvailabilityInput: CheckNameAvailabilityInput, + options?: CommunicationsCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Returns communication details for a support ticket. + * @param supportTicketName Support ticket name. + * @param communicationName Communication name. + * @param options The options parameters. + */ + get( + supportTicketName: string, + communicationName: string, + options?: CommunicationsGetOptionalParams + ): Promise; + /** + * Adds a new customer communication to an Azure support ticket. + * @param supportTicketName Support ticket name. + * @param communicationName Communication name. + * @param createCommunicationParameters Communication object. + * @param options The options parameters. + */ + beginCreate( + supportTicketName: string, + communicationName: string, + createCommunicationParameters: CommunicationDetails, + options?: CommunicationsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CommunicationsCreateResponse + > + >; + /** + * Adds a new customer communication to an Azure support ticket. + * @param supportTicketName Support ticket name. + * @param communicationName Communication name. + * @param createCommunicationParameters Communication object. + * @param options The options parameters. + */ + beginCreateAndWait( + supportTicketName: string, + communicationName: string, + createCommunicationParameters: CommunicationDetails, + options?: CommunicationsCreateOptionalParams + ): Promise; +} diff --git a/sdk/support/arm-support/src/operationsInterfaces/index.ts b/sdk/support/arm-support/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..a2bdb16ecc1c --- /dev/null +++ b/sdk/support/arm-support/src/operationsInterfaces/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./services"; +export * from "./problemClassifications"; +export * from "./supportTickets"; +export * from "./communications"; diff --git a/sdk/support/arm-support/src/operationsInterfaces/operations.ts b/sdk/support/arm-support/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..d819cb3a4dd6 --- /dev/null +++ b/sdk/support/arm-support/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * This lists all the available Microsoft Support REST API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/support/arm-support/src/operationsInterfaces/problemClassifications.ts b/sdk/support/arm-support/src/operationsInterfaces/problemClassifications.ts new file mode 100644 index 000000000000..e68a2aa49f14 --- /dev/null +++ b/sdk/support/arm-support/src/operationsInterfaces/problemClassifications.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ProblemClassification, + ProblemClassificationsListOptionalParams, + ProblemClassificationsGetOptionalParams, + ProblemClassificationsGetResponse +} from "../models"; + +/// +/** Interface representing a ProblemClassifications. */ +export interface ProblemClassifications { + /** + * Lists all the problem classifications (categories) available for a specific Azure service. Always + * use the service and problem classifications obtained programmatically. This practice ensures that + * you always have the most recent set of service and problem classification Ids. + * @param serviceName Name of the Azure service for which the problem classifications need to be + * retrieved. + * @param options The options parameters. + */ + list( + serviceName: string, + options?: ProblemClassificationsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get problem classification details for a specific Azure service. + * @param serviceName Name of the Azure service available for support. + * @param problemClassificationName Name of problem classification. + * @param options The options parameters. + */ + get( + serviceName: string, + problemClassificationName: string, + options?: ProblemClassificationsGetOptionalParams + ): Promise; +} diff --git a/sdk/support/arm-support/src/operationsInterfaces/services.ts b/sdk/support/arm-support/src/operationsInterfaces/services.ts new file mode 100644 index 000000000000..a12dd7b23552 --- /dev/null +++ b/sdk/support/arm-support/src/operationsInterfaces/services.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Service, + ServicesListOptionalParams, + ServicesGetOptionalParams, + ServicesGetResponse +} from "../models"; + +/// +/** Interface representing a Services. */ +export interface Services { + /** + * Lists all the Azure services available for support ticket creation. For **Technical** issues, select + * the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down + * list on the Azure portal's [New support + * request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. + * Always use the service and its corresponding problem classification(s) obtained programmatically for + * support ticket creation. This practice ensures that you always have the most recent set of service + * and problem classification Ids. + * @param options The options parameters. + */ + list( + options?: ServicesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a specific Azure service for support ticket creation. + * @param serviceName Name of the Azure service. + * @param options The options parameters. + */ + get( + serviceName: string, + options?: ServicesGetOptionalParams + ): Promise; +} diff --git a/sdk/support/arm-support/src/operationsInterfaces/supportTickets.ts b/sdk/support/arm-support/src/operationsInterfaces/supportTickets.ts new file mode 100644 index 000000000000..8b92e8d21423 --- /dev/null +++ b/sdk/support/arm-support/src/operationsInterfaces/supportTickets.ts @@ -0,0 +1,137 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + SupportTicketDetails, + SupportTicketsListOptionalParams, + CheckNameAvailabilityInput, + SupportTicketsCheckNameAvailabilityOptionalParams, + SupportTicketsCheckNameAvailabilityResponse, + SupportTicketsGetOptionalParams, + SupportTicketsGetResponse, + UpdateSupportTicket, + SupportTicketsUpdateOptionalParams, + SupportTicketsUpdateResponse, + SupportTicketsCreateOptionalParams, + SupportTicketsCreateResponse +} from "../models"; + +/// +/** Interface representing a SupportTickets. */ +export interface SupportTickets { + /** + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by + * _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with + * _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket + * data is available for 18 months after ticket creation. If a ticket was created more than 18 months + * ago, a request for data might cause an error. + * @param options The options parameters. + */ + list( + options?: SupportTicketsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the + * name for support ticket creation for the selected subscription. + * @param checkNameAvailabilityInput Input to check. + * @param options The options parameters. + */ + checkNameAvailability( + checkNameAvailabilityInput: CheckNameAvailabilityInput, + options?: SupportTicketsCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after + * ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an + * error. + * @param supportTicketName Support ticket name. + * @param options The options parameters. + */ + get( + supportTicketName: string, + options?: SupportTicketsGetOptionalParams + ): Promise; + /** + * This API allows you to update the severity level, ticket status, and your contact information in the + * support ticket.

Note: The severity levels cannot be changed if a support ticket is actively + * being worked upon by an Azure support engineer. In such a case, contact your support engineer to + * request severity update by adding a new communication using the Communications + * API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an + * engineer is actively working on the ticket, send your ticket closure request by sending a note to + * your engineer. + * @param supportTicketName Support ticket name. + * @param updateSupportTicket UpdateSupportTicket object. + * @param options The options parameters. + */ + update( + supportTicketName: string, + updateSupportTicket: UpdateSupportTicket, + options?: SupportTicketsUpdateOptionalParams + ): Promise; + /** + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and + * Subscription Management issues for the specified subscription. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem + * categories required for support ticket creation.

Adding attachments is not currently + * supported via the API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) + * page in the Azure portal, select the support ticket, and use the file upload control to add a new + * file.

Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for + * consent if your issue requires gathering diagnostic information from your Azure + * resources.

**Creating a support ticket for on-behalf-of**: Include + * _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the + * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from + * the Cloud solution provider (CSP) partner tenant. + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @param options The options parameters. + */ + beginCreate( + supportTicketName: string, + createSupportTicketParameters: SupportTicketDetails, + options?: SupportTicketsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SupportTicketsCreateResponse + > + >; + /** + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and + * Subscription Management issues for the specified subscription. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem + * categories required for support ticket creation.

Adding attachments is not currently + * supported via the API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) + * page in the Azure portal, select the support ticket, and use the file upload control to add a new + * file.

Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for + * consent if your issue requires gathering diagnostic information from your Azure + * resources.

**Creating a support ticket for on-behalf-of**: Include + * _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the + * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from + * the Cloud solution provider (CSP) partner tenant. + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @param options The options parameters. + */ + beginCreateAndWait( + supportTicketName: string, + createSupportTicketParameters: SupportTicketDetails, + options?: SupportTicketsCreateOptionalParams + ): Promise; +} diff --git a/sdk/support/arm-support/test/sampleTest.ts b/sdk/support/arm-support/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/support/arm-support/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/support/arm-support/tsconfig.json b/sdk/support/arm-support/tsconfig.json index 422b584abd5e..aec155702645 100644 --- a/sdk/support/arm-support/tsconfig.json +++ b/sdk/support/arm-support/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,10 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", - "importHelpers": true + "outDir": "./dist-esm", + "importHelpers": true, + "paths": { "@azure/arm-support": ["./src/index"] } }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/support/ci.yml b/sdk/support/ci.yml new file mode 100644 index 000000000000..b047e2725a41 --- /dev/null +++ b/sdk/support/ci.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/support/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/support/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: support + Artifacts: + - name: azure-arm-support + safeName: azurearmsupport + \ No newline at end of file diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/CHANGELOG.md b/sdk/timeseriesinsights/arm-timeseriesinsights/CHANGELOG.md new file mode 100644 index 000000000000..58cbb0ff88da --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-01-21) + +The package of @azure/arm-timeseriesinsights is using our next generation design principles since version 2.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/LICENSE b/sdk/timeseriesinsights/arm-timeseriesinsights/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/README.md b/sdk/timeseriesinsights/arm-timeseriesinsights/README.md index 9552c0e8fead..f1d0f3c79653 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/README.md +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/README.md @@ -1,99 +1,98 @@ -## Azure TimeSeriesInsightsClient SDK for JavaScript +# Azure TimeSeriesInsights client library for JavaScript -This package contains an isomorphic SDK for TimeSeriesInsightsClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure TimeSeriesInsights client. + +Time Series Insights client + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/timeseriesinsights/arm-timeseriesinsights) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-timeseriesinsights) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-timeseriesinsights) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-timeseriesinsights` package -### How to Install +Install the Azure TimeSeriesInsights client library for JavaScript with `npm`: ```bash npm install @azure/arm-timeseriesinsights ``` -### How to use +### Create and authenticate a `TimeSeriesInsightsClient` -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure TimeSeriesInsights API, you will need the `endpoint` of your Azure TimeSeriesInsights resource and a `credential`. The Azure TimeSeriesInsights client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure TimeSeriesInsights resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" +npm install @azure/identity ``` -##### Sample code - -```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { TimeSeriesInsightsClient, TimeSeriesInsightsModels, TimeSeriesInsightsMappers } from "@azure/arm-timeseriesinsights"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new TimeSeriesInsightsClient(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +You will also need to **register a new AAD application and grant access to Azure TimeSeriesInsights** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { TimeSeriesInsightsClient } = require("@azure/arm-timeseriesinsights"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new TimeSeriesInsightsClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). -```bash -npm install @azure/ms-rest-browserauth -``` +## Key concepts -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-timeseriesinsights sample - - - - - - - - +### TimeSeriesInsightsClient + +`TimeSeriesInsightsClient` is the primary interface for developers using the Azure TimeSeriesInsights client library. Explore the methods on this client object to understand the different features of the Azure TimeSeriesInsights service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ftimeseriesinsights%2Farm-timeseriesinsights%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/timeseriesinsights/arm-timeseriesinsights/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/_meta.json b/sdk/timeseriesinsights/arm-timeseriesinsights/_meta.json new file mode 100644 index 000000000000..805ab9973ad4 --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "readme": "specification/timeseriesinsights/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/timeseriesinsights/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" +} \ No newline at end of file diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/api-extractor.json b/sdk/timeseriesinsights/arm-timeseriesinsights/api-extractor.json new file mode 100644 index 000000000000..96d17e928572 --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-timeseriesinsights.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/package.json b/sdk/timeseriesinsights/arm-timeseriesinsights/package.json index d16181f08035..206e9d982ba7 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/package.json +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/package.json @@ -1,58 +1,97 @@ { "name": "@azure/arm-timeseriesinsights", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "TimeSeriesInsightsClient Library with typescript type definitions for node.js and browser.", - "version": "1.2.1", + "description": "A generated SDK for TimeSeriesInsightsClient.", + "version": "2.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-timeseriesinsights.js", - "module": "./esm/timeSeriesInsightsClient.js", - "types": "./esm/timeSeriesInsightsClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-timeseriesinsights.d.ts", "devDependencies": { - "typescript": "^3.5.3", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/timeseriesinsights/arm-timeseriesinsights", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-timeseriesinsights.js.map'\" -o ./dist/arm-timeseriesinsights.min.js ./dist/arm-timeseriesinsights.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, + "//metadata": { + "constantPaths": [ + { "path": "src/TimeSeriesInsightsClient.ts", "prefix": "packageDetails" } + ] + }, "autoPublish": true } diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/recordings/node/my_test/recording_sample_test.js b/sdk/timeseriesinsights/arm-timeseriesinsights/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/review/arm-timeseriesinsights.api.md b/sdk/timeseriesinsights/arm-timeseriesinsights/review/arm-timeseriesinsights.api.md new file mode 100644 index 000000000000..014ba68d8018 --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/review/arm-timeseriesinsights.api.md @@ -0,0 +1,943 @@ +## API Report File for "@azure/arm-timeseriesinsights" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export interface AccessPolicies { + createOrUpdate(resourceGroupName: string, environmentName: string, accessPolicyName: string, parameters: AccessPolicyCreateOrUpdateParameters, options?: AccessPoliciesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, environmentName: string, accessPolicyName: string, options?: AccessPoliciesDeleteOptionalParams): Promise; + get(resourceGroupName: string, environmentName: string, accessPolicyName: string, options?: AccessPoliciesGetOptionalParams): Promise; + listByEnvironment(resourceGroupName: string, environmentName: string, options?: AccessPoliciesListByEnvironmentOptionalParams): Promise; + update(resourceGroupName: string, environmentName: string, accessPolicyName: string, accessPolicyUpdateParameters: AccessPolicyUpdateParameters, options?: AccessPoliciesUpdateOptionalParams): Promise; +} + +// @public +export interface AccessPoliciesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessPoliciesCreateOrUpdateResponse = AccessPolicyResource; + +// @public +export interface AccessPoliciesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface AccessPoliciesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessPoliciesGetResponse = AccessPolicyResource; + +// @public +export interface AccessPoliciesListByEnvironmentOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessPoliciesListByEnvironmentResponse = AccessPolicyListResponse; + +// @public +export interface AccessPoliciesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessPoliciesUpdateResponse = AccessPolicyResource; + +// @public (undocumented) +export interface AccessPolicyCreateOrUpdateParameters { + description?: string; + principalObjectId?: string; + roles?: AccessPolicyRole[]; +} + +// @public +export interface AccessPolicyListResponse { + value?: AccessPolicyResource[]; +} + +// @public +export type AccessPolicyResource = Resource & { + principalObjectId?: string; + description?: string; + roles?: AccessPolicyRole[]; +}; + +// @public +export type AccessPolicyRole = string; + +// @public (undocumented) +export interface AccessPolicyUpdateParameters { + description?: string; + roles?: AccessPolicyRole[]; +} + +// @public +export type AzureEventSourceProperties = EventSourceCommonProperties & { + eventSourceResourceId: string; +}; + +// @public +export interface CloudError { + error?: CloudErrorBody; +} + +// @public +export interface CloudErrorBody { + code?: string; + details?: CloudErrorBody[]; + message?: string; + target?: string; +} + +// @public +export interface CreateOrUpdateTrackedResourceProperties { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type DataStringComparisonBehavior = string; + +// @public +export interface Dimension { + displayName?: string; + name?: string; +} + +// @public +export type EnvironmentCreateOrUpdateParameters = CreateOrUpdateTrackedResourceProperties & { + kind: EnvironmentKind; + sku: Sku; +}; + +// @public (undocumented) +export type EnvironmentCreateOrUpdateParametersUnion = EnvironmentCreateOrUpdateParameters | Gen1EnvironmentCreateOrUpdateParameters | Gen2EnvironmentCreateOrUpdateParameters; + +// @public +export type EnvironmentKind = string; + +// @public +export interface EnvironmentListResponse { + value?: EnvironmentResourceUnion[]; +} + +// @public +export type EnvironmentResource = TrackedResource & { + sku: Sku; + kind: EnvironmentResourceKind; +}; + +// @public +export type EnvironmentResourceKind = string; + +// @public +export type EnvironmentResourceProperties = ResourceProperties & { + readonly dataAccessId?: string; + readonly dataAccessFqdn?: string; + readonly status?: EnvironmentStatus; +}; + +// @public (undocumented) +export type EnvironmentResourceUnion = EnvironmentResource | Gen1EnvironmentResource | Gen2EnvironmentResource; + +// @public +export interface Environments { + beginCreateOrUpdate(resourceGroupName: string, environmentName: string, parameters: EnvironmentCreateOrUpdateParametersUnion, options?: EnvironmentsCreateOrUpdateOptionalParams): Promise, EnvironmentsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, environmentName: string, parameters: EnvironmentCreateOrUpdateParametersUnion, options?: EnvironmentsCreateOrUpdateOptionalParams): Promise; + beginUpdate(resourceGroupName: string, environmentName: string, environmentUpdateParameters: EnvironmentUpdateParametersUnion, options?: EnvironmentsUpdateOptionalParams): Promise, EnvironmentsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, environmentName: string, environmentUpdateParameters: EnvironmentUpdateParametersUnion, options?: EnvironmentsUpdateOptionalParams): Promise; + delete(resourceGroupName: string, environmentName: string, options?: EnvironmentsDeleteOptionalParams): Promise; + get(resourceGroupName: string, environmentName: string, options?: EnvironmentsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: EnvironmentsListByResourceGroupOptionalParams): Promise; + listBySubscription(options?: EnvironmentsListBySubscriptionOptionalParams): Promise; +} + +// @public +export interface EnvironmentsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type EnvironmentsCreateOrUpdateResponse = EnvironmentResourceUnion; + +// @public +export interface EnvironmentsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface EnvironmentsGetOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type EnvironmentsGetResponse = EnvironmentResourceUnion; + +// @public +export interface EnvironmentsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnvironmentsListByResourceGroupResponse = EnvironmentListResponse; + +// @public +export interface EnvironmentsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnvironmentsListBySubscriptionResponse = EnvironmentListResponse; + +// @public +export interface EnvironmentStateDetails { + code?: string; + message?: string; +} + +// @public +export interface EnvironmentStatus { + readonly ingress?: IngressEnvironmentStatus; + readonly warmStorage?: WarmStorageEnvironmentStatus; +} + +// @public +export interface EnvironmentsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type EnvironmentsUpdateResponse = EnvironmentResourceUnion; + +// @public +export interface EnvironmentUpdateParameters { + kind: "Gen1" | "Gen2"; + tags?: { + [propertyName: string]: string; + }; +} + +// @public (undocumented) +export type EnvironmentUpdateParametersUnion = EnvironmentUpdateParameters | Gen1EnvironmentUpdateParameters | Gen2EnvironmentUpdateParameters; + +// @public +export type EventHubEventSourceCommonProperties = AzureEventSourceProperties & { + serviceBusNamespace: string; + eventHubName: string; + consumerGroupName: string; + keyName: string; +}; + +// @public +export type EventHubEventSourceCreateOrUpdateParameters = EventSourceCreateOrUpdateParameters & { + readonly provisioningState?: ProvisioningState; + readonly creationTime?: Date; + timestampPropertyName?: string; + localTimestampPropertiesLocalTimestamp?: LocalTimestamp; + type?: IngressStartAtType; + time?: string; + eventSourceResourceId: string; + serviceBusNamespace: string; + eventHubName: string; + consumerGroupName: string; + keyName: string; + sharedAccessKey: string; +}; + +// @public +export type EventHubEventSourceCreationProperties = EventHubEventSourceCommonProperties & { + sharedAccessKey: string; +}; + +// @public +export type EventHubEventSourceMutableProperties = EventSourceMutableProperties & { + sharedAccessKey?: string; +}; + +// @public +export type EventHubEventSourceResource = EventSourceResource & { + readonly provisioningState?: ProvisioningState; + readonly creationTime?: Date; + timestampPropertyName?: string; + localTimestamp?: LocalTimestamp; + typePropertiesIngressStartAtType?: IngressStartAtType; + time?: string; + eventSourceResourceId: string; + serviceBusNamespace: string; + eventHubName: string; + consumerGroupName: string; + keyName: string; +}; + +// @public +export type EventHubEventSourceResourceProperties = EventHubEventSourceCommonProperties & {}; + +// @public +export type EventHubEventSourceUpdateParameters = EventSourceUpdateParameters & { + kind: "Microsoft.EventHub"; + timestampPropertyName?: string; + sharedAccessKey?: string; +}; + +// @public +export type EventSourceCommonProperties = ResourceProperties & { + timestampPropertyName?: string; + localTimestamp?: LocalTimestamp; + type?: IngressStartAtType; + time?: string; +}; + +// @public +export type EventSourceCreateOrUpdateParameters = CreateOrUpdateTrackedResourceProperties & { + kind: EventSourceKind; + localTimestamp?: LocalTimestamp; +}; + +// @public (undocumented) +export type EventSourceCreateOrUpdateParametersUnion = EventSourceCreateOrUpdateParameters | EventHubEventSourceCreateOrUpdateParameters | IoTHubEventSourceCreateOrUpdateParameters; + +// @public +export type EventSourceKind = string; + +// @public +export interface EventSourceListResponse { + value?: EventSourceResourceUnion[]; +} + +// @public +export interface EventSourceMutableProperties { + timestampPropertyName?: string; +} + +// @public +export type EventSourceResource = TrackedResource & { + kind: EventSourceResourceKind; +}; + +// @public +export type EventSourceResourceKind = string; + +// @public (undocumented) +export type EventSourceResourceUnion = EventSourceResource | EventHubEventSourceResource | IoTHubEventSourceResource; + +// @public +export interface EventSources { + createOrUpdate(resourceGroupName: string, environmentName: string, eventSourceName: string, parameters: EventSourceCreateOrUpdateParametersUnion, options?: EventSourcesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, environmentName: string, eventSourceName: string, options?: EventSourcesDeleteOptionalParams): Promise; + get(resourceGroupName: string, environmentName: string, eventSourceName: string, options?: EventSourcesGetOptionalParams): Promise; + listByEnvironment(resourceGroupName: string, environmentName: string, options?: EventSourcesListByEnvironmentOptionalParams): Promise; + update(resourceGroupName: string, environmentName: string, eventSourceName: string, eventSourceUpdateParameters: EventSourceUpdateParametersUnion, options?: EventSourcesUpdateOptionalParams): Promise; +} + +// @public +export interface EventSourcesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventSourcesCreateOrUpdateResponse = EventSourceResourceUnion; + +// @public +export interface EventSourcesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface EventSourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventSourcesGetResponse = EventSourceResourceUnion; + +// @public +export interface EventSourcesListByEnvironmentOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventSourcesListByEnvironmentResponse = EventSourceListResponse; + +// @public +export interface EventSourcesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventSourcesUpdateResponse = EventSourceResourceUnion; + +// @public +export interface EventSourceUpdateParameters { + kind: "Microsoft.EventHub" | "Microsoft.IoTHub"; + tags?: { + [propertyName: string]: string; + }; +} + +// @public (undocumented) +export type EventSourceUpdateParametersUnion = EventSourceUpdateParameters | EventHubEventSourceUpdateParameters | IoTHubEventSourceUpdateParameters; + +// @public +export type Gen1EnvironmentCreateOrUpdateParameters = EnvironmentCreateOrUpdateParameters & { + dataRetentionTime: string; + storageLimitExceededBehavior?: StorageLimitExceededBehavior; + partitionKeyProperties?: TimeSeriesIdProperty[]; +}; + +// @public +export interface Gen1EnvironmentCreationProperties { + dataRetentionTime: string; + partitionKeyProperties?: TimeSeriesIdProperty[]; + storageLimitExceededBehavior?: StorageLimitExceededBehavior; +} + +// @public +export type Gen1EnvironmentResource = EnvironmentResource & { + dataRetentionTime: string; + storageLimitExceededBehavior?: StorageLimitExceededBehavior; + partitionKeyProperties?: TimeSeriesIdProperty[]; + readonly provisioningState?: ProvisioningState; + readonly creationTime?: Date; + readonly dataAccessId?: string; + readonly dataAccessFqdn?: string; + readonly status?: EnvironmentStatus; +}; + +// @public +export type Gen1EnvironmentResourceProperties = Gen1EnvironmentCreationProperties & EnvironmentResourceProperties & {}; + +// @public +export type Gen1EnvironmentUpdateParameters = EnvironmentUpdateParameters & { + kind: "Gen1"; + sku?: Sku; + dataRetentionTime?: string; + storageLimitExceededBehavior?: StorageLimitExceededBehavior; +}; + +// @public +export type Gen2EnvironmentCreateOrUpdateParameters = EnvironmentCreateOrUpdateParameters & { + timeSeriesIdProperties: TimeSeriesIdProperty[]; + storageConfiguration: Gen2StorageConfigurationInput; + warmStoreConfiguration?: WarmStoreConfigurationProperties; +}; + +// @public +export type Gen2EnvironmentResource = EnvironmentResource & { + readonly provisioningState?: ProvisioningState; + readonly creationTime?: Date; + readonly dataAccessId?: string; + readonly dataAccessFqdn?: string; + readonly status?: EnvironmentStatus; + timeSeriesIdProperties: TimeSeriesIdProperty[]; + storageConfiguration: Gen2StorageConfigurationOutput; + warmStoreConfiguration?: WarmStoreConfigurationProperties; +}; + +// @public +export type Gen2EnvironmentResourceProperties = EnvironmentResourceProperties & { + timeSeriesIdProperties: TimeSeriesIdProperty[]; + storageConfiguration: Gen2StorageConfigurationOutput; + warmStoreConfiguration?: WarmStoreConfigurationProperties; +}; + +// @public +export type Gen2EnvironmentUpdateParameters = EnvironmentUpdateParameters & { + kind: "Gen2"; + storageConfiguration?: Gen2StorageConfigurationMutableProperties; + warmStoreConfiguration?: WarmStoreConfigurationProperties; +}; + +// @public +export interface Gen2StorageConfigurationInput { + accountName: string; + managementKey: string; +} + +// @public +export interface Gen2StorageConfigurationMutableProperties { + managementKey: string; +} + +// @public +export interface Gen2StorageConfigurationOutput { + accountName: string; +} + +// @public +export interface IngressEnvironmentStatus { + state?: IngressState; + readonly stateDetails?: EnvironmentStateDetails; +} + +// @public +export type IngressStartAtType = string; + +// @public +export type IngressState = string; + +// @public +export type IoTHubEventSourceCommonProperties = AzureEventSourceProperties & { + iotHubName: string; + consumerGroupName: string; + keyName: string; +}; + +// @public +export type IoTHubEventSourceCreateOrUpdateParameters = EventSourceCreateOrUpdateParameters & { + readonly provisioningState?: ProvisioningState; + readonly creationTime?: Date; + timestampPropertyName?: string; + localTimestampPropertiesLocalTimestamp?: LocalTimestamp; + type?: IngressStartAtType; + time?: string; + eventSourceResourceId: string; + iotHubName: string; + consumerGroupName: string; + keyName: string; + sharedAccessKey: string; +}; + +// @public +export type IoTHubEventSourceCreationProperties = IoTHubEventSourceCommonProperties & { + sharedAccessKey: string; +}; + +// @public +export type IoTHubEventSourceMutableProperties = EventSourceMutableProperties & { + sharedAccessKey?: string; +}; + +// @public +export type IoTHubEventSourceResource = EventSourceResource & { + readonly provisioningState?: ProvisioningState; + readonly creationTime?: Date; + timestampPropertyName?: string; + localTimestamp?: LocalTimestamp; + typePropertiesIngressStartAtType?: IngressStartAtType; + time?: string; + eventSourceResourceId: string; + iotHubName: string; + consumerGroupName: string; + keyName: string; +}; + +// @public +export type IoTHubEventSourceResourceProperties = IoTHubEventSourceCommonProperties & {}; + +// @public +export type IoTHubEventSourceUpdateParameters = EventSourceUpdateParameters & { + kind: "Microsoft.IoTHub"; + timestampPropertyName?: string; + sharedAccessKey?: string; +}; + +// @public +export enum KnownAccessPolicyRole { + // (undocumented) + Contributor = "Contributor", + // (undocumented) + Reader = "Reader" +} + +// @public +export enum KnownDataStringComparisonBehavior { + // (undocumented) + Ordinal = "Ordinal", + // (undocumented) + OrdinalIgnoreCase = "OrdinalIgnoreCase" +} + +// @public +export enum KnownEnvironmentKind { + // (undocumented) + Gen1 = "Gen1", + // (undocumented) + Gen2 = "Gen2" +} + +// @public +export enum KnownEnvironmentResourceKind { + // (undocumented) + Gen1 = "Gen1", + // (undocumented) + Gen2 = "Gen2" +} + +// @public +export enum KnownEventSourceKind { + // (undocumented) + MicrosoftEventHub = "Microsoft.EventHub", + // (undocumented) + MicrosoftIoTHub = "Microsoft.IoTHub" +} + +// @public +export enum KnownEventSourceResourceKind { + // (undocumented) + MicrosoftEventHub = "Microsoft.EventHub", + // (undocumented) + MicrosoftIoTHub = "Microsoft.IoTHub" +} + +// @public +export enum KnownIngressStartAtType { + // (undocumented) + CustomEnqueuedTime = "CustomEnqueuedTime", + // (undocumented) + EarliestAvailable = "EarliestAvailable", + // (undocumented) + EventSourceCreationTime = "EventSourceCreationTime" +} + +// @public +export enum KnownIngressState { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Paused = "Paused", + // (undocumented) + Ready = "Ready", + // (undocumented) + Running = "Running", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export enum KnownLocalTimestampFormat { + // (undocumented) + Embedded = "Embedded" +} + +// @public +export enum KnownPropertyType { + // (undocumented) + String = "String" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownReferenceDataKeyPropertyType { + // (undocumented) + Bool = "Bool", + // (undocumented) + DateTime = "DateTime", + // (undocumented) + Double = "Double", + // (undocumented) + String = "String" +} + +// @public +export enum KnownSkuName { + // (undocumented) + L1 = "L1", + // (undocumented) + P1 = "P1", + // (undocumented) + S1 = "S1", + // (undocumented) + S2 = "S2" +} + +// @public +export enum KnownStorageLimitExceededBehavior { + // (undocumented) + PauseIngress = "PauseIngress", + // (undocumented) + PurgeOldData = "PurgeOldData" +} + +// @public +export enum KnownWarmStoragePropertiesState { + // (undocumented) + Error = "Error", + // (undocumented) + Ok = "Ok", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export interface LocalTimestamp { + format?: LocalTimestampFormat; + timeZoneOffset?: LocalTimestampTimeZoneOffset; +} + +// @public +export type LocalTimestampFormat = string; + +// @public +export interface LocalTimestampTimeZoneOffset { + propertyName?: string; +} + +// @public +export interface LogSpecification { + displayName?: string; + name?: string; +} + +// @public +export interface MetricAvailability { + // (undocumented) + blobDuration?: string; + // (undocumented) + timeGrain?: string; +} + +// @public +export interface MetricSpecification { + aggregationType?: string; + availabilities?: MetricAvailability[]; + category?: string; + dimensions?: Dimension[]; + displayDescription?: string; + displayName?: string; + name?: string; + resourceIdDimensionNameOverride?: string; + unit?: string; +} + +// @public +export interface Operation { + readonly display?: OperationDisplay; + readonly name?: string; + origin?: string; + serviceSpecification?: ServiceSpecification; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type PropertyType = string; + +// @public +export type ProvisioningState = string; + +// @public +export type ReferenceDataKeyPropertyType = string; + +// @public (undocumented) +export type ReferenceDataSetCreateOrUpdateParameters = CreateOrUpdateTrackedResourceProperties & { + keyProperties: ReferenceDataSetKeyProperty[]; + dataStringComparisonBehavior?: DataStringComparisonBehavior; +}; + +// @public +export interface ReferenceDataSetCreationProperties { + dataStringComparisonBehavior?: DataStringComparisonBehavior; + keyProperties: ReferenceDataSetKeyProperty[]; +} + +// @public +export interface ReferenceDataSetKeyProperty { + name?: string; + type?: ReferenceDataKeyPropertyType; +} + +// @public +export interface ReferenceDataSetListResponse { + value?: ReferenceDataSetResource[]; +} + +// @public +export type ReferenceDataSetResource = TrackedResource & { + keyProperties?: ReferenceDataSetKeyProperty[]; + dataStringComparisonBehavior?: DataStringComparisonBehavior; + readonly provisioningState?: ProvisioningState; + readonly creationTime?: Date; +}; + +// @public +export type ReferenceDataSetResourceProperties = ReferenceDataSetCreationProperties & ResourceProperties & {}; + +// @public +export interface ReferenceDataSets { + createOrUpdate(resourceGroupName: string, environmentName: string, referenceDataSetName: string, parameters: ReferenceDataSetCreateOrUpdateParameters, options?: ReferenceDataSetsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options?: ReferenceDataSetsDeleteOptionalParams): Promise; + get(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options?: ReferenceDataSetsGetOptionalParams): Promise; + listByEnvironment(resourceGroupName: string, environmentName: string, options?: ReferenceDataSetsListByEnvironmentOptionalParams): Promise; + update(resourceGroupName: string, environmentName: string, referenceDataSetName: string, referenceDataSetUpdateParameters: ReferenceDataSetUpdateParameters, options?: ReferenceDataSetsUpdateOptionalParams): Promise; +} + +// @public +export interface ReferenceDataSetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReferenceDataSetsCreateOrUpdateResponse = ReferenceDataSetResource; + +// @public +export interface ReferenceDataSetsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ReferenceDataSetsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReferenceDataSetsGetResponse = ReferenceDataSetResource; + +// @public +export interface ReferenceDataSetsListByEnvironmentOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReferenceDataSetsListByEnvironmentResponse = ReferenceDataSetListResponse; + +// @public +export interface ReferenceDataSetsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReferenceDataSetsUpdateResponse = ReferenceDataSetResource; + +// @public +export interface ReferenceDataSetUpdateParameters { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ResourceProperties { + readonly creationTime?: Date; + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface ServiceSpecification { + logSpecifications?: LogSpecification[]; + metricSpecifications?: MetricSpecification[]; +} + +// @public +export interface Sku { + capacity: number; + name: SkuName; +} + +// @public +export type SkuName = string; + +// @public +export type StorageLimitExceededBehavior = string; + +// @public +export interface TimeSeriesIdProperty { + name?: string; + type?: PropertyType; +} + +// @public (undocumented) +export class TimeSeriesInsightsClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: TimeSeriesInsightsClientOptionalParams); + // (undocumented) + accessPolicies: AccessPolicies; + // (undocumented) + apiVersion: string; + // (undocumented) + environments: Environments; + // (undocumented) + eventSources: EventSources; + // (undocumented) + operations: Operations; + // (undocumented) + referenceDataSets: ReferenceDataSets; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface TimeSeriesInsightsClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type TrackedResource = Resource & { + location: string; + tags?: { + [propertyName: string]: string; + }; +}; + +// @public +export interface WarmStorageEnvironmentStatus { + currentCount?: number; + maxCount?: number; + state?: WarmStoragePropertiesState; +} + +// @public +export type WarmStoragePropertiesState = string; + +// @public +export interface WarmStoreConfigurationProperties { + dataRetention: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/rollup.config.js b/sdk/timeseriesinsights/arm-timeseriesinsights/rollup.config.js index 04a56329ade2..9be1955eb7f1 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/rollup.config.js +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/timeSeriesInsightsClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-timeseriesinsights.js", - format: "umd", - name: "Azure.ArmTimeseriesinsights", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/index.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/index.ts new file mode 100644 index 000000000000..01c6942f974f --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { TimeSeriesInsightsClient } from "./timeSeriesInsightsClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/lroImpl.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/accessPoliciesMappers.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/accessPoliciesMappers.ts deleted file mode 100644 index b095b795dd22..000000000000 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/accessPoliciesMappers.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - AccessPolicyCreateOrUpdateParameters, - AccessPolicyListResponse, - AccessPolicyResource, - AccessPolicyUpdateParameters, - BaseResource, - CloudError, - EnvironmentResource, - EnvironmentStateDetails, - EnvironmentStatus, - EventHubEventSourceResource, - EventSourceResource, - IngressEnvironmentStatus, - IoTHubEventSourceResource, - PartitionKeyProperty, - ReferenceDataSetKeyProperty, - ReferenceDataSetResource, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/environmentsMappers.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/environmentsMappers.ts deleted file mode 100644 index 9c64265aaa1d..000000000000 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/environmentsMappers.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - AccessPolicyResource, - BaseResource, - CloudError, - CreateOrUpdateTrackedResourceProperties, - EnvironmentCreateOrUpdateParameters, - EnvironmentListResponse, - EnvironmentResource, - EnvironmentStateDetails, - EnvironmentStatus, - EnvironmentUpdateParameters, - EventHubEventSourceCreateOrUpdateParameters, - EventHubEventSourceResource, - EventSourceCreateOrUpdateParameters, - EventSourceResource, - IngressEnvironmentStatus, - IoTHubEventSourceCreateOrUpdateParameters, - IoTHubEventSourceResource, - PartitionKeyProperty, - ReferenceDataSetCreateOrUpdateParameters, - ReferenceDataSetKeyProperty, - ReferenceDataSetResource, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/eventSourcesMappers.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/eventSourcesMappers.ts deleted file mode 100644 index 6131d4200cdc..000000000000 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/eventSourcesMappers.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - AccessPolicyResource, - BaseResource, - CloudError, - CreateOrUpdateTrackedResourceProperties, - EnvironmentCreateOrUpdateParameters, - EnvironmentResource, - EnvironmentStateDetails, - EnvironmentStatus, - EventHubEventSourceCreateOrUpdateParameters, - EventHubEventSourceResource, - EventHubEventSourceUpdateParameters, - EventSourceCreateOrUpdateParameters, - EventSourceListResponse, - EventSourceResource, - EventSourceUpdateParameters, - IngressEnvironmentStatus, - IoTHubEventSourceCreateOrUpdateParameters, - IoTHubEventSourceResource, - IoTHubEventSourceUpdateParameters, - LocalTimestamp, - LocalTimestampTimeZoneOffset, - PartitionKeyProperty, - ReferenceDataSetCreateOrUpdateParameters, - ReferenceDataSetKeyProperty, - ReferenceDataSetResource, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/index.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/index.ts index 9793e4c43827..1409fd6a9a8b 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/index.ts +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/index.ts @@ -1,1496 +1,1269 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; + +export type EnvironmentUpdateParametersUnion = + | EnvironmentUpdateParameters + | Gen1EnvironmentUpdateParameters + | Gen2EnvironmentUpdateParameters; +export type EventSourceUpdateParametersUnion = + | EventSourceUpdateParameters + | EventHubEventSourceUpdateParameters + | IoTHubEventSourceUpdateParameters; +export type EnvironmentCreateOrUpdateParametersUnion = + | EnvironmentCreateOrUpdateParameters + | Gen1EnvironmentCreateOrUpdateParameters + | Gen2EnvironmentCreateOrUpdateParameters; +export type EventSourceCreateOrUpdateParametersUnion = + | EventSourceCreateOrUpdateParameters + | EventHubEventSourceCreateOrUpdateParameters + | IoTHubEventSourceCreateOrUpdateParameters; +export type EnvironmentResourceUnion = + | EnvironmentResource + | Gen1EnvironmentResource + | Gen2EnvironmentResource; +export type EventSourceResourceUnion = + | EventSourceResource + | EventHubEventSourceResource + | IoTHubEventSourceResource; + +/** Result of the request to list Time Series Insights operations. It contains a list of operations and a URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of Time Series Insights operations supported by the Microsoft.TimeSeriesInsights resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} -export { BaseResource, CloudError }; +/** A Time Series Insights REST API operation */ +export interface Operation { + /** + * The name of the operation being performed on this particular object. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Contains the localized display information for this particular operation / action. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly display?: OperationDisplay; + /** The intended executor of the operation. */ + origin?: string; + /** One property of operation, include metric specifications. */ + serviceSpecification?: ServiceSpecification; +} -/** - * Contains the localized display information for this particular operation / action. - */ +/** Contains the localized display information for this particular operation / action. */ export interface OperationDisplay { /** * The localized friendly form of the resource provider name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provider?: string; /** * The localized friendly form of the resource type related to this action/operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resource?: string; /** * The localized friendly name for the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly operation?: string; /** * The localized friendly description for the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly description?: string; } -/** - * A Time Series Insights REST API operation - */ -export interface Operation { - /** - * The name of the operation being performed on this particular object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Contains the localized display information for this particular operation / action. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly display?: OperationDisplay; +/** One property of operation, include metric specifications. */ +export interface ServiceSpecification { + /** Metric specifications of operation. */ + metricSpecifications?: MetricSpecification[]; + /** A list of Azure Monitoring log definitions. */ + logSpecifications?: LogSpecification[]; } -/** - * Time Series Insights resource - */ -export interface Resource extends BaseResource { +/** Metric specification of operation. */ +export interface MetricSpecification { + /** Name of metric specification. */ + name?: string; + /** Display name of metric specification. */ + displayName?: string; + /** Display description of metric specification. */ + displayDescription?: string; + /** Unit could be Bytes or Count. */ + unit?: string; + /** Dimensions of blobs, including blob type and access tier. */ + dimensions?: Dimension[]; + /** Aggregation type could be Average. */ + aggregationType?: string; + /** Retention policies of a resource metric. */ + availabilities?: MetricAvailability[]; + /** The category this metric specification belong to, could be Capacity. */ + category?: string; + /** Account Resource Id. */ + resourceIdDimensionNameOverride?: string; +} + +/** Dimension of blobs, possibly be blob type or access tier. */ +export interface Dimension { + /** Display name of dimension. */ + name?: string; + /** Display name of dimension. */ + displayName?: string; +} + +/** Retention policy of a resource metric. */ +export interface MetricAvailability { + timeGrain?: string; + blobDuration?: string; +} + +/** The specification of an Azure Monitoring log. */ +export interface LogSpecification { + /** Log name. */ + name?: string; + /** Log display name. */ + displayName?: string; +} + +/** Contains information about an API error. */ +export interface CloudError { + /** Describes a particular API error with an error code and a message. */ + error?: CloudErrorBody; +} + +/** Describes a particular API error with an error code and a message. */ +export interface CloudErrorBody { + /** An error code that describes the error condition more precisely than an HTTP status code. Can be used to programmatically handle specific error cases. */ + code?: string; + /** A message that describes the error in detail and provides debugging information. */ + message?: string; + /** The target of the particular error (for example, the name of the property in error). */ + target?: string; + /** Contains nested errors that are related to this error. */ + details?: CloudErrorBody[]; +} + +/** The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress rate, and the billing rate. */ +export interface Sku { + /** The name of this SKU. */ + name: SkuName; + /** The capacity of the sku. For Gen1 environments, this value can be changed to support scale out of environments after they have been created. */ + capacity: number; +} + +/** Properties required to create any resource tracked by Azure Resource Manager. */ +export interface CreateOrUpdateTrackedResourceProperties { + /** The location of the resource. */ + location: string; + /** Key-value pairs of additional properties for the resource. */ + tags?: { [propertyName: string]: string }; +} + +/** Time Series Insights resource */ +export interface Resource { /** * Resource Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * Resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * Resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; } -/** - * Time Series Insights resource that is tracked by Azure Resource Manager. - */ -export interface TrackedResource extends Resource { - /** - * Resource location - */ - location: string; - /** - * Resource tags - */ +/** Parameters supplied to the Update Environment operation. */ +export interface EnvironmentUpdateParameters { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "Gen1" | "Gen2"; + /** Key-value pairs of additional properties for the environment. */ tags?: { [propertyName: string]: string }; } -/** - * Properties that are common to all tracked resources. - */ +/** The response of the List Environments operation. */ +export interface EnvironmentListResponse { + /** Result of the List Environments operation. */ + value?: EnvironmentResourceUnion[]; +} + +/** An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. */ +export interface LocalTimestamp { + /** An enum that represents the format of the local timestamp property that needs to be set. */ + format?: LocalTimestampFormat; + /** An object that represents the offset information for the local timestamp format specified. Should not be specified for LocalTimestampFormat - Embedded. */ + timeZoneOffset?: LocalTimestampTimeZoneOffset; +} + +/** An object that represents the offset information for the local timestamp format specified. Should not be specified for LocalTimestampFormat - Embedded. */ +export interface LocalTimestampTimeZoneOffset { + /** The event property that will be contain the offset information to calculate the local timestamp. When the LocalTimestampFormat is Iana, the property name will contain the name of the column which contains IANA Timezone Name (eg: Americas/Los Angeles). When LocalTimestampFormat is Timespan, it contains the name of property which contains values representing the offset (eg: P1D or 1.00:00:00) */ + propertyName?: string; +} + +/** Parameters supplied to the Update Event Source operation. */ +export interface EventSourceUpdateParameters { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "Microsoft.EventHub" | "Microsoft.IoTHub"; + /** Key-value pairs of additional properties for the event source. */ + tags?: { [propertyName: string]: string }; +} + +/** The response of the List EventSources operation. */ +export interface EventSourceListResponse { + /** Result of the List EventSources operation. */ + value?: EventSourceResourceUnion[]; +} + +/** Properties used to create a reference data set. */ +export interface ReferenceDataSetCreationProperties { + /** The list of key properties for the reference data set. */ + keyProperties: ReferenceDataSetKeyProperty[]; + /** The reference data set key comparison behavior can be set using this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. */ + dataStringComparisonBehavior?: DataStringComparisonBehavior; +} + +/** A key property for the reference data set. A reference data set can have multiple key properties. */ +export interface ReferenceDataSetKeyProperty { + /** The name of the key property. */ + name?: string; + /** The type of the key property. */ + type?: ReferenceDataKeyPropertyType; +} + +/** Properties that are common to all tracked resources. */ export interface ResourceProperties { /** - * Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', - * 'Updating', 'Succeeded', 'Failed', 'Deleting' + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provisioningState?: ProvisioningState; + readonly provisioningState?: ProvisioningState; /** * The time the resource was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly creationTime?: Date; } -/** - * The sku determines the capacity of the environment, the SLA (in queries-per-minute and total - * capacity), and the billing rate. - */ -export interface Sku { - /** - * The name of this SKU. Possible values include: 'S1', 'S2' - */ - name: SkuName; - /** - * The capacity of the sku. This value can be changed to support scale out of environments after - * they have been created. - */ - capacity: number; +/** Parameters supplied to the Update Reference Data Set operation. */ +export interface ReferenceDataSetUpdateParameters { + /** Key-value pairs of additional properties for the reference data set. */ + tags?: { [propertyName: string]: string }; } -/** - * Properties required to create any resource tracked by Azure Resource Manager. - */ -export interface CreateOrUpdateTrackedResourceProperties { - /** - * The location of the resource. - */ - location: string; - /** - * Key-value pairs of additional properties for the resource. - */ - tags?: { [propertyName: string]: string }; +/** The response of the List Reference Data Sets operation. */ +export interface ReferenceDataSetListResponse { + /** Result of the List Reference Data Sets operation. */ + value?: ReferenceDataSetResource[]; } -/** - * The structure of the property that a partition key can have. An environment can have multiple - * such properties. - */ -export interface PartitionKeyProperty { - /** - * The name of the property. - */ - name?: string; - /** - * The type of the property. Possible values include: 'String' - */ - type?: PropertyType; +export interface AccessPolicyCreateOrUpdateParameters { + /** The objectId of the principal in Azure Active Directory. */ + principalObjectId?: string; + /** An description of the access policy. */ + description?: string; + /** The list of roles the principal is assigned on the environment. */ + roles?: AccessPolicyRole[]; } -/** - * Parameters supplied to the CreateOrUpdate Environment operation. - */ -export interface EnvironmentCreateOrUpdateParameters extends CreateOrUpdateTrackedResourceProperties { - /** - * The sku determines the capacity of the environment, the SLA (in queries-per-minute and total - * capacity), and the billing rate. - */ - sku: Sku; - /** - * ISO8601 timespan specifying the minimum number of days the environment's events will be - * available for query. - */ +export interface AccessPolicyUpdateParameters { + /** An description of the access policy. */ + description?: string; + /** The list of roles the principal is assigned on the environment. */ + roles?: AccessPolicyRole[]; +} + +/** The response of the List access policies operation. */ +export interface AccessPolicyListResponse { + /** Result of the List access policies operation. */ + value?: AccessPolicyResource[]; +} + +/** The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. */ +export interface WarmStoreConfigurationProperties { + /** ISO8601 timespan specifying the number of days the environment's events will be available for query from the warm store. */ + dataRetention: string; +} + +/** The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. */ +export interface Gen2StorageConfigurationInput { + /** The name of the storage account that will hold the environment's Gen2 data. */ + accountName: string; + /** The value of the management key that grants the Time Series Insights service write access to the storage account. This property is not shown in environment responses. */ + managementKey: string; +} + +/** The storage configuration provides the non-secret connection details about the customer storage account that is used to store the environment's data. */ +export interface Gen2StorageConfigurationOutput { + /** The name of the storage account that will hold the environment's Gen2 data. */ + accountName: string; +} + +/** The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. */ +export interface Gen2StorageConfigurationMutableProperties { + /** The value of the management key that grants the Time Series Insights service write access to the storage account. This property is not shown in environment responses. */ + managementKey: string; +} + +/** Properties used to create a Gen1 environment. */ +export interface Gen1EnvironmentCreationProperties { + /** ISO8601 timespan specifying the minimum number of days the environment's events will be available for query. */ dataRetentionTime: string; - /** - * The behavior the Time Series Insights service should take when the environment's capacity has - * been exceeded. If "PauseIngress" is specified, new events will not be read from the event - * source. If "PurgeOldData" is specified, new events will continue to be read and old events - * will be deleted from the environment. The default behavior is PurgeOldData. Possible values - * include: 'PurgeOldData', 'PauseIngress' - */ + /** The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. */ storageLimitExceededBehavior?: StorageLimitExceededBehavior; - /** - * The list of partition keys according to which the data in the environment will be ordered. - */ - partitionKeyProperties?: PartitionKeyProperty[]; + /** The list of event properties which will be used to partition data in the environment. Currently, only a single partition key property is supported. */ + partitionKeyProperties?: TimeSeriesIdProperty[]; } -/** - * Parameters supplied to the Update Environment operation. - */ -export interface EnvironmentUpdateParameters { - /** - * The sku of the environment. - */ - sku?: Sku; - /** - * Key-value pairs of additional properties for the environment. - */ - tags?: { [propertyName: string]: string }; - /** - * ISO8601 timespan specifying the minimum number of days the environment's events will be - * available for query. - */ - dataRetentionTime?: string; - /** - * The behavior the Time Series Insights service should take when the environment's capacity has - * been exceeded. If "PauseIngress" is specified, new events will not be read from the event - * source. If "PurgeOldData" is specified, new events will continue to be read and old events - * will be deleted from the environment. The default behavior is PurgeOldData. Possible values - * include: 'PurgeOldData', 'PauseIngress' - */ - storageLimitExceededBehavior?: StorageLimitExceededBehavior; - /** - * The list of event properties which will be used to partition data in the environment. - */ - partitionKeyProperties?: PartitionKeyProperty[]; +/** The structure of the property that a time series id can have. An environment can have multiple such properties. */ +export interface TimeSeriesIdProperty { + /** The name of the property. */ + name?: string; + /** The type of the property. */ + type?: PropertyType; } -/** - * An object that contains the details about an environment's state. - */ -export interface EnvironmentStateDetails { +/** An object that represents the status of the environment, and its internal state in the Time Series Insights service. */ +export interface EnvironmentStatus { /** - * Contains the code that represents the reason of an environment being in a particular state. - * Can be used to programmatically handle specific cases. + * An object that represents the status of ingress on an environment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - code?: string; + readonly ingress?: IngressEnvironmentStatus; /** - * A message that describes the state in detail. + * An object that represents the status of warm storage on an environment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - message?: string; + readonly warmStorage?: WarmStorageEnvironmentStatus; } -/** - * An object that represents the status of ingress on an environment. - */ +/** An object that represents the status of ingress on an environment. */ export interface IngressEnvironmentStatus { - /** - * This string represents the state of ingress operations on an environment. It can be - * "Disabled", "Ready", "Running", "Paused" or "Unknown". Possible values include: 'Disabled', - * 'Ready', 'Running', 'Paused', 'Unknown' - */ + /** This string represents the state of ingress operations on an environment. It can be "Disabled", "Ready", "Running", "Paused" or "Unknown" */ state?: IngressState; /** * An object that contains the details about an environment's state. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - stateDetails?: EnvironmentStateDetails; + readonly stateDetails?: EnvironmentStateDetails; } -/** - * An object that represents the status of the environment, and its internal state in the Time - * Series Insights service. - */ -export interface EnvironmentStatus { - /** - * An object that represents the status of ingress on an environment. - */ - ingress?: IngressEnvironmentStatus; +/** An object that contains the details about an environment's state. */ +export interface EnvironmentStateDetails { + /** Contains the code that represents the reason of an environment being in a particular state. Can be used to programmatically handle specific cases. */ + code?: string; + /** A message that describes the state in detail. */ + message?: string; } -/** - * An environment is a set of time-series data available for query, and is the top level Azure Time - * Series Insights resource. - */ -export interface EnvironmentResource extends TrackedResource { - /** - * The sku determines the capacity of the environment, the SLA (in queries-per-minute and total - * capacity), and the billing rate. - */ +/** An object that represents the status of warm storage on an environment. */ +export interface WarmStorageEnvironmentStatus { + /** This string represents the state of warm storage properties usage. It can be "Ok", "Error", "Unknown". */ + state?: WarmStoragePropertiesState; + /** A value that represents the number of properties used by the environment for S1/S2 SKU and number of properties used by Warm Store for PAYG SKU */ + currentCount?: number; + /** A value that represents the maximum number of properties used allowed by the environment for S1/S2 SKU and maximum number of properties allowed by Warm Store for PAYG SKU. */ + maxCount?: number; +} + +/** An object that represents a set of mutable event source resource properties. */ +export interface EventSourceMutableProperties { + /** The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. */ + timestampPropertyName?: string; +} + +/** Parameters supplied to the CreateOrUpdate Environment operation. */ +export type EnvironmentCreateOrUpdateParameters = CreateOrUpdateTrackedResourceProperties & { + /** The kind of the environment. */ + kind: EnvironmentKind; + /** The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress rate, and the billing rate. */ + sku: Sku; +}; + +/** Parameters supplied to the Create or Update Event Source operation. */ +export type EventSourceCreateOrUpdateParameters = CreateOrUpdateTrackedResourceProperties & { + /** The kind of the event source. */ + kind: EventSourceKind; + /** An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. */ + localTimestamp?: LocalTimestamp; +}; + +export type ReferenceDataSetCreateOrUpdateParameters = CreateOrUpdateTrackedResourceProperties & { + /** The list of key properties for the reference data set. */ + keyProperties: ReferenceDataSetKeyProperty[]; + /** The reference data set key comparison behavior can be set using this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. */ + dataStringComparisonBehavior?: DataStringComparisonBehavior; +}; + +/** Time Series Insights resource that is tracked by Azure Resource Manager. */ +export type TrackedResource = Resource & { + /** Resource location */ + location: string; + /** Resource tags */ + tags?: { [propertyName: string]: string }; +}; + +/** An access policy is used to grant users and applications access to the environment. Roles are assigned to service principals in Azure Active Directory. These roles define the actions the principal can perform through the Time Series Insights data plane APIs. */ +export type AccessPolicyResource = Resource & { + /** The objectId of the principal in Azure Active Directory. */ + principalObjectId?: string; + /** An description of the access policy. */ + description?: string; + /** The list of roles the principal is assigned on the environment. */ + roles?: AccessPolicyRole[]; +}; + +/** Parameters supplied to the Update Environment operation to update a Gen1 environment. */ +export type Gen1EnvironmentUpdateParameters = EnvironmentUpdateParameters & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "Gen1"; + /** The sku of the environment. */ sku?: Sku; - /** - * ISO8601 timespan specifying the minimum number of days the environment's events will be - * available for query. - */ - dataRetentionTime: string; - /** - * The behavior the Time Series Insights service should take when the environment's capacity has - * been exceeded. If "PauseIngress" is specified, new events will not be read from the event - * source. If "PurgeOldData" is specified, new events will continue to be read and old events - * will be deleted from the environment. The default behavior is PurgeOldData. Possible values - * include: 'PurgeOldData', 'PauseIngress' - */ + /** ISO8601 timespan specifying the minimum number of days the environment's events will be available for query. */ + dataRetentionTime?: string; + /** The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. */ storageLimitExceededBehavior?: StorageLimitExceededBehavior; +}; + +/** Parameters supplied to the Update Environment operation to update a Gen2 environment. */ +export type Gen2EnvironmentUpdateParameters = EnvironmentUpdateParameters & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "Gen2"; + /** The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. */ + storageConfiguration?: Gen2StorageConfigurationMutableProperties; + /** The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. */ + warmStoreConfiguration?: WarmStoreConfigurationProperties; +}; + +/** Parameters supplied to the Update Event Source operation to update an EventHub event source. */ +export type EventHubEventSourceUpdateParameters = EventSourceUpdateParameters & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "Microsoft.EventHub"; + /** The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. */ + timestampPropertyName?: string; + /** The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses. */ + sharedAccessKey?: string; +}; + +/** Parameters supplied to the Update Event Source operation to update an IoTHub event source. */ +export type IoTHubEventSourceUpdateParameters = EventSourceUpdateParameters & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "Microsoft.IoTHub"; + /** The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. */ + timestampPropertyName?: string; + /** The value of the shared access key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses. */ + sharedAccessKey?: string; +}; + +/** Properties of the reference data set. */ +export type ReferenceDataSetResourceProperties = ReferenceDataSetCreationProperties & + ResourceProperties & {}; + +/** Properties of the environment. */ +export type EnvironmentResourceProperties = ResourceProperties & { /** - * The list of partition keys according to which the data in the environment will be ordered. - */ - partitionKeyProperties?: PartitionKeyProperty[]; - /** - * Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', - * 'Updating', 'Succeeded', 'Failed', 'Deleting' - */ - provisioningState?: ProvisioningState; - /** - * The time the resource was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly creationTime?: Date; - /** - * An id used to access the environment data, e.g. to query the environment's events or upload - * reference data for the environment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * An id used to access the environment data, e.g. to query the environment's events or upload reference data for the environment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly dataAccessId?: string; /** - * The fully qualified domain name used to access the environment data, e.g. to query the - * environment's events or upload reference data for the environment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The fully qualified domain name used to access the environment data, e.g. to query the environment's events or upload reference data for the environment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly dataAccessFqdn?: string; /** - * An object that represents the status of the environment, and its internal state in the Time - * Series Insights service. + * An object that represents the status of the environment, and its internal state in the Time Series Insights service. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status?: EnvironmentStatus; -} - -/** - * The response of the List Environments operation. - */ -export interface EnvironmentListResponse { - /** - * Result of the List Environments operation. - */ - value?: EnvironmentResource[]; -} - -/** - * Contains the possible cases for EventSourceCreateOrUpdateParameters. - */ -export type EventSourceCreateOrUpdateParametersUnion = EventSourceCreateOrUpdateParameters | EventHubEventSourceCreateOrUpdateParameters | IoTHubEventSourceCreateOrUpdateParameters; - -/** - * Parameters supplied to the Create or Update Event Source operation. - */ -export interface EventSourceCreateOrUpdateParameters { - /** - * Polymorphic Discriminator - */ - kind: "EventSourceCreateOrUpdateParameters"; - /** - * The location of the resource. - */ - location: string; - /** - * Key-value pairs of additional properties for the resource. - */ - tags?: { [propertyName: string]: string }; -} - -/** - * Parameters supplied to the Create or Update Event Source operation for an EventHub event source. - */ -export interface EventHubEventSourceCreateOrUpdateParameters { - /** - * Polymorphic Discriminator - */ - kind: "Microsoft.EventHub"; - /** - * The location of the resource. - */ - location: string; - /** - * Key-value pairs of additional properties for the resource. - */ - tags?: { [propertyName: string]: string }; - /** - * Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', - * 'Updating', 'Succeeded', 'Failed', 'Deleting' - */ - provisioningState?: ProvisioningState; - /** - * The time the resource was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly creationTime?: Date; - /** - * The event property that will be used as the event source's timestamp. If a value isn't - * specified for timestampPropertyName, or if null or empty-string is specified, the event - * creation time will be used. - */ - timestampPropertyName?: string; - /** - * The resource id of the event source in Azure Resource Manager. - */ - eventSourceResourceId: string; - /** - * The name of the service bus that contains the event hub. - */ - serviceBusNamespace: string; - /** - * The name of the event hub. - */ - eventHubName: string; - /** - * The name of the event hub's consumer group that holds the partitions from which events will be - * read. - */ - consumerGroupName: string; - /** - * The name of the SAS key that grants the Time Series Insights service access to the event hub. - * The shared access policies for this key must grant 'Listen' permissions to the event hub. - */ - keyName: string; - /** - * The value of the shared access key that grants the Time Series Insights service read access to - * the event hub. This property is not shown in event source responses. - */ - sharedAccessKey: string; -} + readonly status?: EnvironmentStatus; +}; -/** - * Parameters supplied to the Create or Update Event Source operation for an IoTHub event source. - */ -export interface IoTHubEventSourceCreateOrUpdateParameters { - /** - * Polymorphic Discriminator - */ - kind: "Microsoft.IoTHub"; - /** - * The location of the resource. - */ - location: string; - /** - * Key-value pairs of additional properties for the resource. - */ - tags?: { [propertyName: string]: string }; - /** - * Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', - * 'Updating', 'Succeeded', 'Failed', 'Deleting' - */ - provisioningState?: ProvisioningState; - /** - * The time the resource was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly creationTime?: Date; - /** - * The event property that will be used as the event source's timestamp. If a value isn't - * specified for timestampPropertyName, or if null or empty-string is specified, the event - * creation time will be used. - */ +/** Properties of the event source. */ +export type EventSourceCommonProperties = ResourceProperties & { + /** The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. */ timestampPropertyName?: string; - /** - * The resource id of the event source in Azure Resource Manager. - */ - eventSourceResourceId: string; - /** - * The name of the iot hub. - */ - iotHubName: string; - /** - * The name of the iot hub's consumer group that holds the partitions from which events will be - * read. - */ - consumerGroupName: string; - /** - * The name of the Shared Access Policy key that grants the Time Series Insights service access - * to the iot hub. This shared access policy key must grant 'service connect' permissions to the - * iot hub. - */ - keyName: string; - /** - * The value of the Shared Access Policy key that grants the Time Series Insights service read - * access to the iot hub. This property is not shown in event source responses. - */ - sharedAccessKey: string; -} + /** An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. */ + localTimestamp?: LocalTimestamp; + /** The type of the ingressStartAt, It can be "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". */ + type?: IngressStartAtType; + /** ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying the date and time that will be the starting point for Events to be consumed. */ + time?: string; +}; -/** - * Parameters supplied to the Update Event Source operation. - */ -export interface EventSourceUpdateParameters { - /** - * Key-value pairs of additional properties for the event source. - */ - tags?: { [propertyName: string]: string }; -} +/** Properties of the Gen1 environment. */ +export type Gen1EnvironmentResourceProperties = Gen1EnvironmentCreationProperties & + EnvironmentResourceProperties & {}; -/** - * Parameters supplied to the Update Event Source operation to update an EventHub event source. - */ -export interface EventHubEventSourceUpdateParameters extends EventSourceUpdateParameters { - /** - * The event property that will be used as the event source's timestamp. If a value isn't - * specified for timestampPropertyName, or if null or empty-string is specified, the event - * creation time will be used. - */ - timestampPropertyName?: string; - /** - * An object that represents the local timestamp property. It contains the format of local - * timestamp that needs to be used and the corresponding timezone offset information. If a value - * isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed - * with the events. - */ - localTimestamp?: LocalTimestamp; - /** - * The value of the shared access key that grants the Time Series Insights service read access to - * the event hub. This property is not shown in event source responses. - */ +/** An object that represents a set of mutable EventHub event source resource properties. */ +export type EventHubEventSourceMutableProperties = EventSourceMutableProperties & { + /** The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses. */ sharedAccessKey?: string; -} +}; -/** - * Parameters supplied to the Update Event Source operation to update an IoTHub event source. - */ -export interface IoTHubEventSourceUpdateParameters extends EventSourceUpdateParameters { - /** - * The event property that will be used as the event source's timestamp. If a value isn't - * specified for timestampPropertyName, or if null or empty-string is specified, the event - * creation time will be used. - */ - timestampPropertyName?: string; - /** - * An object that represents the local timestamp property. It contains the format of local - * timestamp that needs to be used and the corresponding timezone offset information. If a value - * isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed - * with the events. - */ - localTimestamp?: LocalTimestamp; - /** - * The value of the shared access key that grants the Time Series Insights service read access to - * the iot hub. This property is not shown in event source responses. - */ +/** An object that represents a set of mutable IoTHub event source resource properties. */ +export type IoTHubEventSourceMutableProperties = EventSourceMutableProperties & { + /** The value of the shared access key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses. */ sharedAccessKey?: string; -} - -/** - * Contains the possible cases for EventSourceResource. - */ -export type EventSourceResourceUnion = EventSourceResource | EventHubEventSourceResource | IoTHubEventSourceResource; +}; -/** - * An environment receives data from one or more event sources. Each event source has associated - * connection info that allows the Time Series Insights ingress pipeline to connect to and pull - * data from the event source - */ -export interface EventSourceResource { - /** - * Polymorphic Discriminator - */ - kind: "EventSourceResource"; - /** - * Resource Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * Resource location - */ - location: string; - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; -} +/** Parameters supplied to the Create or Update Environment operation for a Gen1 environment. */ +export type Gen1EnvironmentCreateOrUpdateParameters = EnvironmentCreateOrUpdateParameters & { + /** ISO8601 timespan specifying the minimum number of days the environment's events will be available for query. */ + dataRetentionTime: string; + /** The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. */ + storageLimitExceededBehavior?: StorageLimitExceededBehavior; + /** The list of event properties which will be used to partition data in the environment. Currently, only a single partition key property is supported. */ + partitionKeyProperties?: TimeSeriesIdProperty[]; +}; -/** - * The response of the List EventSources operation. - */ -export interface EventSourceListResponse { - /** - * Result of the List EventSources operation. - */ - value?: EventSourceResourceUnion[]; -} +/** Parameters supplied to the Create or Update Environment operation for a Gen2 environment. */ +export type Gen2EnvironmentCreateOrUpdateParameters = EnvironmentCreateOrUpdateParameters & { + /** The list of event properties which will be used to define the environment's time series id. */ + timeSeriesIdProperties: TimeSeriesIdProperty[]; + /** The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. */ + storageConfiguration: Gen2StorageConfigurationInput; + /** The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. */ + warmStoreConfiguration?: WarmStoreConfigurationProperties; +}; -/** - * An event source that receives its data from an Azure EventHub. - */ -export interface EventHubEventSourceResource { - /** - * Polymorphic Discriminator - */ - kind: "Microsoft.EventHub"; - /** - * Resource Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * Resource location - */ - location: string; - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; +/** Parameters supplied to the Create or Update Event Source operation for an EventHub event source. */ +export type EventHubEventSourceCreateOrUpdateParameters = EventSourceCreateOrUpdateParameters & { /** - * Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', - * 'Updating', 'Succeeded', 'Failed', 'Deleting' + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provisioningState?: ProvisioningState; + readonly provisioningState?: ProvisioningState; /** * The time the resource was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly creationTime?: Date; - /** - * The event property that will be used as the event source's timestamp. If a value isn't - * specified for timestampPropertyName, or if null or empty-string is specified, the event - * creation time will be used. - */ + /** The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. */ timestampPropertyName?: string; - /** - * The resource id of the event source in Azure Resource Manager. - */ + /** An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. */ + localTimestampPropertiesLocalTimestamp?: LocalTimestamp; + /** The type of the ingressStartAt, It can be "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". */ + type?: IngressStartAtType; + /** ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying the date and time that will be the starting point for Events to be consumed. */ + time?: string; + /** The resource id of the event source in Azure Resource Manager. */ eventSourceResourceId: string; - /** - * The name of the service bus that contains the event hub. - */ + /** The name of the service bus that contains the event hub. */ serviceBusNamespace: string; - /** - * The name of the event hub. - */ + /** The name of the event hub. */ eventHubName: string; - /** - * The name of the event hub's consumer group that holds the partitions from which events will be - * read. - */ + /** The name of the event hub's consumer group that holds the partitions from which events will be read. */ consumerGroupName: string; - /** - * The name of the SAS key that grants the Time Series Insights service access to the event hub. - * The shared access policies for this key must grant 'Listen' permissions to the event hub. - */ + /** The name of the SAS key that grants the Time Series Insights service access to the event hub. The shared access policies for this key must grant 'Listen' permissions to the event hub. */ keyName: string; -} + /** The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses. */ + sharedAccessKey: string; +}; -/** - * An event source that receives its data from an Azure IoTHub. - */ -export interface IoTHubEventSourceResource { +/** Parameters supplied to the Create or Update Event Source operation for an IoTHub event source. */ +export type IoTHubEventSourceCreateOrUpdateParameters = EventSourceCreateOrUpdateParameters & { /** - * Polymorphic Discriminator + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - kind: "Microsoft.IotHub"; - /** - * Resource Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * Resource location - */ - location: string; - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; - /** - * Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', - * 'Updating', 'Succeeded', 'Failed', 'Deleting' - */ - provisioningState?: ProvisioningState; + readonly provisioningState?: ProvisioningState; /** * The time the resource was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly creationTime?: Date; - /** - * The event property that will be used as the event source's timestamp. If a value isn't - * specified for timestampPropertyName, or if null or empty-string is specified, the event - * creation time will be used. - */ + /** The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. */ timestampPropertyName?: string; - /** - * The resource id of the event source in Azure Resource Manager. - */ + /** An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. */ + localTimestampPropertiesLocalTimestamp?: LocalTimestamp; + /** The type of the ingressStartAt, It can be "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". */ + type?: IngressStartAtType; + /** ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying the date and time that will be the starting point for Events to be consumed. */ + time?: string; + /** The resource id of the event source in Azure Resource Manager. */ eventSourceResourceId: string; - /** - * The name of the iot hub. - */ + /** The name of the iot hub. */ iotHubName: string; - /** - * The name of the iot hub's consumer group that holds the partitions from which events will be - * read. - */ + /** The name of the iot hub's consumer group that holds the partitions from which events will be read. */ consumerGroupName: string; - /** - * The name of the Shared Access Policy key that grants the Time Series Insights service access - * to the iot hub. This shared access policy key must grant 'service connect' permissions to the - * iot hub. - */ + /** The name of the Shared Access Policy key that grants the Time Series Insights service access to the iot hub. This shared access policy key must grant 'service connect' permissions to the iot hub. */ keyName: string; -} - -/** - * Properties of the event source. - */ -export interface EventSourceCommonProperties extends ResourceProperties { - /** - * The event property that will be used as the event source's timestamp. If a value isn't - * specified for timestampPropertyName, or if null or empty-string is specified, the event - * creation time will be used. - */ - timestampPropertyName?: string; -} - -/** - * Properties of an event source that reads events from an event broker in Azure. - */ -export interface AzureEventSourceProperties extends EventSourceCommonProperties { - /** - * The resource id of the event source in Azure Resource Manager. - */ - eventSourceResourceId: string; -} - -/** - * Properties of the EventHub event source. - */ -export interface EventHubEventSourceCommonProperties extends AzureEventSourceProperties { - /** - * The name of the service bus that contains the event hub. - */ - serviceBusNamespace: string; - /** - * The name of the event hub. - */ - eventHubName: string; - /** - * The name of the event hub's consumer group that holds the partitions from which events will be - * read. - */ - consumerGroupName: string; - /** - * The name of the SAS key that grants the Time Series Insights service access to the event hub. - * The shared access policies for this key must grant 'Listen' permissions to the event hub. - */ - keyName: string; -} + /** The value of the Shared Access Policy key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses. */ + sharedAccessKey: string; +}; -/** - * Properties of the IoTHub event source. - */ -export interface IoTHubEventSourceCommonProperties extends AzureEventSourceProperties { - /** - * The name of the iot hub. - */ - iotHubName: string; - /** - * The name of the iot hub's consumer group that holds the partitions from which events will be - * read. - */ - consumerGroupName: string; - /** - * The name of the Shared Access Policy key that grants the Time Series Insights service access - * to the iot hub. This shared access policy key must grant 'service connect' permissions to the - * iot hub. - */ - keyName: string; -} +/** An environment is a set of time-series data available for query, and is the top level Azure Time Series Insights resource. */ +export type EnvironmentResource = TrackedResource & { + /** The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress rate, and the billing rate. */ + sku: Sku; + /** The kind of the environment. */ + kind: EnvironmentResourceKind; +}; -/** - * An object that represents the offset information for the local timestamp format specified. - * Should not be specified for LocalTimestampFormat - Embedded. - */ -export interface LocalTimestampTimeZoneOffset { - /** - * The event property that will be contain the offset information to calculate the local - * timestamp. When the LocalTimestampFormat is Iana, the property name will contain the name of - * the column which contains IANA Timezone Name (eg: Americas/Los Angeles). When - * LocalTimestampFormat is Timespan, it contains the name of property which contains values - * representing the offset (eg: P1D or 1.00:00:00) - */ - propertyName?: string; -} +/** An environment receives data from one or more event sources. Each event source has associated connection info that allows the Time Series Insights ingress pipeline to connect to and pull data from the event source */ +export type EventSourceResource = TrackedResource & { + /** The kind of the event source. */ + kind: EventSourceResourceKind; +}; -/** - * An object that represents the local timestamp property. It contains the format of local - * timestamp that needs to be used and the corresponding timezone offset information. If a value - * isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed - * with the events. - */ -export interface LocalTimestamp { +/** A reference data set provides metadata about the events in an environment. Metadata in the reference data set will be joined with events as they are read from event sources. The metadata that makes up the reference data set is uploaded or modified through the Time Series Insights data plane APIs. */ +export type ReferenceDataSetResource = TrackedResource & { + /** The list of key properties for the reference data set. */ + keyProperties?: ReferenceDataSetKeyProperty[]; + /** The reference data set key comparison behavior can be set using this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used. */ + dataStringComparisonBehavior?: DataStringComparisonBehavior; /** - * An enum that represents the format of the local timestamp property that needs to be set. - * Possible values include: 'Embedded', 'Iana', 'TimeSpan' + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - format?: LocalTimestampFormat; + readonly provisioningState?: ProvisioningState; /** - * An object that represents the offset information for the local timestamp format specified. - * Should not be specified for LocalTimestampFormat - Embedded. + * The time the resource was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - timeZoneOffset?: LocalTimestampTimeZoneOffset; -} + readonly creationTime?: Date; +}; -/** - * An object that represents a set of mutable event source resource properties. - */ -export interface EventSourceMutableProperties { - /** - * The event property that will be used as the event source's timestamp. If a value isn't - * specified for timestampPropertyName, or if null or empty-string is specified, the event - * creation time will be used. - */ - timestampPropertyName?: string; - /** - * An object that represents the local timestamp property. It contains the format of local - * timestamp that needs to be used and the corresponding timezone offset information. If a value - * isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed - * with the events. - */ - localTimestamp?: LocalTimestamp; -} +/** Properties of the Gen2 environment. */ +export type Gen2EnvironmentResourceProperties = EnvironmentResourceProperties & { + /** The list of event properties which will be used to define the environment's time series id. */ + timeSeriesIdProperties: TimeSeriesIdProperty[]; + /** The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. */ + storageConfiguration: Gen2StorageConfigurationOutput; + /** The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. */ + warmStoreConfiguration?: WarmStoreConfigurationProperties; +}; -/** - * A key property for the reference data set. A reference data set can have multiple key - * properties. - */ -export interface ReferenceDataSetKeyProperty { - /** - * The name of the key property. - */ - name?: string; - /** - * The type of the key property. Possible values include: 'String', 'Double', 'Bool', 'DateTime' - */ - type?: ReferenceDataKeyPropertyType; -} +/** Properties of an event source that reads events from an event broker in Azure. */ +export type AzureEventSourceProperties = EventSourceCommonProperties & { + /** The resource id of the event source in Azure Resource Manager. */ + eventSourceResourceId: string; +}; -/** - * An interface representing ReferenceDataSetCreateOrUpdateParameters. - */ -export interface ReferenceDataSetCreateOrUpdateParameters extends CreateOrUpdateTrackedResourceProperties { +/** An environment is a set of time-series data available for query, and is the top level Azure Time Series Insights resource. Gen1 environments have data retention limits. */ +export type Gen1EnvironmentResource = EnvironmentResource & { + /** ISO8601 timespan specifying the minimum number of days the environment's events will be available for query. */ + dataRetentionTime: string; + /** The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. */ + storageLimitExceededBehavior?: StorageLimitExceededBehavior; + /** The list of event properties which will be used to partition data in the environment. Currently, only a single partition key property is supported. */ + partitionKeyProperties?: TimeSeriesIdProperty[]; /** - * The list of key properties for the reference data set. + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - keyProperties: ReferenceDataSetKeyProperty[]; + readonly provisioningState?: ProvisioningState; /** - * The reference data set key comparison behavior can be set using this property. By default, the - * value is 'Ordinal' - which means case sensitive key comparison will be performed while joining - * reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is - * set, case insensitive comparison will be used. Possible values include: 'Ordinal', - * 'OrdinalIgnoreCase' + * The time the resource was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dataStringComparisonBehavior?: DataStringComparisonBehavior; -} - -/** - * Parameters supplied to the Update Reference Data Set operation. - */ -export interface ReferenceDataSetUpdateParameters { + readonly creationTime?: Date; /** - * Key-value pairs of additional properties for the reference data set. + * An id used to access the environment data, e.g. to query the environment's events or upload reference data for the environment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; -} - -/** - * A reference data set provides metadata about the events in an environment. Metadata in the - * reference data set will be joined with events as they are read from event sources. The metadata - * that makes up the reference data set is uploaded or modified through the Time Series Insights - * data plane APIs. - */ -export interface ReferenceDataSetResource extends TrackedResource { + readonly dataAccessId?: string; /** - * The list of key properties for the reference data set. + * The fully qualified domain name used to access the environment data, e.g. to query the environment's events or upload reference data for the environment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - keyProperties: ReferenceDataSetKeyProperty[]; + readonly dataAccessFqdn?: string; /** - * The reference data set key comparison behavior can be set using this property. By default, the - * value is 'Ordinal' - which means case sensitive key comparison will be performed while joining - * reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is - * set, case insensitive comparison will be used. Possible values include: 'Ordinal', - * 'OrdinalIgnoreCase' + * An object that represents the status of the environment, and its internal state in the Time Series Insights service. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dataStringComparisonBehavior?: DataStringComparisonBehavior; + readonly status?: EnvironmentStatus; +}; + +/** An environment is a set of time-series data available for query, and is the top level Azure Time Series Insights resource. Gen2 environments do not have set data retention limits. */ +export type Gen2EnvironmentResource = EnvironmentResource & { /** - * Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', - * 'Updating', 'Succeeded', 'Failed', 'Deleting' + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provisioningState?: ProvisioningState; + readonly provisioningState?: ProvisioningState; /** * The time the resource was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly creationTime?: Date; -} - -/** - * The response of the List Reference Data Sets operation. - */ -export interface ReferenceDataSetListResponse { - /** - * Result of the List Reference Data Sets operation. - */ - value?: ReferenceDataSetResource[]; -} - -/** - * An interface representing AccessPolicyCreateOrUpdateParameters. - */ -export interface AccessPolicyCreateOrUpdateParameters { /** - * The objectId of the principal in Azure Active Directory. + * An id used to access the environment data, e.g. to query the environment's events or upload reference data for the environment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - principalObjectId?: string; + readonly dataAccessId?: string; /** - * An description of the access policy. + * The fully qualified domain name used to access the environment data, e.g. to query the environment's events or upload reference data for the environment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; + readonly dataAccessFqdn?: string; /** - * The list of roles the principal is assigned on the environment. + * An object that represents the status of the environment, and its internal state in the Time Series Insights service. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - roles?: AccessPolicyRole[]; -} + readonly status?: EnvironmentStatus; + /** The list of event properties which will be used to define the environment's time series id. */ + timeSeriesIdProperties: TimeSeriesIdProperty[]; + /** The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. */ + storageConfiguration: Gen2StorageConfigurationOutput; + /** The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. */ + warmStoreConfiguration?: WarmStoreConfigurationProperties; +}; -/** - * An interface representing AccessPolicyUpdateParameters. - */ -export interface AccessPolicyUpdateParameters { +/** An event source that receives its data from an Azure EventHub. */ +export type EventHubEventSourceResource = EventSourceResource & { /** - * An description of the access policy. + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; + readonly provisioningState?: ProvisioningState; /** - * The list of roles the principal is assigned on the environment. + * The time the resource was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - roles?: AccessPolicyRole[]; -} + readonly creationTime?: Date; + /** The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. */ + timestampPropertyName?: string; + /** An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. */ + localTimestamp?: LocalTimestamp; + /** The type of the ingressStartAt, It can be "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". */ + typePropertiesIngressStartAtType?: IngressStartAtType; + /** ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying the date and time that will be the starting point for Events to be consumed. */ + time?: string; + /** The resource id of the event source in Azure Resource Manager. */ + eventSourceResourceId: string; + /** The name of the service bus that contains the event hub. */ + serviceBusNamespace: string; + /** The name of the event hub. */ + eventHubName: string; + /** The name of the event hub's consumer group that holds the partitions from which events will be read. */ + consumerGroupName: string; + /** The name of the SAS key that grants the Time Series Insights service access to the event hub. The shared access policies for this key must grant 'Listen' permissions to the event hub. */ + keyName: string; +}; -/** - * An access policy is used to grant users and applications access to the environment. Roles are - * assigned to service principals in Azure Active Directory. These roles define the actions the - * principal can perform through the Time Series Insights data plane APIs. - */ -export interface AccessPolicyResource extends Resource { - /** - * The objectId of the principal in Azure Active Directory. - */ - principalObjectId?: string; +/** An event source that receives its data from an Azure IoTHub. */ +export type IoTHubEventSourceResource = EventSourceResource & { /** - * An description of the access policy. + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; + readonly provisioningState?: ProvisioningState; /** - * The list of roles the principal is assigned on the environment. + * The time the resource was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - roles?: AccessPolicyRole[]; + readonly creationTime?: Date; + /** The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. */ + timestampPropertyName?: string; + /** An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. */ + localTimestamp?: LocalTimestamp; + /** The type of the ingressStartAt, It can be "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". */ + typePropertiesIngressStartAtType?: IngressStartAtType; + /** ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying the date and time that will be the starting point for Events to be consumed. */ + time?: string; + /** The resource id of the event source in Azure Resource Manager. */ + eventSourceResourceId: string; + /** The name of the iot hub. */ + iotHubName: string; + /** The name of the iot hub's consumer group that holds the partitions from which events will be read. */ + consumerGroupName: string; + /** The name of the Shared Access Policy key that grants the Time Series Insights service access to the iot hub. This shared access policy key must grant 'service connect' permissions to the iot hub. */ + keyName: string; +}; + +/** Properties of the EventHub event source. */ +export type EventHubEventSourceCommonProperties = AzureEventSourceProperties & { + /** The name of the service bus that contains the event hub. */ + serviceBusNamespace: string; + /** The name of the event hub. */ + eventHubName: string; + /** The name of the event hub's consumer group that holds the partitions from which events will be read. */ + consumerGroupName: string; + /** The name of the SAS key that grants the Time Series Insights service access to the event hub. The shared access policies for this key must grant 'Listen' permissions to the event hub. */ + keyName: string; +}; + +/** Properties of the IoTHub event source. */ +export type IoTHubEventSourceCommonProperties = AzureEventSourceProperties & { + /** The name of the iot hub. */ + iotHubName: string; + /** The name of the iot hub's consumer group that holds the partitions from which events will be read. */ + consumerGroupName: string; + /** The name of the Shared Access Policy key that grants the Time Series Insights service access to the iot hub. This shared access policy key must grant 'service connect' permissions to the iot hub. */ + keyName: string; +}; + +/** Properties of the EventHub event source that are required on create or update requests. */ +export type EventHubEventSourceCreationProperties = EventHubEventSourceCommonProperties & { + /** The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses. */ + sharedAccessKey: string; +}; + +/** Properties of the EventHub event source resource. */ +export type EventHubEventSourceResourceProperties = EventHubEventSourceCommonProperties & {}; + +/** Properties of the IoTHub event source that are required on create or update requests. */ +export type IoTHubEventSourceCreationProperties = IoTHubEventSourceCommonProperties & { + /** The value of the Shared Access Policy key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses. */ + sharedAccessKey: string; +}; + +/** Properties of the IoTHub event source resource. */ +export type IoTHubEventSourceResourceProperties = IoTHubEventSourceCommonProperties & {}; + +/** Known values of {@link EnvironmentKind} that the service accepts. */ +export enum KnownEnvironmentKind { + Gen1 = "Gen1", + Gen2 = "Gen2" } /** - * The response of the List access policies operation. + * Defines values for EnvironmentKind. \ + * {@link KnownEnvironmentKind} can be used interchangeably with EnvironmentKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Gen1** \ + * **Gen2** */ -export interface AccessPolicyListResponse { - /** - * Result of the List access policies operation. - */ - value?: AccessPolicyResource[]; +export type EnvironmentKind = string; + +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + S1 = "S1", + S2 = "S2", + P1 = "P1", + L1 = "L1" } /** - * Optional Parameters. + * Defines values for SkuName. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **S1** \ + * **S2** \ + * **P1** \ + * **L1** */ -export interface EnvironmentsGetOptionalParams extends msRest.RequestOptionsBase { - /** - * Setting $expand=status will include the status of the internal services of the environment in - * the Time Series Insights service. - */ - expand?: string; +export type SkuName = string; + +/** Known values of {@link EnvironmentResourceKind} that the service accepts. */ +export enum KnownEnvironmentResourceKind { + Gen1 = "Gen1", + Gen2 = "Gen2" } /** - * An interface representing TimeSeriesInsightsClientOptions. + * Defines values for EnvironmentResourceKind. \ + * {@link KnownEnvironmentResourceKind} can be used interchangeably with EnvironmentResourceKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Gen1** \ + * **Gen2** */ -export interface TimeSeriesInsightsClientOptions extends AzureServiceClientOptions { - baseUri?: string; +export type EnvironmentResourceKind = string; + +/** Known values of {@link EventSourceKind} that the service accepts. */ +export enum KnownEventSourceKind { + MicrosoftEventHub = "Microsoft.EventHub", + MicrosoftIoTHub = "Microsoft.IoTHub" } /** - * @interface - * Result of the request to list Time Series Insights operations. It contains a list of operations - * and a URL link to get the next set of results. - * @extends Array + * Defines values for EventSourceKind. \ + * {@link KnownEventSourceKind} can be used interchangeably with EventSourceKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft.EventHub** \ + * **Microsoft.IoTHub** */ -export interface OperationListResult extends Array { - /** - * URL to get the next set of operation list results if there are any. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +export type EventSourceKind = string; + +/** Known values of {@link LocalTimestampFormat} that the service accepts. */ +export enum KnownLocalTimestampFormat { + Embedded = "Embedded" } /** - * Defines values for ProvisioningState. - * Possible values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' - * @readonly - * @enum {string} + * Defines values for LocalTimestampFormat. \ + * {@link KnownLocalTimestampFormat} can be used interchangeably with LocalTimestampFormat, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Embedded** */ -export type ProvisioningState = 'Accepted' | 'Creating' | 'Updating' | 'Succeeded' | 'Failed' | 'Deleting'; +export type LocalTimestampFormat = string; -/** - * Defines values for SkuName. - * Possible values include: 'S1', 'S2' - * @readonly - * @enum {string} - */ -export type SkuName = 'S1' | 'S2'; +/** Known values of {@link EventSourceResourceKind} that the service accepts. */ +export enum KnownEventSourceResourceKind { + MicrosoftEventHub = "Microsoft.EventHub", + MicrosoftIoTHub = "Microsoft.IoTHub" +} /** - * Defines values for StorageLimitExceededBehavior. - * Possible values include: 'PurgeOldData', 'PauseIngress' - * @readonly - * @enum {string} + * Defines values for EventSourceResourceKind. \ + * {@link KnownEventSourceResourceKind} can be used interchangeably with EventSourceResourceKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft.EventHub** \ + * **Microsoft.IoTHub** */ -export type StorageLimitExceededBehavior = 'PurgeOldData' | 'PauseIngress'; +export type EventSourceResourceKind = string; -/** - * Defines values for PropertyType. - * Possible values include: 'String' - * @readonly - * @enum {string} - */ -export type PropertyType = 'String'; +/** Known values of {@link ReferenceDataKeyPropertyType} that the service accepts. */ +export enum KnownReferenceDataKeyPropertyType { + String = "String", + Double = "Double", + Bool = "Bool", + DateTime = "DateTime" +} /** - * Defines values for IngressState. - * Possible values include: 'Disabled', 'Ready', 'Running', 'Paused', 'Unknown' - * @readonly - * @enum {string} + * Defines values for ReferenceDataKeyPropertyType. \ + * {@link KnownReferenceDataKeyPropertyType} can be used interchangeably with ReferenceDataKeyPropertyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **String** \ + * **Double** \ + * **Bool** \ + * **DateTime** */ -export type IngressState = 'Disabled' | 'Ready' | 'Running' | 'Paused' | 'Unknown'; +export type ReferenceDataKeyPropertyType = string; -/** - * Defines values for LocalTimestampFormat. - * Possible values include: 'Embedded', 'Iana', 'TimeSpan' - * @readonly - * @enum {string} - */ -export type LocalTimestampFormat = 'Embedded' | 'Iana' | 'TimeSpan'; +/** Known values of {@link DataStringComparisonBehavior} that the service accepts. */ +export enum KnownDataStringComparisonBehavior { + Ordinal = "Ordinal", + OrdinalIgnoreCase = "OrdinalIgnoreCase" +} /** - * Defines values for ReferenceDataKeyPropertyType. - * Possible values include: 'String', 'Double', 'Bool', 'DateTime' - * @readonly - * @enum {string} + * Defines values for DataStringComparisonBehavior. \ + * {@link KnownDataStringComparisonBehavior} can be used interchangeably with DataStringComparisonBehavior, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Ordinal** \ + * **OrdinalIgnoreCase** */ -export type ReferenceDataKeyPropertyType = 'String' | 'Double' | 'Bool' | 'DateTime'; +export type DataStringComparisonBehavior = string; -/** - * Defines values for DataStringComparisonBehavior. - * Possible values include: 'Ordinal', 'OrdinalIgnoreCase' - * @readonly - * @enum {string} - */ -export type DataStringComparisonBehavior = 'Ordinal' | 'OrdinalIgnoreCase'; +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Accepted = "Accepted", + Creating = "Creating", + Updating = "Updating", + Succeeded = "Succeeded", + Failed = "Failed", + Deleting = "Deleting" +} /** - * Defines values for AccessPolicyRole. - * Possible values include: 'Reader', 'Contributor' - * @readonly - * @enum {string} + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Accepted** \ + * **Creating** \ + * **Updating** \ + * **Succeeded** \ + * **Failed** \ + * **Deleting** */ -export type AccessPolicyRole = 'Reader' | 'Contributor'; +export type ProvisioningState = string; -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Known values of {@link AccessPolicyRole} that the service accepts. */ +export enum KnownAccessPolicyRole { + Reader = "Reader", + Contributor = "Contributor" +} /** - * Contains response data for the listNext operation. + * Defines values for AccessPolicyRole. \ + * {@link KnownAccessPolicyRole} can be used interchangeably with AccessPolicyRole, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Reader** \ + * **Contributor** */ -export type OperationsListNextResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +export type AccessPolicyRole = string; -/** - * Contains response data for the createOrUpdate operation. - */ -export type EnvironmentsCreateOrUpdateResponse = EnvironmentResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EnvironmentResource; - }; -}; +/** Known values of {@link StorageLimitExceededBehavior} that the service accepts. */ +export enum KnownStorageLimitExceededBehavior { + PurgeOldData = "PurgeOldData", + PauseIngress = "PauseIngress" +} /** - * Contains response data for the get operation. + * Defines values for StorageLimitExceededBehavior. \ + * {@link KnownStorageLimitExceededBehavior} can be used interchangeably with StorageLimitExceededBehavior, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PurgeOldData** \ + * **PauseIngress** */ -export type EnvironmentsGetResponse = EnvironmentResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EnvironmentResource; - }; -}; +export type StorageLimitExceededBehavior = string; -/** - * Contains response data for the update operation. - */ -export type EnvironmentsUpdateResponse = EnvironmentResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EnvironmentResource; - }; -}; +/** Known values of {@link PropertyType} that the service accepts. */ +export enum KnownPropertyType { + String = "String" +} /** - * Contains response data for the listByResourceGroup operation. + * Defines values for PropertyType. \ + * {@link KnownPropertyType} can be used interchangeably with PropertyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **String** */ -export type EnvironmentsListByResourceGroupResponse = EnvironmentListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EnvironmentListResponse; - }; -}; +export type PropertyType = string; -/** - * Contains response data for the listBySubscription operation. - */ -export type EnvironmentsListBySubscriptionResponse = EnvironmentListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EnvironmentListResponse; - }; -}; +/** Known values of {@link IngressState} that the service accepts. */ +export enum KnownIngressState { + Disabled = "Disabled", + Ready = "Ready", + Running = "Running", + Paused = "Paused", + Unknown = "Unknown" +} /** - * Contains response data for the beginCreateOrUpdate operation. + * Defines values for IngressState. \ + * {@link KnownIngressState} can be used interchangeably with IngressState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disabled** \ + * **Ready** \ + * **Running** \ + * **Paused** \ + * **Unknown** */ -export type EnvironmentsBeginCreateOrUpdateResponse = EnvironmentResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EnvironmentResource; - }; -}; +export type IngressState = string; -/** - * Contains response data for the beginUpdate operation. - */ -export type EnvironmentsBeginUpdateResponse = EnvironmentResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EnvironmentResource; - }; -}; +/** Known values of {@link WarmStoragePropertiesState} that the service accepts. */ +export enum KnownWarmStoragePropertiesState { + Ok = "Ok", + Error = "Error", + Unknown = "Unknown" +} /** - * Contains response data for the createOrUpdate operation. + * Defines values for WarmStoragePropertiesState. \ + * {@link KnownWarmStoragePropertiesState} can be used interchangeably with WarmStoragePropertiesState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Ok** \ + * **Error** \ + * **Unknown** */ -export type EventSourcesCreateOrUpdateResponse = EventSourceResourceUnion & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventSourceResourceUnion; - }; -}; +export type WarmStoragePropertiesState = string; -/** - * Contains response data for the get operation. - */ -export type EventSourcesGetResponse = EventSourceResourceUnion & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventSourceResourceUnion; - }; -}; +/** Known values of {@link IngressStartAtType} that the service accepts. */ +export enum KnownIngressStartAtType { + EarliestAvailable = "EarliestAvailable", + EventSourceCreationTime = "EventSourceCreationTime", + CustomEnqueuedTime = "CustomEnqueuedTime" +} /** - * Contains response data for the update operation. + * Defines values for IngressStartAtType. \ + * {@link KnownIngressStartAtType} can be used interchangeably with IngressStartAtType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EarliestAvailable** \ + * **EventSourceCreationTime** \ + * **CustomEnqueuedTime** */ -export type EventSourcesUpdateResponse = EventSourceResourceUnion & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventSourceResourceUnion; - }; -}; +export type IngressStartAtType = string; -/** - * Contains response data for the listByEnvironment operation. - */ -export type EventSourcesListByEnvironmentResponse = EventSourceListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventSourceListResponse; - }; -}; +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ReferenceDataSetsCreateOrUpdateResponse = ReferenceDataSetResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReferenceDataSetResource; - }; -}; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; -/** - * Contains response data for the get operation. - */ -export type ReferenceDataSetsGetResponse = ReferenceDataSetResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReferenceDataSetResource; - }; -}; +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type ReferenceDataSetsUpdateResponse = ReferenceDataSetResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReferenceDataSetResource; - }; -}; +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; -/** - * Contains response data for the listByEnvironment operation. - */ -export type ReferenceDataSetsListByEnvironmentResponse = ReferenceDataSetListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ReferenceDataSetListResponse; - }; -}; +/** Optional parameters. */ +export interface EnvironmentsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type AccessPoliciesCreateOrUpdateResponse = AccessPolicyResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessPolicyResource; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type EnvironmentsCreateOrUpdateResponse = EnvironmentResourceUnion; -/** - * Contains response data for the get operation. - */ -export type AccessPoliciesGetResponse = AccessPolicyResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessPolicyResource; - }; -}; +/** Optional parameters. */ +export interface EnvironmentsGetOptionalParams + extends coreClient.OperationOptions { + /** Setting $expand=status will include the status of the internal services of the environment in the Time Series Insights service. */ + expand?: string; +} -/** - * Contains response data for the update operation. - */ -export type AccessPoliciesUpdateResponse = AccessPolicyResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessPolicyResource; - }; -}; +/** Contains response data for the get operation. */ +export type EnvironmentsGetResponse = EnvironmentResourceUnion; -/** - * Contains response data for the listByEnvironment operation. - */ -export type AccessPoliciesListByEnvironmentResponse = AccessPolicyListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessPolicyListResponse; - }; -}; +/** Optional parameters. */ +export interface EnvironmentsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type EnvironmentsUpdateResponse = EnvironmentResourceUnion; + +/** Optional parameters. */ +export interface EnvironmentsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface EnvironmentsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type EnvironmentsListByResourceGroupResponse = EnvironmentListResponse; + +/** Optional parameters. */ +export interface EnvironmentsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type EnvironmentsListBySubscriptionResponse = EnvironmentListResponse; + +/** Optional parameters. */ +export interface EventSourcesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type EventSourcesCreateOrUpdateResponse = EventSourceResourceUnion; + +/** Optional parameters. */ +export interface EventSourcesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type EventSourcesGetResponse = EventSourceResourceUnion; + +/** Optional parameters. */ +export interface EventSourcesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type EventSourcesUpdateResponse = EventSourceResourceUnion; + +/** Optional parameters. */ +export interface EventSourcesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface EventSourcesListByEnvironmentOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByEnvironment operation. */ +export type EventSourcesListByEnvironmentResponse = EventSourceListResponse; + +/** Optional parameters. */ +export interface ReferenceDataSetsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ReferenceDataSetsCreateOrUpdateResponse = ReferenceDataSetResource; + +/** Optional parameters. */ +export interface ReferenceDataSetsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ReferenceDataSetsGetResponse = ReferenceDataSetResource; + +/** Optional parameters. */ +export interface ReferenceDataSetsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ReferenceDataSetsUpdateResponse = ReferenceDataSetResource; + +/** Optional parameters. */ +export interface ReferenceDataSetsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ReferenceDataSetsListByEnvironmentOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByEnvironment operation. */ +export type ReferenceDataSetsListByEnvironmentResponse = ReferenceDataSetListResponse; + +/** Optional parameters. */ +export interface AccessPoliciesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type AccessPoliciesCreateOrUpdateResponse = AccessPolicyResource; + +/** Optional parameters. */ +export interface AccessPoliciesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AccessPoliciesGetResponse = AccessPolicyResource; + +/** Optional parameters. */ +export interface AccessPoliciesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type AccessPoliciesUpdateResponse = AccessPolicyResource; + +/** Optional parameters. */ +export interface AccessPoliciesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface AccessPoliciesListByEnvironmentOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByEnvironment operation. */ +export type AccessPoliciesListByEnvironmentResponse = AccessPolicyListResponse; + +/** Optional parameters. */ +export interface TimeSeriesInsightsClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/mappers.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/mappers.ts index d3731702df83..7a27f0511568 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/mappers.ts +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/mappers.ts @@ -1,47 +1,34 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "OperationListResult", modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - readOnly: true, - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { + value: { + serializedName: "value", readOnly: true, - serializedName: "operation", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } } }, - description: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "description", type: { name: "String" } @@ -50,54 +37,71 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", className: "Operation", modelProperties: { name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, display: { - readOnly: true, serializedName: "display", type: { name: "Composite", className: "OperationDisplay" } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + serviceSpecification: { + serializedName: "properties.serviceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification" + } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "OperationDisplay", modelProperties: { - id: { + provider: { + serializedName: "provider", readOnly: true, - serializedName: "id", type: { name: "String" } }, - name: { + resource: { + serializedName: "resource", readOnly: true, - serializedName: "name", type: { name: "String" } }, - type: { + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", readOnly: true, - serializedName: "type", type: { name: "String" } @@ -106,27 +110,31 @@ export const Resource: msRest.CompositeMapper = { } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const ServiceSpecification: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "ServiceSpecification", modelProperties: { - ...Resource.type.modelProperties, - location: { - required: true, - serializedName: "location", + metricSpecifications: { + serializedName: "metricSpecifications", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSpecification" + } + } } }, - tags: { - serializedName: "tags", + logSpecifications: { + serializedName: "logSpecifications", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "LogSpecification" } } } @@ -135,102 +143,127 @@ export const TrackedResource: msRest.CompositeMapper = { } }; -export const ResourceProperties: msRest.CompositeMapper = { - serializedName: "ResourceProperties", +export const MetricSpecification: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceProperties", + className: "MetricSpecification", modelProperties: { - provisioningState: { - serializedName: "provisioningState", + name: { + serializedName: "name", type: { - name: "Enum", - allowedValues: [ - "Accepted", - "Creating", - "Updating", - "Succeeded", - "Failed", - "Deleting" - ] + name: "String" } }, - creationTime: { - readOnly: true, - serializedName: "creationTime", + displayName: { + serializedName: "displayName", type: { - name: "DateTime" + name: "String" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Dimension" + } + } + } + }, + aggregationType: { + serializedName: "aggregationType", + type: { + name: "String" + } + }, + availabilities: { + serializedName: "availabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricAvailability" + } + } + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, + resourceIdDimensionNameOverride: { + serializedName: "resourceIdDimensionNameOverride", + type: { + name: "String" } } } } }; -export const Sku: msRest.CompositeMapper = { - serializedName: "Sku", +export const Dimension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Sku", + className: "Dimension", modelProperties: { name: { - required: true, serializedName: "name", type: { - name: "Enum", - allowedValues: [ - "S1", - "S2" - ] + name: "String" } }, - capacity: { - required: true, - serializedName: "capacity", - constraints: { - InclusiveMaximum: 10, - InclusiveMinimum: 1 - }, + displayName: { + serializedName: "displayName", type: { - name: "Number" + name: "String" } } } } }; -export const CreateOrUpdateTrackedResourceProperties: msRest.CompositeMapper = { - serializedName: "CreateOrUpdateTrackedResourceProperties", +export const MetricAvailability: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CreateOrUpdateTrackedResourceProperties", + className: "MetricAvailability", modelProperties: { - location: { - required: true, - serializedName: "location", + timeGrain: { + serializedName: "timeGrain", type: { name: "String" } }, - tags: { - serializedName: "tags", + blobDuration: { + serializedName: "blobDuration", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } } } } }; -export const PartitionKeyProperty: msRest.CompositeMapper = { - serializedName: "PartitionKeyProperty", +export const LogSpecification: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PartitionKeyProperty", + className: "LogSpecification", modelProperties: { name: { serializedName: "name", @@ -238,8 +271,8 @@ export const PartitionKeyProperty: msRest.CompositeMapper = { name: "String" } }, - type: { - serializedName: "type", + displayName: { + serializedName: "displayName", type: { name: "String" } @@ -248,102 +281,53 @@ export const PartitionKeyProperty: msRest.CompositeMapper = { } }; -export const EnvironmentCreateOrUpdateParameters: msRest.CompositeMapper = { - serializedName: "EnvironmentCreateOrUpdateParameters", +export const CloudError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentCreateOrUpdateParameters", + className: "CloudError", modelProperties: { - ...CreateOrUpdateTrackedResourceProperties.type.modelProperties, - sku: { - required: true, - serializedName: "sku", + error: { + serializedName: "error", type: { name: "Composite", - className: "Sku" - } - }, - dataRetentionTime: { - required: true, - serializedName: "properties.dataRetentionTime", - type: { - name: "TimeSpan" - } - }, - storageLimitExceededBehavior: { - serializedName: "properties.storageLimitExceededBehavior", - type: { - name: "Enum", - allowedValues: [ - "PurgeOldData", - "PauseIngress" - ] - } - }, - partitionKeyProperties: { - serializedName: "properties.partitionKeyProperties", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PartitionKeyProperty" - } - } + className: "CloudErrorBody" } } } } }; -export const EnvironmentUpdateParameters: msRest.CompositeMapper = { - serializedName: "EnvironmentUpdateParameters", +export const CloudErrorBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentUpdateParameters", + className: "CloudErrorBody", modelProperties: { - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku" - } - }, - tags: { - serializedName: "tags", + code: { + serializedName: "code", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } }, - dataRetentionTime: { - serializedName: "properties.dataRetentionTime", + message: { + serializedName: "message", type: { - name: "TimeSpan" + name: "String" } }, - storageLimitExceededBehavior: { - serializedName: "properties.storageLimitExceededBehavior", + target: { + serializedName: "target", type: { - name: "Enum", - allowedValues: [ - "PurgeOldData", - "PauseIngress" - ] + name: "String" } }, - partitionKeyProperties: { - serializedName: "properties.partitionKeyProperties", + details: { + serializedName: "details", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PartitionKeyProperty" + className: "CloudErrorBody" } } } @@ -352,92 +336,1043 @@ export const EnvironmentUpdateParameters: msRest.CompositeMapper = { } }; -export const EnvironmentStateDetails: msRest.CompositeMapper = { - serializedName: "EnvironmentStateDetails", +export const Sku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentStateDetails", + className: "Sku", modelProperties: { - code: { - serializedName: "code", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - message: { - serializedName: "message", + capacity: { + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 1 + }, + serializedName: "capacity", + required: true, type: { - name: "String" + name: "Number" } } } } }; -export const IngressEnvironmentStatus: msRest.CompositeMapper = { - serializedName: "IngressEnvironmentStatus", +export const CreateOrUpdateTrackedResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IngressEnvironmentStatus", + className: "CreateOrUpdateTrackedResourceProperties", modelProperties: { - state: { - serializedName: "state", + location: { + serializedName: "location", + required: true, type: { - name: "Enum", - allowedValues: [ - "Disabled", - "Ready", - "Running", - "Paused", - "Unknown" - ] + name: "String" } }, - stateDetails: { - serializedName: "stateDetails", + tags: { + serializedName: "tags", type: { - name: "Composite", - className: "EnvironmentStateDetails" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const EnvironmentStatus: msRest.CompositeMapper = { - serializedName: "EnvironmentStatus", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentStatus", + className: "Resource", modelProperties: { - ingress: { - serializedName: "ingress", - type: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const EnvironmentUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentUpdateParameters", + uberParent: "EnvironmentUpdateParameters", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + modelProperties: { + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const EnvironmentListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnvironmentResource" + } + } + } + } + } + } +}; + +export const LocalTimestamp: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocalTimestamp", + modelProperties: { + format: { + serializedName: "format", + type: { + name: "String" + } + }, + timeZoneOffset: { + serializedName: "timeZoneOffset", + type: { + name: "Composite", + className: "LocalTimestampTimeZoneOffset" + } + } + } + } +}; + +export const LocalTimestampTimeZoneOffset: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocalTimestampTimeZoneOffset", + modelProperties: { + propertyName: { + serializedName: "propertyName", + type: { + name: "String" + } + } + } + } +}; + +export const EventSourceUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventSourceUpdateParameters", + uberParent: "EventSourceUpdateParameters", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + modelProperties: { + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const EventSourceListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventSourceListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventSourceResource" + } + } + } + } + } + } +}; + +export const ReferenceDataSetCreationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReferenceDataSetCreationProperties", + modelProperties: { + keyProperties: { + serializedName: "keyProperties", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReferenceDataSetKeyProperty" + } + } + } + }, + dataStringComparisonBehavior: { + serializedName: "dataStringComparisonBehavior", + type: { + name: "String" + } + } + } + } +}; + +export const ReferenceDataSetKeyProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReferenceDataSetKeyProperty", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + creationTime: { + serializedName: "creationTime", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const ReferenceDataSetUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReferenceDataSetUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ReferenceDataSetListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReferenceDataSetListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReferenceDataSetResource" + } + } + } + } + } + } +}; + +export const AccessPolicyCreateOrUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessPolicyCreateOrUpdateParameters", + modelProperties: { + principalObjectId: { + serializedName: "properties.principalObjectId", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + roles: { + serializedName: "properties.roles", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const AccessPolicyUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessPolicyUpdateParameters", + modelProperties: { + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + roles: { + serializedName: "properties.roles", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const AccessPolicyListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessPolicyListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessPolicyResource" + } + } + } + } + } + } +}; + +export const WarmStoreConfigurationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WarmStoreConfigurationProperties", + modelProperties: { + dataRetention: { + serializedName: "dataRetention", + required: true, + type: { + name: "TimeSpan" + } + } + } + } +}; + +export const Gen2StorageConfigurationInput: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Gen2StorageConfigurationInput", + modelProperties: { + accountName: { + serializedName: "accountName", + required: true, + type: { + name: "String" + } + }, + managementKey: { + serializedName: "managementKey", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const Gen2StorageConfigurationOutput: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Gen2StorageConfigurationOutput", + modelProperties: { + accountName: { + serializedName: "accountName", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const Gen2StorageConfigurationMutableProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Gen2StorageConfigurationMutableProperties", + modelProperties: { + managementKey: { + serializedName: "managementKey", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const Gen1EnvironmentCreationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Gen1EnvironmentCreationProperties", + modelProperties: { + dataRetentionTime: { + serializedName: "dataRetentionTime", + required: true, + type: { + name: "TimeSpan" + } + }, + storageLimitExceededBehavior: { + serializedName: "storageLimitExceededBehavior", + type: { + name: "String" + } + }, + partitionKeyProperties: { + serializedName: "partitionKeyProperties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeSeriesIdProperty" + } + } + } + } + } + } +}; + +export const TimeSeriesIdProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TimeSeriesIdProperty", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const EnvironmentStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentStatus", + modelProperties: { + ingress: { + serializedName: "ingress", + type: { + name: "Composite", + className: "IngressEnvironmentStatus" + } + }, + warmStorage: { + serializedName: "warmStorage", + type: { + name: "Composite", + className: "WarmStorageEnvironmentStatus" + } + } + } + } +}; + +export const IngressEnvironmentStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IngressEnvironmentStatus", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String" + } + }, + stateDetails: { + serializedName: "stateDetails", + type: { + name: "Composite", + className: "EnvironmentStateDetails" + } + } + } + } +}; + +export const EnvironmentStateDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentStateDetails", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const WarmStorageEnvironmentStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WarmStorageEnvironmentStatus", + modelProperties: { + state: { + serializedName: "propertiesUsage.state", + type: { + name: "String" + } + }, + currentCount: { + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 1 + }, + serializedName: "propertiesUsage.stateDetails.currentCount", + type: { + name: "Number" + } + }, + maxCount: { + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 1 + }, + serializedName: "propertiesUsage.stateDetails.maxCount", + type: { + name: "Number" + } + } + } + } +}; + +export const EventSourceMutableProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventSourceMutableProperties", + modelProperties: { + timestampPropertyName: { + serializedName: "timestampPropertyName", + type: { + name: "String" + } + } + } + } +}; + +export const EnvironmentCreateOrUpdateParameters: coreClient.CompositeMapper = { + serializedName: "EnvironmentCreateOrUpdateParameters", + type: { + name: "Composite", + className: "EnvironmentCreateOrUpdateParameters", + uberParent: "CreateOrUpdateTrackedResourceProperties", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + modelProperties: { + ...CreateOrUpdateTrackedResourceProperties.type.modelProperties, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + } + } + } +}; + +export const EventSourceCreateOrUpdateParameters: coreClient.CompositeMapper = { + serializedName: "EventSourceCreateOrUpdateParameters", + type: { + name: "Composite", + className: "EventSourceCreateOrUpdateParameters", + uberParent: "CreateOrUpdateTrackedResourceProperties", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + modelProperties: { + ...CreateOrUpdateTrackedResourceProperties.type.modelProperties, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" + } + }, + localTimestamp: { + serializedName: "localTimestamp", + type: { name: "Composite", - className: "IngressEnvironmentStatus" + className: "LocalTimestamp" + } + } + } + } +}; + +export const ReferenceDataSetCreateOrUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReferenceDataSetCreateOrUpdateParameters", + modelProperties: { + ...CreateOrUpdateTrackedResourceProperties.type.modelProperties, + keyProperties: { + serializedName: "properties.keyProperties", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReferenceDataSetKeyProperty" + } + } + } + }, + dataStringComparisonBehavior: { + serializedName: "properties.dataStringComparisonBehavior", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const AccessPolicyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessPolicyResource", + modelProperties: { + ...Resource.type.modelProperties, + principalObjectId: { + serializedName: "properties.principalObjectId", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + roles: { + serializedName: "properties.roles", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Gen1EnvironmentUpdateParameters: coreClient.CompositeMapper = { + serializedName: "Gen1", + type: { + name: "Composite", + className: "Gen1EnvironmentUpdateParameters", + uberParent: "EnvironmentUpdateParameters", + polymorphicDiscriminator: + EnvironmentUpdateParameters.type.polymorphicDiscriminator, + modelProperties: { + ...EnvironmentUpdateParameters.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + dataRetentionTime: { + serializedName: "properties.dataRetentionTime", + type: { + name: "TimeSpan" + } + }, + storageLimitExceededBehavior: { + serializedName: "properties.storageLimitExceededBehavior", + type: { + name: "String" + } + } + } + } +}; + +export const Gen2EnvironmentUpdateParameters: coreClient.CompositeMapper = { + serializedName: "Gen2", + type: { + name: "Composite", + className: "Gen2EnvironmentUpdateParameters", + uberParent: "EnvironmentUpdateParameters", + polymorphicDiscriminator: + EnvironmentUpdateParameters.type.polymorphicDiscriminator, + modelProperties: { + ...EnvironmentUpdateParameters.type.modelProperties, + storageConfiguration: { + serializedName: "properties.storageConfiguration", + type: { + name: "Composite", + className: "Gen2StorageConfigurationMutableProperties" + } + }, + warmStoreConfiguration: { + serializedName: "properties.warmStoreConfiguration", + type: { + name: "Composite", + className: "WarmStoreConfigurationProperties" + } + } + } + } +}; + +export const EventHubEventSourceUpdateParameters: coreClient.CompositeMapper = { + serializedName: "Microsoft.EventHub", + type: { + name: "Composite", + className: "EventHubEventSourceUpdateParameters", + uberParent: "EventSourceUpdateParameters", + polymorphicDiscriminator: + EventSourceUpdateParameters.type.polymorphicDiscriminator, + modelProperties: { + ...EventSourceUpdateParameters.type.modelProperties, + timestampPropertyName: { + serializedName: "properties.timestampPropertyName", + type: { + name: "String" + } + }, + sharedAccessKey: { + serializedName: "properties.sharedAccessKey", + type: { + name: "String" + } + } + } + } +}; + +export const IoTHubEventSourceUpdateParameters: coreClient.CompositeMapper = { + serializedName: "Microsoft.IoTHub", + type: { + name: "Composite", + className: "IoTHubEventSourceUpdateParameters", + uberParent: "EventSourceUpdateParameters", + polymorphicDiscriminator: + EventSourceUpdateParameters.type.polymorphicDiscriminator, + modelProperties: { + ...EventSourceUpdateParameters.type.modelProperties, + timestampPropertyName: { + serializedName: "properties.timestampPropertyName", + type: { + name: "String" + } + }, + sharedAccessKey: { + serializedName: "properties.sharedAccessKey", + type: { + name: "String" + } + } + } + } +}; + +export const ReferenceDataSetResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReferenceDataSetResourceProperties", + modelProperties: { + ...ReferenceDataSetCreationProperties.type.modelProperties, + ...ResourceProperties.type.modelProperties + } + } +}; + +export const EnvironmentResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentResourceProperties", + modelProperties: { + ...ResourceProperties.type.modelProperties, + dataAccessId: { + serializedName: "dataAccessId", + readOnly: true, + type: { + name: "Uuid" + } + }, + dataAccessFqdn: { + serializedName: "dataAccessFqdn", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "Composite", + className: "EnvironmentStatus" + } + } + } + } +}; + +export const EventSourceCommonProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventSourceCommonProperties", + modelProperties: { + ...ResourceProperties.type.modelProperties, + timestampPropertyName: { + serializedName: "timestampPropertyName", + type: { + name: "String" + } + }, + localTimestamp: { + serializedName: "localTimestamp", + type: { + name: "Composite", + className: "LocalTimestamp" + } + }, + type: { + serializedName: "ingressStartAt.type", + type: { + name: "String" + } + }, + time: { + serializedName: "ingressStartAt.time", + type: { + name: "String" } } } } }; -export const EnvironmentResource: msRest.CompositeMapper = { - serializedName: "EnvironmentResource", +export const Gen1EnvironmentResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentResource", + className: "Gen1EnvironmentResourceProperties", modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - serializedName: "sku", + ...Gen1EnvironmentCreationProperties.type.modelProperties, + ...EnvironmentResourceProperties.type.modelProperties + } + } +}; + +export const EventHubEventSourceMutableProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventHubEventSourceMutableProperties", + modelProperties: { + ...EventSourceMutableProperties.type.modelProperties, + sharedAccessKey: { + serializedName: "sharedAccessKey", type: { - name: "Composite", - className: "Sku" + name: "String" } - }, + } + } + } +}; + +export const IoTHubEventSourceMutableProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IoTHubEventSourceMutableProperties", + modelProperties: { + ...EventSourceMutableProperties.type.modelProperties, + sharedAccessKey: { + serializedName: "sharedAccessKey", + type: { + name: "String" + } + } + } + } +}; + +export const Gen1EnvironmentCreateOrUpdateParameters: coreClient.CompositeMapper = { + serializedName: "Gen1", + type: { + name: "Composite", + className: "Gen1EnvironmentCreateOrUpdateParameters", + uberParent: "CreateOrUpdateTrackedResourceProperties", + polymorphicDiscriminator: + CreateOrUpdateTrackedResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...EnvironmentCreateOrUpdateParameters.type.modelProperties, dataRetentionTime: { - required: true, serializedName: "properties.dataRetentionTime", + required: true, type: { name: "TimeSpan" } @@ -445,11 +1380,7 @@ export const EnvironmentResource: msRest.CompositeMapper = { storageLimitExceededBehavior: { serializedName: "properties.storageLimitExceededBehavior", type: { - name: "Enum", - allowedValues: [ - "PurgeOldData", - "PauseIngress" - ] + name: "String" } }, partitionKeyProperties: { @@ -459,126 +1390,76 @@ export const EnvironmentResource: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "PartitionKeyProperty" + className: "TimeSeriesIdProperty" } } } - }, - provisioningState: { - serializedName: "properties.provisioningState", - type: { - name: "Enum", - allowedValues: [ - "Accepted", - "Creating", - "Updating", - "Succeeded", - "Failed", - "Deleting" - ] - } - }, - creationTime: { - readOnly: true, - serializedName: "properties.creationTime", - type: { - name: "DateTime" - } - }, - dataAccessId: { - readOnly: true, - serializedName: "properties.dataAccessId", - type: { - name: "Uuid" - } - }, - dataAccessFqdn: { - readOnly: true, - serializedName: "properties.dataAccessFqdn", - type: { - name: "String" - } - }, - status: { - serializedName: "properties.status", - type: { - name: "Composite", - className: "EnvironmentStatus" - } } } } }; -export const EnvironmentListResponse: msRest.CompositeMapper = { - serializedName: "EnvironmentListResponse", +export const Gen2EnvironmentCreateOrUpdateParameters: coreClient.CompositeMapper = { + serializedName: "Gen2", type: { name: "Composite", - className: "EnvironmentListResponse", + className: "Gen2EnvironmentCreateOrUpdateParameters", + uberParent: "CreateOrUpdateTrackedResourceProperties", + polymorphicDiscriminator: + CreateOrUpdateTrackedResourceProperties.type.polymorphicDiscriminator, modelProperties: { - value: { - serializedName: "value", + ...EnvironmentCreateOrUpdateParameters.type.modelProperties, + timeSeriesIdProperties: { + serializedName: "properties.timeSeriesIdProperties", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "EnvironmentResource" + className: "TimeSeriesIdProperty" } } } - } - } - } -}; - -export const EventSourceCreateOrUpdateParameters: msRest.CompositeMapper = { - serializedName: "EventSourceCreateOrUpdateParameters", - type: { - name: "Composite", - polymorphicDiscriminator: { - serializedName: "kind", - clientName: "kind" - }, - uberParent: "CreateOrUpdateTrackedResourceProperties", - className: "EventSourceCreateOrUpdateParameters", - modelProperties: { - ...CreateOrUpdateTrackedResourceProperties.type.modelProperties, - kind: { - required: true, - serializedName: "kind", + }, + storageConfiguration: { + serializedName: "properties.storageConfiguration", type: { - name: "String" + name: "Composite", + className: "Gen2StorageConfigurationInput" + } + }, + warmStoreConfiguration: { + serializedName: "properties.warmStoreConfiguration", + type: { + name: "Composite", + className: "WarmStoreConfigurationProperties" } } } } }; -export const EventHubEventSourceCreateOrUpdateParameters: msRest.CompositeMapper = { +export const EventHubEventSourceCreateOrUpdateParameters: coreClient.CompositeMapper = { serializedName: "Microsoft.EventHub", type: { name: "Composite", className: "EventHubEventSourceCreateOrUpdateParameters", + uberParent: "CreateOrUpdateTrackedResourceProperties", + polymorphicDiscriminator: + CreateOrUpdateTrackedResourceProperties.type.polymorphicDiscriminator, modelProperties: { ...EventSourceCreateOrUpdateParameters.type.modelProperties, provisioningState: { serializedName: "properties.provisioningState", + readOnly: true, type: { - name: "Enum", - allowedValues: [ - "Accepted", - "Creating", - "Updating", - "Succeeded", - "Failed", - "Deleting" - ] + name: "String" } }, creationTime: { - readOnly: true, serializedName: "properties.creationTime", + readOnly: true, type: { name: "DateTime" } @@ -589,44 +1470,63 @@ export const EventHubEventSourceCreateOrUpdateParameters: msRest.CompositeMapper name: "String" } }, + localTimestampPropertiesLocalTimestamp: { + serializedName: "properties.localTimestamp", + type: { + name: "Composite", + className: "LocalTimestamp" + } + }, + type: { + serializedName: "properties.ingressStartAt.type", + type: { + name: "String" + } + }, + time: { + serializedName: "properties.ingressStartAt.time", + type: { + name: "String" + } + }, eventSourceResourceId: { - required: true, serializedName: "properties.eventSourceResourceId", + required: true, type: { name: "String" } }, serviceBusNamespace: { - required: true, serializedName: "properties.serviceBusNamespace", + required: true, type: { name: "String" } }, eventHubName: { - required: true, serializedName: "properties.eventHubName", + required: true, type: { name: "String" } }, consumerGroupName: { - required: true, serializedName: "properties.consumerGroupName", + required: true, type: { name: "String" } }, keyName: { - required: true, serializedName: "properties.keyName", + required: true, type: { name: "String" } }, sharedAccessKey: { - required: true, serializedName: "properties.sharedAccessKey", + required: true, type: { name: "String" } @@ -635,30 +1535,26 @@ export const EventHubEventSourceCreateOrUpdateParameters: msRest.CompositeMapper } }; -export const IoTHubEventSourceCreateOrUpdateParameters: msRest.CompositeMapper = { +export const IoTHubEventSourceCreateOrUpdateParameters: coreClient.CompositeMapper = { serializedName: "Microsoft.IoTHub", type: { name: "Composite", className: "IoTHubEventSourceCreateOrUpdateParameters", + uberParent: "CreateOrUpdateTrackedResourceProperties", + polymorphicDiscriminator: + CreateOrUpdateTrackedResourceProperties.type.polymorphicDiscriminator, modelProperties: { ...EventSourceCreateOrUpdateParameters.type.modelProperties, provisioningState: { serializedName: "properties.provisioningState", + readOnly: true, type: { - name: "Enum", - allowedValues: [ - "Accepted", - "Creating", - "Updating", - "Succeeded", - "Failed", - "Deleting" - ] + name: "String" } }, creationTime: { - readOnly: true, serializedName: "properties.creationTime", + readOnly: true, type: { name: "DateTime" } @@ -669,37 +1565,56 @@ export const IoTHubEventSourceCreateOrUpdateParameters: msRest.CompositeMapper = name: "String" } }, + localTimestampPropertiesLocalTimestamp: { + serializedName: "properties.localTimestamp", + type: { + name: "Composite", + className: "LocalTimestamp" + } + }, + type: { + serializedName: "properties.ingressStartAt.type", + type: { + name: "String" + } + }, + time: { + serializedName: "properties.ingressStartAt.time", + type: { + name: "String" + } + }, eventSourceResourceId: { - required: true, serializedName: "properties.eventSourceResourceId", + required: true, type: { name: "String" } }, iotHubName: { - required: true, serializedName: "properties.iotHubName", + required: true, type: { name: "String" } }, consumerGroupName: { - required: true, serializedName: "properties.consumerGroupName", + required: true, type: { name: "String" } }, keyName: { - required: true, serializedName: "properties.keyName", + required: true, type: { name: "String" } }, sharedAccessKey: { - required: true, serializedName: "properties.sharedAccessKey", + required: true, type: { name: "String" } @@ -708,102 +1623,147 @@ export const IoTHubEventSourceCreateOrUpdateParameters: msRest.CompositeMapper = } }; -export const EventSourceUpdateParameters: msRest.CompositeMapper = { - serializedName: "EventSourceUpdateParameters", +export const EnvironmentResource: coreClient.CompositeMapper = { + serializedName: "EnvironmentResource", type: { name: "Composite", - className: "EventSourceUpdateParameters", + className: "EnvironmentResource", + uberParent: "Resource", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, modelProperties: { - tags: { - serializedName: "tags", + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Composite", + className: "Sku" + } + }, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String" } } } } }; -export const EventHubEventSourceUpdateParameters: msRest.CompositeMapper = { - serializedName: "EventHubEventSourceUpdateParameters", +export const EventSourceResource: coreClient.CompositeMapper = { + serializedName: "EventSourceResource", type: { name: "Composite", - className: "EventHubEventSourceUpdateParameters", + className: "EventSourceResource", + uberParent: "Resource", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, modelProperties: { - ...EventSourceUpdateParameters.type.modelProperties, - timestampPropertyName: { - serializedName: "properties.timestampPropertyName", + ...TrackedResource.type.modelProperties, + kind: { + serializedName: "kind", + required: true, type: { name: "String" } + } + } + } +}; + +export const ReferenceDataSetResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReferenceDataSetResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + keyProperties: { + serializedName: "properties.keyProperties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReferenceDataSetKeyProperty" + } + } + } }, - localTimestamp: { - serializedName: "properties.localTimestamp", + dataStringComparisonBehavior: { + serializedName: "properties.dataStringComparisonBehavior", type: { - name: "Composite", - className: "LocalTimestamp" + name: "String" } }, - sharedAccessKey: { - serializedName: "properties.sharedAccessKey", + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } + }, + creationTime: { + serializedName: "properties.creationTime", + readOnly: true, + type: { + name: "DateTime" + } } } } }; -export const IoTHubEventSourceUpdateParameters: msRest.CompositeMapper = { - serializedName: "IoTHubEventSourceUpdateParameters", +export const Gen2EnvironmentResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IoTHubEventSourceUpdateParameters", + className: "Gen2EnvironmentResourceProperties", modelProperties: { - ...EventSourceUpdateParameters.type.modelProperties, - timestampPropertyName: { - serializedName: "properties.timestampPropertyName", + ...EnvironmentResourceProperties.type.modelProperties, + timeSeriesIdProperties: { + serializedName: "timeSeriesIdProperties", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeSeriesIdProperty" + } + } } }, - localTimestamp: { - serializedName: "properties.localTimestamp", + storageConfiguration: { + serializedName: "storageConfiguration", type: { name: "Composite", - className: "LocalTimestamp" + className: "Gen2StorageConfigurationOutput" } }, - sharedAccessKey: { - serializedName: "properties.sharedAccessKey", + warmStoreConfiguration: { + serializedName: "warmStoreConfiguration", type: { - name: "String" + name: "Composite", + className: "WarmStoreConfigurationProperties" } } } } }; -export const EventSourceResource: msRest.CompositeMapper = { - serializedName: "EventSourceResource", +export const AzureEventSourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: { - serializedName: "kind", - clientName: "kind" - }, - uberParent: "BaseResource", - className: "EventSourceResource", + className: "AzureEventSourceProperties", modelProperties: { - ...TrackedResource.type.modelProperties, - kind: { + ...EventSourceCommonProperties.type.modelProperties, + eventSourceResourceId: { + serializedName: "eventSourceResourceId", required: true, - serializedName: "kind", type: { name: "String" } @@ -812,664 +1772,461 @@ export const EventSourceResource: msRest.CompositeMapper = { } }; -export const EventSourceListResponse: msRest.CompositeMapper = { - serializedName: "EventSourceListResponse", +export const Gen1EnvironmentResource: coreClient.CompositeMapper = { + serializedName: "Gen1", type: { name: "Composite", - className: "EventSourceListResponse", + className: "Gen1EnvironmentResource", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, modelProperties: { - value: { - serializedName: "value", + ...EnvironmentResource.type.modelProperties, + dataRetentionTime: { + serializedName: "properties.dataRetentionTime", + required: true, + type: { + name: "TimeSpan" + } + }, + storageLimitExceededBehavior: { + serializedName: "properties.storageLimitExceededBehavior", + type: { + name: "String" + } + }, + partitionKeyProperties: { + serializedName: "properties.partitionKeyProperties", type: { name: "Sequence", element: { type: { name: "Composite", - className: "EventSourceResource" + className: "TimeSeriesIdProperty" } } } - } - } - } -}; - -export const EventHubEventSourceResource: msRest.CompositeMapper = { - serializedName: "Microsoft.EventHub", - type: { - name: "Composite", - className: "EventHubEventSourceResource", - modelProperties: { - ...EventSourceResource.type.modelProperties, + }, provisioningState: { serializedName: "properties.provisioningState", + readOnly: true, type: { - name: "Enum", - allowedValues: [ - "Accepted", - "Creating", - "Updating", - "Succeeded", - "Failed", - "Deleting" - ] + name: "String" } }, creationTime: { - readOnly: true, serializedName: "properties.creationTime", + readOnly: true, type: { name: "DateTime" } }, - timestampPropertyName: { - serializedName: "properties.timestampPropertyName", - type: { - name: "String" - } - }, - eventSourceResourceId: { - required: true, - serializedName: "properties.eventSourceResourceId", - type: { - name: "String" - } - }, - serviceBusNamespace: { - required: true, - serializedName: "properties.serviceBusNamespace", - type: { - name: "String" - } - }, - eventHubName: { - required: true, - serializedName: "properties.eventHubName", + dataAccessId: { + serializedName: "properties.dataAccessId", + readOnly: true, type: { - name: "String" + name: "Uuid" } }, - consumerGroupName: { - required: true, - serializedName: "properties.consumerGroupName", + dataAccessFqdn: { + serializedName: "properties.dataAccessFqdn", + readOnly: true, type: { name: "String" } }, - keyName: { - required: true, - serializedName: "properties.keyName", + status: { + serializedName: "properties.status", type: { - name: "String" + name: "Composite", + className: "EnvironmentStatus" } } } } }; -export const IoTHubEventSourceResource: msRest.CompositeMapper = { - serializedName: "Microsoft.IotHub", +export const Gen2EnvironmentResource: coreClient.CompositeMapper = { + serializedName: "Gen2", type: { name: "Composite", - className: "IoTHubEventSourceResource", + className: "Gen2EnvironmentResource", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, modelProperties: { - ...EventSourceResource.type.modelProperties, + ...EnvironmentResource.type.modelProperties, provisioningState: { serializedName: "properties.provisioningState", + readOnly: true, type: { - name: "Enum", - allowedValues: [ - "Accepted", - "Creating", - "Updating", - "Succeeded", - "Failed", - "Deleting" - ] + name: "String" } }, creationTime: { - readOnly: true, serializedName: "properties.creationTime", + readOnly: true, type: { name: "DateTime" } }, - timestampPropertyName: { - serializedName: "properties.timestampPropertyName", + dataAccessId: { + serializedName: "properties.dataAccessId", + readOnly: true, type: { - name: "String" + name: "Uuid" } }, - eventSourceResourceId: { - required: true, - serializedName: "properties.eventSourceResourceId", + dataAccessFqdn: { + serializedName: "properties.dataAccessFqdn", + readOnly: true, type: { name: "String" } }, - iotHubName: { - required: true, - serializedName: "properties.iotHubName", + status: { + serializedName: "properties.status", type: { - name: "String" + name: "Composite", + className: "EnvironmentStatus" } }, - consumerGroupName: { + timeSeriesIdProperties: { + serializedName: "properties.timeSeriesIdProperties", required: true, - serializedName: "properties.consumerGroupName", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeSeriesIdProperty" + } + } } }, - keyName: { - required: true, - serializedName: "properties.keyName", + storageConfiguration: { + serializedName: "properties.storageConfiguration", type: { - name: "String" + name: "Composite", + className: "Gen2StorageConfigurationOutput" } - } - } - } -}; - -export const EventSourceCommonProperties: msRest.CompositeMapper = { - serializedName: "EventSourceCommonProperties", - type: { - name: "Composite", - className: "EventSourceCommonProperties", - modelProperties: { - ...ResourceProperties.type.modelProperties, - timestampPropertyName: { - serializedName: "timestampPropertyName", + }, + warmStoreConfiguration: { + serializedName: "properties.warmStoreConfiguration", type: { - name: "String" + name: "Composite", + className: "WarmStoreConfigurationProperties" } } } } }; -export const AzureEventSourceProperties: msRest.CompositeMapper = { - serializedName: "AzureEventSourceProperties", +export const EventHubEventSourceResource: coreClient.CompositeMapper = { + serializedName: "Microsoft.EventHub", type: { name: "Composite", - className: "AzureEventSourceProperties", + className: "EventHubEventSourceResource", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, modelProperties: { - ...EventSourceCommonProperties.type.modelProperties, - eventSourceResourceId: { - required: true, - serializedName: "eventSourceResourceId", + ...EventSourceResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const EventHubEventSourceCommonProperties: msRest.CompositeMapper = { - serializedName: "EventHubEventSourceCommonProperties", - type: { - name: "Composite", - className: "EventHubEventSourceCommonProperties", - modelProperties: { - ...AzureEventSourceProperties.type.modelProperties, - serviceBusNamespace: { - required: true, - serializedName: "serviceBusNamespace", + }, + creationTime: { + serializedName: "properties.creationTime", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - eventHubName: { - required: true, - serializedName: "eventHubName", + timestampPropertyName: { + serializedName: "properties.timestampPropertyName", type: { name: "String" } }, - consumerGroupName: { - required: true, - serializedName: "consumerGroupName", + localTimestamp: { + serializedName: "properties.localTimestamp", type: { - name: "String" + name: "Composite", + className: "LocalTimestamp" } }, - keyName: { - required: true, - serializedName: "keyName", + typePropertiesIngressStartAtType: { + serializedName: "properties.ingressStartAt.type", type: { name: "String" } - } - } - } -}; - -export const IoTHubEventSourceCommonProperties: msRest.CompositeMapper = { - serializedName: "IoTHubEventSourceCommonProperties", - type: { - name: "Composite", - className: "IoTHubEventSourceCommonProperties", - modelProperties: { - ...AzureEventSourceProperties.type.modelProperties, - iotHubName: { - required: true, - serializedName: "iotHubName", + }, + time: { + serializedName: "properties.ingressStartAt.time", type: { name: "String" } }, - consumerGroupName: { + eventSourceResourceId: { + serializedName: "properties.eventSourceResourceId", required: true, - serializedName: "consumerGroupName", type: { name: "String" } }, - keyName: { + serviceBusNamespace: { + serializedName: "properties.serviceBusNamespace", required: true, - serializedName: "keyName", type: { name: "String" } - } - } - } -}; - -export const LocalTimestampTimeZoneOffset: msRest.CompositeMapper = { - serializedName: "LocalTimestamp_timeZoneOffset", - type: { - name: "Composite", - className: "LocalTimestampTimeZoneOffset", - modelProperties: { - propertyName: { - serializedName: "propertyName", + }, + eventHubName: { + serializedName: "properties.eventHubName", + required: true, type: { name: "String" } - } - } - } -}; - -export const LocalTimestamp: msRest.CompositeMapper = { - serializedName: "LocalTimestamp", - type: { - name: "Composite", - className: "LocalTimestamp", - modelProperties: { - format: { - serializedName: "format", + }, + consumerGroupName: { + serializedName: "properties.consumerGroupName", + required: true, type: { - name: "Enum", - allowedValues: [ - "Embedded", - "Iana", - "TimeSpan" - ] + name: "String" } }, - timeZoneOffset: { - serializedName: "timeZoneOffset", + keyName: { + serializedName: "properties.keyName", + required: true, type: { - name: "Composite", - className: "LocalTimestampTimeZoneOffset" + name: "String" } } } } }; -export const EventSourceMutableProperties: msRest.CompositeMapper = { - serializedName: "EventSourceMutableProperties", +export const IoTHubEventSourceResource: coreClient.CompositeMapper = { + serializedName: "Microsoft.IoTHub", type: { name: "Composite", - className: "EventSourceMutableProperties", + className: "IoTHubEventSourceResource", + uberParent: "Resource", + polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, modelProperties: { + ...EventSourceResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + creationTime: { + serializedName: "properties.creationTime", + readOnly: true, + type: { + name: "DateTime" + } + }, timestampPropertyName: { - serializedName: "timestampPropertyName", + serializedName: "properties.timestampPropertyName", type: { name: "String" } }, localTimestamp: { - serializedName: "localTimestamp", + serializedName: "properties.localTimestamp", type: { name: "Composite", className: "LocalTimestamp" } - } - } - } -}; - -export const ReferenceDataSetKeyProperty: msRest.CompositeMapper = { - serializedName: "ReferenceDataSetKeyProperty", - type: { - name: "Composite", - className: "ReferenceDataSetKeyProperty", - modelProperties: { - name: { - serializedName: "name", + }, + typePropertiesIngressStartAtType: { + serializedName: "properties.ingressStartAt.type", type: { name: "String" } }, - type: { - serializedName: "type", + time: { + serializedName: "properties.ingressStartAt.time", type: { - name: "Enum", - allowedValues: [ - "String", - "Double", - "Bool", - "DateTime" - ] + name: "String" } - } - } - } -}; - -export const ReferenceDataSetCreateOrUpdateParameters: msRest.CompositeMapper = { - serializedName: "ReferenceDataSetCreateOrUpdateParameters", - type: { - name: "Composite", - className: "ReferenceDataSetCreateOrUpdateParameters", - modelProperties: { - ...CreateOrUpdateTrackedResourceProperties.type.modelProperties, - keyProperties: { + }, + eventSourceResourceId: { + serializedName: "properties.eventSourceResourceId", required: true, - serializedName: "properties.keyProperties", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ReferenceDataSetKeyProperty" - } - } + name: "String" } }, - dataStringComparisonBehavior: { - serializedName: "properties.dataStringComparisonBehavior", + iotHubName: { + serializedName: "properties.iotHubName", + required: true, type: { - name: "Enum", - allowedValues: [ - "Ordinal", - "OrdinalIgnoreCase" - ] + name: "String" } - } - } - } -}; - -export const ReferenceDataSetUpdateParameters: msRest.CompositeMapper = { - serializedName: "ReferenceDataSetUpdateParameters", - type: { - name: "Composite", - className: "ReferenceDataSetUpdateParameters", - modelProperties: { - tags: { - serializedName: "tags", + }, + consumerGroupName: { + serializedName: "properties.consumerGroupName", + required: true, type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" + } + }, + keyName: { + serializedName: "properties.keyName", + required: true, + type: { + name: "String" } } } } }; -export const ReferenceDataSetResource: msRest.CompositeMapper = { - serializedName: "ReferenceDataSetResource", +export const EventHubEventSourceCommonProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ReferenceDataSetResource", + className: "EventHubEventSourceCommonProperties", modelProperties: { - ...TrackedResource.type.modelProperties, - keyProperties: { + ...AzureEventSourceProperties.type.modelProperties, + serviceBusNamespace: { + serializedName: "serviceBusNamespace", required: true, - serializedName: "properties.keyProperties", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ReferenceDataSetKeyProperty" - } - } + name: "String" } }, - dataStringComparisonBehavior: { - serializedName: "properties.dataStringComparisonBehavior", + eventHubName: { + serializedName: "eventHubName", + required: true, type: { - name: "Enum", - allowedValues: [ - "Ordinal", - "OrdinalIgnoreCase" - ] + name: "String" } }, - provisioningState: { - serializedName: "properties.provisioningState", + consumerGroupName: { + serializedName: "consumerGroupName", + required: true, type: { - name: "Enum", - allowedValues: [ - "Accepted", - "Creating", - "Updating", - "Succeeded", - "Failed", - "Deleting" - ] + name: "String" } }, - creationTime: { - readOnly: true, - serializedName: "properties.creationTime", - type: { - name: "DateTime" - } - } - } - } -}; - -export const ReferenceDataSetListResponse: msRest.CompositeMapper = { - serializedName: "ReferenceDataSetListResponse", - type: { - name: "Composite", - className: "ReferenceDataSetListResponse", - modelProperties: { - value: { - serializedName: "value", + keyName: { + serializedName: "keyName", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ReferenceDataSetResource" - } - } + name: "String" } } } } }; -export const AccessPolicyCreateOrUpdateParameters: msRest.CompositeMapper = { - serializedName: "AccessPolicyCreateOrUpdateParameters", +export const IoTHubEventSourceCommonProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessPolicyCreateOrUpdateParameters", + className: "IoTHubEventSourceCommonProperties", modelProperties: { - principalObjectId: { - serializedName: "properties.principalObjectId", + ...AzureEventSourceProperties.type.modelProperties, + iotHubName: { + serializedName: "iotHubName", + required: true, type: { name: "String" } }, - description: { - serializedName: "properties.description", + consumerGroupName: { + serializedName: "consumerGroupName", + required: true, type: { name: "String" } }, - roles: { - serializedName: "properties.roles", + keyName: { + serializedName: "keyName", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: [ - "Reader", - "Contributor" - ] - } - } + name: "String" } } } } }; -export const AccessPolicyUpdateParameters: msRest.CompositeMapper = { - serializedName: "AccessPolicyUpdateParameters", +export const EventHubEventSourceCreationProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessPolicyUpdateParameters", + className: "EventHubEventSourceCreationProperties", modelProperties: { - description: { - serializedName: "properties.description", + ...EventHubEventSourceCommonProperties.type.modelProperties, + sharedAccessKey: { + serializedName: "sharedAccessKey", + required: true, type: { name: "String" } - }, - roles: { - serializedName: "properties.roles", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: [ - "Reader", - "Contributor" - ] - } - } - } } } } }; -export const AccessPolicyResource: msRest.CompositeMapper = { - serializedName: "AccessPolicyResource", +export const EventHubEventSourceResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessPolicyResource", + className: "EventHubEventSourceResourceProperties", modelProperties: { - ...Resource.type.modelProperties, - principalObjectId: { - serializedName: "properties.principalObjectId", - type: { - name: "String" - } - }, - description: { - serializedName: "properties.description", - type: { - name: "String" - } - }, - roles: { - serializedName: "properties.roles", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: [ - "Reader", - "Contributor" - ] - } - } - } - } + ...EventHubEventSourceCommonProperties.type.modelProperties } } }; -export const AccessPolicyListResponse: msRest.CompositeMapper = { - serializedName: "AccessPolicyListResponse", +export const IoTHubEventSourceCreationProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessPolicyListResponse", + className: "IoTHubEventSourceCreationProperties", modelProperties: { - value: { - serializedName: "value", + ...IoTHubEventSourceCommonProperties.type.modelProperties, + sharedAccessKey: { + serializedName: "sharedAccessKey", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessPolicyResource" - } - } + name: "String" } } } } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const IoTHubEventSourceResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "IoTHubEventSourceResourceProperties", modelProperties: { - value: { - readOnly: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } - } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", - type: { - name: "String" - } - } + ...IoTHubEventSourceCommonProperties.type.modelProperties } } }; -export const discriminators = { - 'CreateOrUpdateTrackedResourceProperties.EventSourceCreateOrUpdateParameters' : EventSourceCreateOrUpdateParameters, - 'CreateOrUpdateTrackedResourceProperties.Microsoft.EventHub' : EventHubEventSourceCreateOrUpdateParameters, - 'CreateOrUpdateTrackedResourceProperties.Microsoft.IoTHub' : IoTHubEventSourceCreateOrUpdateParameters, - 'BaseResource.EventSourceResource' : EventSourceResource, - 'BaseResource.Microsoft.EventHub' : EventHubEventSourceResource, - 'BaseResource.Microsoft.IotHub' : IoTHubEventSourceResource - +export let discriminators = { + EnvironmentUpdateParameters: EnvironmentUpdateParameters, + EventSourceUpdateParameters: EventSourceUpdateParameters, + "CreateOrUpdateTrackedResourceProperties.EnvironmentCreateOrUpdateParameters": EnvironmentCreateOrUpdateParameters, + "CreateOrUpdateTrackedResourceProperties.EventSourceCreateOrUpdateParameters": EventSourceCreateOrUpdateParameters, + "EnvironmentUpdateParameters.Gen1": Gen1EnvironmentUpdateParameters, + "EnvironmentUpdateParameters.Gen2": Gen2EnvironmentUpdateParameters, + "EventSourceUpdateParameters.Microsoft.EventHub": EventHubEventSourceUpdateParameters, + "EventSourceUpdateParameters.Microsoft.IoTHub": IoTHubEventSourceUpdateParameters, + "CreateOrUpdateTrackedResourceProperties.Gen1": Gen1EnvironmentCreateOrUpdateParameters, + "CreateOrUpdateTrackedResourceProperties.Gen2": Gen2EnvironmentCreateOrUpdateParameters, + "CreateOrUpdateTrackedResourceProperties.Microsoft.EventHub": EventHubEventSourceCreateOrUpdateParameters, + "CreateOrUpdateTrackedResourceProperties.Microsoft.IoTHub": IoTHubEventSourceCreateOrUpdateParameters, + "Resource.EnvironmentResource": EnvironmentResource, + "Resource.EventSourceResource": EventSourceResource, + "Resource.Gen1": Gen1EnvironmentResource, + "Resource.Gen2": Gen2EnvironmentResource, + "Resource.Microsoft.EventHub": EventHubEventSourceResource, + "Resource.Microsoft.IoTHub": IoTHubEventSourceResource }; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/operationsMappers.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/operationsMappers.ts deleted file mode 100644 index 65fc7dd1800a..000000000000 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/operationsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - CloudError, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/parameters.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/parameters.ts index eda54e0771b8..4e1fd714559d 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/parameters.ts +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/parameters.ts @@ -1,115 +1,143 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + EnvironmentCreateOrUpdateParameters as EnvironmentCreateOrUpdateParametersMapper, + EnvironmentUpdateParameters as EnvironmentUpdateParametersMapper, + EventSourceCreateOrUpdateParameters as EventSourceCreateOrUpdateParametersMapper, + EventSourceUpdateParameters as EventSourceUpdateParametersMapper, + ReferenceDataSetCreateOrUpdateParameters as ReferenceDataSetCreateOrUpdateParametersMapper, + ReferenceDataSetUpdateParameters as ReferenceDataSetUpdateParametersMapper, + AccessPolicyCreateOrUpdateParameters as AccessPolicyCreateOrUpdateParametersMapper, + AccessPolicyUpdateParameters as AccessPolicyUpdateParametersMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const accessPolicyName0: msRest.OperationURLParameter = { - parameterPath: "accessPolicyName", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "accessPolicyName", - constraints: { - MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ - }, type: { name: "String" } - } + }, + skipEncoding: true }; -export const accessPolicyName1: msRest.OperationURLParameter = { - parameterPath: "accessPolicyName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "accessPolicyName", + defaultValue: "2020-05-15", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - serializedName: "api-version", + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const environmentName0: msRest.OperationURLParameter = { - parameterPath: "environmentName", + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: EnvironmentCreateOrUpdateParametersMapper +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "environmentName", - constraints: { - MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ - }, type: { name: "String" } } }; -export const environmentName1: msRest.OperationURLParameter = { - parameterPath: "environmentName", + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + serializedName: "resourceGroupName", required: true, - serializedName: "environmentName", type: { name: "String" } } }; -export const eventSourceName0: msRest.OperationURLParameter = { - parameterPath: "eventSourceName", + +export const environmentName: OperationURLParameter = { + parameterPath: "environmentName", mapper: { - required: true, - serializedName: "eventSourceName", constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, + serializedName: "environmentName", + required: true, type: { name: "String" } } }; -export const eventSourceName1: msRest.OperationURLParameter = { - parameterPath: "eventSourceName", + +export const environmentName1: OperationURLParameter = { + parameterPath: "environmentName", mapper: { + serializedName: "environmentName", required: true, - serializedName: "eventSourceName", type: { name: "String" } } }; -export const expand: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "expand" - ], + +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], mapper: { serializedName: "$expand", type: { @@ -117,59 +145,119 @@ export const expand: msRest.OperationQueryParameter = { } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const environmentUpdateParameters: OperationParameter = { + parameterPath: "environmentUpdateParameters", + mapper: EnvironmentUpdateParametersMapper +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: EventSourceCreateOrUpdateParametersMapper +}; + +export const eventSourceName: OperationURLParameter = { + parameterPath: "eventSourceName", mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), + MaxLength: 90, + MinLength: 1 + }, + serializedName: "eventSourceName", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const referenceDataSetName0: msRest.OperationURLParameter = { - parameterPath: "referenceDataSetName", + +export const eventSourceName1: OperationURLParameter = { + parameterPath: "eventSourceName", mapper: { + serializedName: "eventSourceName", required: true, - serializedName: "referenceDataSetName", + type: { + name: "String" + } + } +}; + +export const eventSourceUpdateParameters: OperationParameter = { + parameterPath: "eventSourceUpdateParameters", + mapper: EventSourceUpdateParametersMapper +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: ReferenceDataSetCreateOrUpdateParametersMapper +}; + +export const referenceDataSetName: OperationURLParameter = { + parameterPath: "referenceDataSetName", + mapper: { constraints: { + Pattern: new RegExp("^[A-Za-z0-9]"), MaxLength: 63, - MinLength: 3, - Pattern: /^[A-Za-z0-9]/ + MinLength: 3 }, + serializedName: "referenceDataSetName", + required: true, type: { name: "String" } } }; -export const referenceDataSetName1: msRest.OperationURLParameter = { + +export const referenceDataSetName1: OperationURLParameter = { parameterPath: "referenceDataSetName", mapper: { - required: true, serializedName: "referenceDataSetName", + required: true, type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const referenceDataSetUpdateParameters: OperationParameter = { + parameterPath: "referenceDataSetUpdateParameters", + mapper: ReferenceDataSetUpdateParametersMapper +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: AccessPolicyCreateOrUpdateParametersMapper +}; + +export const accessPolicyName: OperationURLParameter = { + parameterPath: "accessPolicyName", mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), + MaxLength: 90, + MinLength: 1 + }, + serializedName: "accessPolicyName", required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const accessPolicyName1: OperationURLParameter = { + parameterPath: "accessPolicyName", mapper: { + serializedName: "accessPolicyName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; + +export const accessPolicyUpdateParameters: OperationParameter = { + parameterPath: "accessPolicyUpdateParameters", + mapper: AccessPolicyUpdateParametersMapper +}; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/referenceDataSetsMappers.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/referenceDataSetsMappers.ts deleted file mode 100644 index 26490d10e27f..000000000000 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/models/referenceDataSetsMappers.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - AccessPolicyResource, - BaseResource, - CloudError, - CreateOrUpdateTrackedResourceProperties, - EnvironmentCreateOrUpdateParameters, - EnvironmentResource, - EnvironmentStateDetails, - EnvironmentStatus, - EventHubEventSourceCreateOrUpdateParameters, - EventHubEventSourceResource, - EventSourceCreateOrUpdateParameters, - EventSourceResource, - IngressEnvironmentStatus, - IoTHubEventSourceCreateOrUpdateParameters, - IoTHubEventSourceResource, - PartitionKeyProperty, - ReferenceDataSetCreateOrUpdateParameters, - ReferenceDataSetKeyProperty, - ReferenceDataSetListResponse, - ReferenceDataSetResource, - ReferenceDataSetUpdateParameters, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/accessPolicies.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/accessPolicies.ts index 801834bf6530..645401deaf53 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/accessPolicies.ts +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/accessPolicies.ts @@ -1,28 +1,39 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/accessPoliciesMappers"; +import { AccessPolicies } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { TimeSeriesInsightsClientContext } from "../timeSeriesInsightsClientContext"; +import { TimeSeriesInsightsClient } from "../timeSeriesInsightsClient"; +import { + AccessPolicyCreateOrUpdateParameters, + AccessPoliciesCreateOrUpdateOptionalParams, + AccessPoliciesCreateOrUpdateResponse, + AccessPoliciesGetOptionalParams, + AccessPoliciesGetResponse, + AccessPolicyUpdateParameters, + AccessPoliciesUpdateOptionalParams, + AccessPoliciesUpdateResponse, + AccessPoliciesDeleteOptionalParams, + AccessPoliciesListByEnvironmentOptionalParams, + AccessPoliciesListByEnvironmentResponse +} from "../models"; -/** Class representing a AccessPolicies. */ -export class AccessPolicies { - private readonly client: TimeSeriesInsightsClientContext; +/** Class containing AccessPolicies operations. */ +export class AccessPoliciesImpl implements AccessPolicies { + private readonly client: TimeSeriesInsightsClient; /** - * Create a AccessPolicies. - * @param {TimeSeriesInsightsClientContext} client Reference to the service client. + * Initialize a new instance of the class AccessPolicies class. + * @param client Reference to the service client */ - constructor(client: TimeSeriesInsightsClientContext) { + constructor(client: TimeSeriesInsightsClient) { this.client = client; } @@ -30,33 +41,18 @@ export class AccessPolicies { * Create or update an access policy in the specified environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. + * specified resource group. * @param accessPolicyName Name of the access policy. * @param parameters Parameters for creating an access policy. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, environmentName: string, accessPolicyName: string, parameters: Models.AccessPolicyCreateOrUpdateParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param accessPolicyName Name of the access policy. - * @param parameters Parameters for creating an access policy. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, environmentName: string, accessPolicyName: string, parameters: Models.AccessPolicyCreateOrUpdateParameters, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param accessPolicyName Name of the access policy. - * @param parameters Parameters for creating an access policy. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, environmentName: string, accessPolicyName: string, parameters: Models.AccessPolicyCreateOrUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, environmentName: string, accessPolicyName: string, parameters: Models.AccessPolicyCreateOrUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + environmentName: string, + accessPolicyName: string, + parameters: AccessPolicyCreateOrUpdateParameters, + options?: AccessPoliciesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -65,90 +61,50 @@ export class AccessPolicies { parameters, options }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); } /** * Gets the access policy with the specified name in the specified environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param accessPolicyName The name of the Time Series Insights access policy associated with the - * specified environment. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, environmentName: string, accessPolicyName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param accessPolicyName The name of the Time Series Insights access policy associated with the - * specified environment. - * @param callback The callback - */ - get(resourceGroupName: string, environmentName: string, accessPolicyName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. + * specified resource group. * @param accessPolicyName The name of the Time Series Insights access policy associated with the - * specified environment. - * @param options The optional parameters - * @param callback The callback + * specified environment. + * @param options The options parameters. */ - get(resourceGroupName: string, environmentName: string, accessPolicyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, environmentName: string, accessPolicyName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + environmentName: string, + accessPolicyName: string, + options?: AccessPoliciesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - environmentName, - accessPolicyName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, environmentName, accessPolicyName, options }, + getOperationSpec + ); } /** - * Updates the access policy with the specified name in the specified subscription, resource group, - * and environment. - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param accessPolicyName The name of the Time Series Insights access policy associated with the - * specified environment. - * @param accessPolicyUpdateParameters Request object that contains the updated information for the - * access policy. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, environmentName: string, accessPolicyName: string, accessPolicyUpdateParameters: Models.AccessPolicyUpdateParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param accessPolicyName The name of the Time Series Insights access policy associated with the - * specified environment. - * @param accessPolicyUpdateParameters Request object that contains the updated information for the - * access policy. - * @param callback The callback - */ - update(resourceGroupName: string, environmentName: string, accessPolicyName: string, accessPolicyUpdateParameters: Models.AccessPolicyUpdateParameters, callback: msRest.ServiceCallback): void; - /** + * Updates the access policy with the specified name in the specified subscription, resource group, and + * environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. + * specified resource group. * @param accessPolicyName The name of the Time Series Insights access policy associated with the - * specified environment. + * specified environment. * @param accessPolicyUpdateParameters Request object that contains the updated information for the - * access policy. - * @param options The optional parameters - * @param callback The callback + * access policy. + * @param options The options parameters. */ - update(resourceGroupName: string, environmentName: string, accessPolicyName: string, accessPolicyUpdateParameters: Models.AccessPolicyUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, environmentName: string, accessPolicyName: string, accessPolicyUpdateParameters: Models.AccessPolicyUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + environmentName: string, + accessPolicyName: string, + accessPolicyUpdateParameters: AccessPolicyUpdateParameters, + options?: AccessPoliciesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -157,113 +113,57 @@ export class AccessPolicies { accessPolicyUpdateParameters, options }, - updateOperationSpec, - callback) as Promise; + updateOperationSpec + ); } /** - * Deletes the access policy with the specified name in the specified subscription, resource group, - * and environment - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param accessPolicyName The name of the Time Series Insights access policy associated with the - * specified environment. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, environmentName: string, accessPolicyName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param accessPolicyName The name of the Time Series Insights access policy associated with the - * specified environment. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, environmentName: string, accessPolicyName: string, callback: msRest.ServiceCallback): void; - /** + * Deletes the access policy with the specified name in the specified subscription, resource group, and + * environment * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. + * specified resource group. * @param accessPolicyName The name of the Time Series Insights access policy associated with the - * specified environment. - * @param options The optional parameters - * @param callback The callback + * specified environment. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, environmentName: string, accessPolicyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, environmentName: string, accessPolicyName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + environmentName: string, + accessPolicyName: string, + options?: AccessPoliciesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - environmentName, - accessPolicyName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, environmentName, accessPolicyName, options }, + deleteOperationSpec + ); } /** * Lists all the available access policies associated with the environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param callback The callback - */ - listByEnvironment(resourceGroupName: string, environmentName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param options The optional parameters - * @param callback The callback + * specified resource group. + * @param options The options parameters. */ - listByEnvironment(resourceGroupName: string, environmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByEnvironment( + resourceGroupName: string, + environmentName: string, + options?: AccessPoliciesListByEnvironmentOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - environmentName, - options - }, - listByEnvironmentOperationSpec, - callback) as Promise; + { resourceGroupName, environmentName, options }, + listByEnvironmentOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.environmentName1, - Parameters.accessPolicyName0 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AccessPolicyCreateOrUpdateParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.AccessPolicyResource @@ -275,24 +175,23 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.environmentName1, - Parameters.accessPolicyName1 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.accessPolicyName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AccessPolicyResource @@ -301,31 +200,21 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.environmentName1, Parameters.accessPolicyName1 ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "accessPolicyUpdateParameters", - mapper: { - ...Mappers.AccessPolicyUpdateParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.AccessPolicyResource @@ -334,24 +223,23 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", + requestBody: Parameters.accessPolicyUpdateParameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.environmentName1, Parameters.accessPolicyName1 ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -359,23 +247,21 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listByEnvironmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.environmentName1 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.environmentName1, + Parameters.accessPolicyName1 ], + headerParameters: [Parameters.accept], + serializer +}; +const listByEnvironmentOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AccessPolicyListResponse @@ -384,5 +270,13 @@ const listByEnvironmentOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1 + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/environments.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/environments.ts index 375c717d8539..e4f32a938e66 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/environments.ts +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/environments.ts @@ -1,29 +1,43 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/environmentsMappers"; +import { Environments } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { TimeSeriesInsightsClientContext } from "../timeSeriesInsightsClientContext"; +import { TimeSeriesInsightsClient } from "../timeSeriesInsightsClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + EnvironmentCreateOrUpdateParametersUnion, + EnvironmentsCreateOrUpdateOptionalParams, + EnvironmentsCreateOrUpdateResponse, + EnvironmentsGetOptionalParams, + EnvironmentsGetResponse, + EnvironmentUpdateParametersUnion, + EnvironmentsUpdateOptionalParams, + EnvironmentsUpdateResponse, + EnvironmentsDeleteOptionalParams, + EnvironmentsListByResourceGroupOptionalParams, + EnvironmentsListByResourceGroupResponse, + EnvironmentsListBySubscriptionOptionalParams, + EnvironmentsListBySubscriptionResponse +} from "../models"; -/** Class representing a Environments. */ -export class Environments { - private readonly client: TimeSeriesInsightsClientContext; +/** Class containing Environments operations. */ +export class EnvironmentsImpl implements Environments { + private readonly client: TimeSeriesInsightsClient; /** - * Create a Environments. - * @param {TimeSeriesInsightsClientContext} client Reference to the service client. + * Initialize a new instance of the class Environments class. + * @param client Reference to the service client */ - constructor(client: TimeSeriesInsightsClientContext) { + constructor(client: TimeSeriesInsightsClient) { this.client = client; } @@ -32,361 +46,402 @@ export class Environments { * @param resourceGroupName Name of an Azure Resource group. * @param environmentName Name of the environment * @param parameters Parameters for creating an environment resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, environmentName: string, parameters: Models.EnvironmentCreateOrUpdateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,environmentName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + resourceGroupName: string, + environmentName: string, + parameters: EnvironmentCreateOrUpdateParametersUnion, + options?: EnvironmentsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + EnvironmentsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, environmentName, parameters, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Gets the environment with the specified name in the specified subscription and resource group. + * Create or update an environment in the specified subscription and resource group. * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param [options] The optional parameters - * @returns Promise + * @param environmentName Name of the environment + * @param parameters Parameters for creating an environment resource. + * @param options The options parameters. */ - get(resourceGroupName: string, environmentName: string, options?: Models.EnvironmentsGetOptionalParams): Promise; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + environmentName: string, + parameters: EnvironmentCreateOrUpdateParametersUnion, + options?: EnvironmentsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + environmentName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets the environment with the specified name in the specified subscription and resource group. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param callback The callback + * specified resource group. + * @param options The options parameters. */ - get(resourceGroupName: string, environmentName: string, callback: msRest.ServiceCallback): void; + get( + resourceGroupName: string, + environmentName: string, + options?: EnvironmentsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, environmentName, options }, + getOperationSpec + ); + } + /** + * Updates the environment with the specified name in the specified subscription and resource group. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param options The optional parameters - * @param callback The callback + * specified resource group. + * @param environmentUpdateParameters Request object that contains the updated information for the + * environment. + * @param options The options parameters. */ - get(resourceGroupName: string, environmentName: string, options: Models.EnvironmentsGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, environmentName: string, options?: Models.EnvironmentsGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginUpdate( + resourceGroupName: string, + environmentName: string, + environmentUpdateParameters: EnvironmentUpdateParametersUnion, + options?: EnvironmentsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + EnvironmentsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { resourceGroupName, environmentName, + environmentUpdateParameters, options }, - getOperationSpec, - callback) as Promise; + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Updates the environment with the specified name in the specified subscription and resource - * group. + * Updates the environment with the specified name in the specified subscription and resource group. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. + * specified resource group. * @param environmentUpdateParameters Request object that contains the updated information for the - * environment. - * @param [options] The optional parameters - * @returns Promise + * environment. + * @param options The options parameters. */ - update(resourceGroupName: string, environmentName: string, environmentUpdateParameters: Models.EnvironmentUpdateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdate(resourceGroupName,environmentName,environmentUpdateParameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginUpdateAndWait( + resourceGroupName: string, + environmentName: string, + environmentUpdateParameters: EnvironmentUpdateParametersUnion, + options?: EnvironmentsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + environmentName, + environmentUpdateParameters, + options + ); + return poller.pollUntilDone(); } /** - * Deletes the environment with the specified name in the specified subscription and resource - * group. - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, environmentName: string, callback: msRest.ServiceCallback): void; - /** + * Deletes the environment with the specified name in the specified subscription and resource group. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param options The optional parameters - * @param callback The callback + * specified resource group. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, environmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + environmentName: string, + options?: EnvironmentsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - environmentName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, environmentName, options }, + deleteOperationSpec + ); } /** * Lists all the available environments associated with the subscription and within the specified * resource group. * @param resourceGroupName Name of an Azure Resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByResourceGroup( + resourceGroupName: string, + options?: EnvironmentsListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** * Lists all the available environments within a subscription, irrespective of the resource groups. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listBySubscription(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listBySubscription( + options?: EnvironmentsListBySubscriptionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listBySubscriptionOperationSpec, - callback) as Promise; - } - - /** - * Create or update an environment in the specified subscription and resource group. - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName Name of the environment - * @param parameters Parameters for creating an environment resource. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(resourceGroupName: string, environmentName: string, parameters: Models.EnvironmentCreateOrUpdateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - environmentName, - parameters, - options - }, - beginCreateOrUpdateOperationSpec, - options); - } - - /** - * Updates the environment with the specified name in the specified subscription and resource - * group. - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param environmentUpdateParameters Request object that contains the updated information for the - * environment. - * @param [options] The optional parameters - * @returns Promise - */ - beginUpdate(resourceGroupName: string, environmentName: string, environmentUpdateParameters: Models.EnvironmentUpdateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - environmentName, - environmentUpdateParameters, - options - }, - beginUpdateOperationSpec, - options); + { options }, + listBySubscriptionOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.environmentName1 - ], - queryParameters: [ - Parameters.expand, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.EnvironmentResource }, + 201: { + bodyMapper: Mappers.EnvironmentResource + }, + 202: { + bodyMapper: Mappers.EnvironmentResource + }, + 204: { + bodyMapper: Mappers.EnvironmentResource + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.environmentName1 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.environmentName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", + httpMethod: "GET", responses: { - 200: {}, - 204: {}, + 200: { + bodyMapper: Mappers.EnvironmentResource + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments", + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.environmentName1 ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.EnvironmentListResponse + bodyMapper: Mappers.EnvironmentResource + }, + 201: { + bodyMapper: Mappers.EnvironmentResource + }, + 202: { + bodyMapper: Mappers.EnvironmentResource + }, + 204: { + bodyMapper: Mappers.EnvironmentResource }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listBySubscriptionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.TimeSeriesInsights/environments", + requestBody: Parameters.environmentUpdateParameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1 ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.EnvironmentListResponse - }, + 200: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.environmentName0 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.environmentName1 ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.EnvironmentCreateOrUpdateParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EnvironmentResource - }, - 201: { - bodyMapper: Mappers.EnvironmentResource + bodyMapper: Mappers.EnvironmentListResponse }, - 404: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.environmentName1 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], - requestBody: { - parameterPath: "environmentUpdateParameters", - mapper: { - ...Mappers.EnvironmentUpdateParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.TimeSeriesInsights/environments", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EnvironmentResource + bodyMapper: Mappers.EnvironmentListResponse }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/eventSources.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/eventSources.ts index dfef5b520b67..609919bbf553 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/eventSources.ts +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/eventSources.ts @@ -1,28 +1,39 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/eventSourcesMappers"; +import { EventSources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { TimeSeriesInsightsClientContext } from "../timeSeriesInsightsClientContext"; +import { TimeSeriesInsightsClient } from "../timeSeriesInsightsClient"; +import { + EventSourceCreateOrUpdateParametersUnion, + EventSourcesCreateOrUpdateOptionalParams, + EventSourcesCreateOrUpdateResponse, + EventSourcesGetOptionalParams, + EventSourcesGetResponse, + EventSourceUpdateParametersUnion, + EventSourcesUpdateOptionalParams, + EventSourcesUpdateResponse, + EventSourcesDeleteOptionalParams, + EventSourcesListByEnvironmentOptionalParams, + EventSourcesListByEnvironmentResponse +} from "../models"; -/** Class representing a EventSources. */ -export class EventSources { - private readonly client: TimeSeriesInsightsClientContext; +/** Class containing EventSources operations. */ +export class EventSourcesImpl implements EventSources { + private readonly client: TimeSeriesInsightsClient; /** - * Create a EventSources. - * @param {TimeSeriesInsightsClientContext} client Reference to the service client. + * Initialize a new instance of the class EventSources class. + * @param client Reference to the service client */ - constructor(client: TimeSeriesInsightsClientContext) { + constructor(client: TimeSeriesInsightsClient) { this.client = client; } @@ -30,33 +41,18 @@ export class EventSources { * Create or update an event source under the specified environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. + * specified resource group. * @param eventSourceName Name of the event source. * @param parameters Parameters for creating an event source resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, environmentName: string, eventSourceName: string, parameters: Models.EventSourceCreateOrUpdateParametersUnion, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param eventSourceName Name of the event source. - * @param parameters Parameters for creating an event source resource. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, environmentName: string, eventSourceName: string, parameters: Models.EventSourceCreateOrUpdateParametersUnion, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param eventSourceName Name of the event source. - * @param parameters Parameters for creating an event source resource. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, environmentName: string, eventSourceName: string, parameters: Models.EventSourceCreateOrUpdateParametersUnion, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, environmentName: string, eventSourceName: string, parameters: Models.EventSourceCreateOrUpdateParametersUnion, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + environmentName: string, + eventSourceName: string, + parameters: EventSourceCreateOrUpdateParametersUnion, + options?: EventSourcesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -65,90 +61,50 @@ export class EventSources { parameters, options }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); } /** * Gets the event source with the specified name in the specified environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param eventSourceName The name of the Time Series Insights event source associated with the - * specified environment. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, environmentName: string, eventSourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param eventSourceName The name of the Time Series Insights event source associated with the - * specified environment. - * @param callback The callback - */ - get(resourceGroupName: string, environmentName: string, eventSourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. + * specified resource group. * @param eventSourceName The name of the Time Series Insights event source associated with the - * specified environment. - * @param options The optional parameters - * @param callback The callback + * specified environment. + * @param options The options parameters. */ - get(resourceGroupName: string, environmentName: string, eventSourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, environmentName: string, eventSourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + environmentName: string, + eventSourceName: string, + options?: EventSourcesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - environmentName, - eventSourceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, environmentName, eventSourceName, options }, + getOperationSpec + ); } /** - * Updates the event source with the specified name in the specified subscription, resource group, - * and environment. - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param eventSourceName The name of the Time Series Insights event source associated with the - * specified environment. - * @param eventSourceUpdateParameters Request object that contains the updated information for the - * event source. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, environmentName: string, eventSourceName: string, eventSourceUpdateParameters: Models.EventSourceUpdateParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param eventSourceName The name of the Time Series Insights event source associated with the - * specified environment. - * @param eventSourceUpdateParameters Request object that contains the updated information for the - * event source. - * @param callback The callback - */ - update(resourceGroupName: string, environmentName: string, eventSourceName: string, eventSourceUpdateParameters: Models.EventSourceUpdateParameters, callback: msRest.ServiceCallback): void; - /** + * Updates the event source with the specified name in the specified subscription, resource group, and + * environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. + * specified resource group. * @param eventSourceName The name of the Time Series Insights event source associated with the - * specified environment. + * specified environment. * @param eventSourceUpdateParameters Request object that contains the updated information for the - * event source. - * @param options The optional parameters - * @param callback The callback + * event source. + * @param options The options parameters. */ - update(resourceGroupName: string, environmentName: string, eventSourceName: string, eventSourceUpdateParameters: Models.EventSourceUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, environmentName: string, eventSourceName: string, eventSourceUpdateParameters: Models.EventSourceUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + environmentName: string, + eventSourceName: string, + eventSourceUpdateParameters: EventSourceUpdateParametersUnion, + options?: EventSourcesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -157,51 +113,30 @@ export class EventSources { eventSourceUpdateParameters, options }, - updateOperationSpec, - callback) as Promise; + updateOperationSpec + ); } /** - * Deletes the event source with the specified name in the specified subscription, resource group, - * and environment - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param eventSourceName The name of the Time Series Insights event source associated with the - * specified environment. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, environmentName: string, eventSourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param eventSourceName The name of the Time Series Insights event source associated with the - * specified environment. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, environmentName: string, eventSourceName: string, callback: msRest.ServiceCallback): void; - /** + * Deletes the event source with the specified name in the specified subscription, resource group, and + * environment * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. + * specified resource group. * @param eventSourceName The name of the Time Series Insights event source associated with the - * specified environment. - * @param options The optional parameters - * @param callback The callback + * specified environment. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, environmentName: string, eventSourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, environmentName: string, eventSourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + environmentName: string, + eventSourceName: string, + options?: EventSourcesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - environmentName, - eventSourceName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, environmentName, eventSourceName, options }, + deleteOperationSpec + ); } /** @@ -209,62 +144,27 @@ export class EventSources { * resource group and environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param callback The callback - */ - listByEnvironment(resourceGroupName: string, environmentName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param options The optional parameters - * @param callback The callback + * specified resource group. + * @param options The options parameters. */ - listByEnvironment(resourceGroupName: string, environmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByEnvironment( + resourceGroupName: string, + environmentName: string, + options?: EventSourcesListByEnvironmentOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - environmentName, - options - }, - listByEnvironmentOperationSpec, - callback) as Promise; + { resourceGroupName, environmentName, options }, + listByEnvironmentOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.environmentName1, - Parameters.eventSourceName0 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.EventSourceCreateOrUpdateParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.EventSourceResource @@ -276,24 +176,23 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.environmentName1, - Parameters.eventSourceName1 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.eventSourceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EventSourceResource @@ -302,31 +201,21 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.environmentName1, Parameters.eventSourceName1 ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "eventSourceUpdateParameters", - mapper: { - ...Mappers.EventSourceUpdateParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.EventSourceResource @@ -335,24 +224,23 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", + requestBody: Parameters.eventSourceUpdateParameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.environmentName1, Parameters.eventSourceName1 ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -360,23 +248,21 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listByEnvironmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.environmentName1 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.environmentName1, + Parameters.eventSourceName1 ], + headerParameters: [Parameters.accept], + serializer +}; +const listByEnvironmentOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EventSourceListResponse @@ -385,5 +271,13 @@ const listByEnvironmentOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1 + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/index.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/index.ts index 2ad013779b5f..acba1d2d811f 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/index.ts +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./operations"; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/operations.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/operations.ts index 966ed9c30e3d..f62aa33e861c 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/operations.ts +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/operations.ts @@ -1,95 +1,111 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { TimeSeriesInsightsClientContext } from "../timeSeriesInsightsClientContext"; +import { TimeSeriesInsightsClient } from "../timeSeriesInsightsClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: TimeSeriesInsightsClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: TimeSeriesInsightsClient; /** - * Create a Operations. - * @param {TimeSeriesInsightsClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: TimeSeriesInsightsClientContext) { + constructor(client: TimeSeriesInsightsClient) { this.client = client; } /** * Lists all of the available Time Series Insights related operations. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Lists all of the available Time Series Insights related operations. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.TimeSeriesInsights/operations", httpMethod: "GET", - path: "providers/Microsoft.TimeSeriesInsights/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -98,19 +114,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -119,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/referenceDataSets.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/referenceDataSets.ts index 274c8d939f1b..d955156f2b1a 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/referenceDataSets.ts +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operations/referenceDataSets.ts @@ -1,28 +1,39 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/referenceDataSetsMappers"; +import { ReferenceDataSets } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { TimeSeriesInsightsClientContext } from "../timeSeriesInsightsClientContext"; +import { TimeSeriesInsightsClient } from "../timeSeriesInsightsClient"; +import { + ReferenceDataSetCreateOrUpdateParameters, + ReferenceDataSetsCreateOrUpdateOptionalParams, + ReferenceDataSetsCreateOrUpdateResponse, + ReferenceDataSetsGetOptionalParams, + ReferenceDataSetsGetResponse, + ReferenceDataSetUpdateParameters, + ReferenceDataSetsUpdateOptionalParams, + ReferenceDataSetsUpdateResponse, + ReferenceDataSetsDeleteOptionalParams, + ReferenceDataSetsListByEnvironmentOptionalParams, + ReferenceDataSetsListByEnvironmentResponse +} from "../models"; -/** Class representing a ReferenceDataSets. */ -export class ReferenceDataSets { - private readonly client: TimeSeriesInsightsClientContext; +/** Class containing ReferenceDataSets operations. */ +export class ReferenceDataSetsImpl implements ReferenceDataSets { + private readonly client: TimeSeriesInsightsClient; /** - * Create a ReferenceDataSets. - * @param {TimeSeriesInsightsClientContext} client Reference to the service client. + * Initialize a new instance of the class ReferenceDataSets class. + * @param client Reference to the service client */ - constructor(client: TimeSeriesInsightsClientContext) { + constructor(client: TimeSeriesInsightsClient) { this.client = client; } @@ -30,33 +41,18 @@ export class ReferenceDataSets { * Create or update a reference data set in the specified environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. + * specified resource group. * @param referenceDataSetName Name of the reference data set. * @param parameters Parameters for creating a reference data set. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, environmentName: string, referenceDataSetName: string, parameters: Models.ReferenceDataSetCreateOrUpdateParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param referenceDataSetName Name of the reference data set. - * @param parameters Parameters for creating a reference data set. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, environmentName: string, referenceDataSetName: string, parameters: Models.ReferenceDataSetCreateOrUpdateParameters, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param referenceDataSetName Name of the reference data set. - * @param parameters Parameters for creating a reference data set. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, environmentName: string, referenceDataSetName: string, parameters: Models.ReferenceDataSetCreateOrUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, environmentName: string, referenceDataSetName: string, parameters: Models.ReferenceDataSetCreateOrUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + environmentName: string, + referenceDataSetName: string, + parameters: ReferenceDataSetCreateOrUpdateParameters, + options?: ReferenceDataSetsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -65,50 +61,29 @@ export class ReferenceDataSets { parameters, options }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); } /** * Gets the reference data set with the specified name in the specified environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param referenceDataSetName The name of the Time Series Insights reference data set associated - * with the specified environment. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param referenceDataSetName The name of the Time Series Insights reference data set associated - * with the specified environment. - * @param callback The callback - */ - get(resourceGroupName: string, environmentName: string, referenceDataSetName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param referenceDataSetName The name of the Time Series Insights reference data set associated - * with the specified environment. - * @param options The optional parameters - * @param callback The callback + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated with + * the specified environment. + * @param options The options parameters. */ - get(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + environmentName: string, + referenceDataSetName: string, + options?: ReferenceDataSetsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - environmentName, - referenceDataSetName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, environmentName, referenceDataSetName, options }, + getOperationSpec + ); } /** @@ -116,39 +91,20 @@ export class ReferenceDataSets { * group, and environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param referenceDataSetName The name of the Time Series Insights reference data set associated - * with the specified environment. - * @param referenceDataSetUpdateParameters Request object that contains the updated information for - * the reference data set. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, environmentName: string, referenceDataSetName: string, referenceDataSetUpdateParameters: Models.ReferenceDataSetUpdateParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param referenceDataSetName The name of the Time Series Insights reference data set associated - * with the specified environment. - * @param referenceDataSetUpdateParameters Request object that contains the updated information for - * the reference data set. - * @param callback The callback + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated with + * the specified environment. + * @param referenceDataSetUpdateParameters Request object that contains the updated information for the + * reference data set. + * @param options The options parameters. */ - update(resourceGroupName: string, environmentName: string, referenceDataSetName: string, referenceDataSetUpdateParameters: Models.ReferenceDataSetUpdateParameters, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param referenceDataSetName The name of the Time Series Insights reference data set associated - * with the specified environment. - * @param referenceDataSetUpdateParameters Request object that contains the updated information for - * the reference data set. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, environmentName: string, referenceDataSetName: string, referenceDataSetUpdateParameters: Models.ReferenceDataSetUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, environmentName: string, referenceDataSetName: string, referenceDataSetUpdateParameters: Models.ReferenceDataSetUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + environmentName: string, + referenceDataSetName: string, + referenceDataSetUpdateParameters: ReferenceDataSetUpdateParameters, + options?: ReferenceDataSetsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -157,8 +113,8 @@ export class ReferenceDataSets { referenceDataSetUpdateParameters, options }, - updateOperationSpec, - callback) as Promise; + updateOperationSpec + ); } /** @@ -166,42 +122,21 @@ export class ReferenceDataSets { * group, and environment * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param referenceDataSetName The name of the Time Series Insights reference data set associated - * with the specified environment. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param referenceDataSetName The name of the Time Series Insights reference data set associated - * with the specified environment. - * @param callback The callback + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated with + * the specified environment. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, environmentName: string, referenceDataSetName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param referenceDataSetName The name of the Time Series Insights reference data set associated - * with the specified environment. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, environmentName: string, referenceDataSetName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + environmentName: string, + referenceDataSetName: string, + options?: ReferenceDataSetsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - environmentName, - referenceDataSetName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, environmentName, referenceDataSetName, options }, + deleteOperationSpec + ); } /** @@ -209,62 +144,27 @@ export class ReferenceDataSets { * specified resource group and environment. * @param resourceGroupName Name of an Azure Resource group. * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param callback The callback + * specified resource group. + * @param options The options parameters. */ - listByEnvironment(resourceGroupName: string, environmentName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of an Azure Resource group. - * @param environmentName The name of the Time Series Insights environment associated with the - * specified resource group. - * @param options The optional parameters - * @param callback The callback - */ - listByEnvironment(resourceGroupName: string, environmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByEnvironment(resourceGroupName: string, environmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByEnvironment( + resourceGroupName: string, + environmentName: string, + options?: ReferenceDataSetsListByEnvironmentOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - environmentName, - options - }, - listByEnvironmentOperationSpec, - callback) as Promise; + { resourceGroupName, environmentName, options }, + listByEnvironmentOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.environmentName1, - Parameters.referenceDataSetName0 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ReferenceDataSetCreateOrUpdateParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.ReferenceDataSetResource @@ -276,24 +176,23 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.environmentName1, - Parameters.referenceDataSetName1 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.referenceDataSetName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReferenceDataSetResource @@ -302,31 +201,21 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.environmentName1, Parameters.referenceDataSetName1 ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "referenceDataSetUpdateParameters", - mapper: { - ...Mappers.ReferenceDataSetUpdateParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.ReferenceDataSetResource @@ -335,24 +224,23 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", + requestBody: Parameters.referenceDataSetUpdateParameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.environmentName1, Parameters.referenceDataSetName1 ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -360,23 +248,21 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listByEnvironmentOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.environmentName1 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.environmentName1, + Parameters.referenceDataSetName1 ], + headerParameters: [Parameters.accept], + serializer +}; +const listByEnvironmentOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReferenceDataSetListResponse @@ -385,5 +271,13 @@ const listByEnvironmentOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.environmentName1 + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/accessPolicies.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/accessPolicies.ts new file mode 100644 index 000000000000..0006379a963e --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/accessPolicies.ts @@ -0,0 +1,103 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + AccessPolicyCreateOrUpdateParameters, + AccessPoliciesCreateOrUpdateOptionalParams, + AccessPoliciesCreateOrUpdateResponse, + AccessPoliciesGetOptionalParams, + AccessPoliciesGetResponse, + AccessPolicyUpdateParameters, + AccessPoliciesUpdateOptionalParams, + AccessPoliciesUpdateResponse, + AccessPoliciesDeleteOptionalParams, + AccessPoliciesListByEnvironmentOptionalParams, + AccessPoliciesListByEnvironmentResponse +} from "../models"; + +/** Interface representing a AccessPolicies. */ +export interface AccessPolicies { + /** + * Create or update an access policy in the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName Name of the access policy. + * @param parameters Parameters for creating an access policy. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + environmentName: string, + accessPolicyName: string, + parameters: AccessPolicyCreateOrUpdateParameters, + options?: AccessPoliciesCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets the access policy with the specified name in the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + environmentName: string, + accessPolicyName: string, + options?: AccessPoliciesGetOptionalParams + ): Promise; + /** + * Updates the access policy with the specified name in the specified subscription, resource group, and + * environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param accessPolicyUpdateParameters Request object that contains the updated information for the + * access policy. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + environmentName: string, + accessPolicyName: string, + accessPolicyUpdateParameters: AccessPolicyUpdateParameters, + options?: AccessPoliciesUpdateOptionalParams + ): Promise; + /** + * Deletes the access policy with the specified name in the specified subscription, resource group, and + * environment + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param accessPolicyName The name of the Time Series Insights access policy associated with the + * specified environment. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + environmentName: string, + accessPolicyName: string, + options?: AccessPoliciesDeleteOptionalParams + ): Promise; + /** + * Lists all the available access policies associated with the environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param options The options parameters. + */ + listByEnvironment( + resourceGroupName: string, + environmentName: string, + options?: AccessPoliciesListByEnvironmentOptionalParams + ): Promise; +} diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/environments.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/environments.ts new file mode 100644 index 000000000000..aa837ae5daf5 --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/environments.ts @@ -0,0 +1,135 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + EnvironmentCreateOrUpdateParametersUnion, + EnvironmentsCreateOrUpdateOptionalParams, + EnvironmentsCreateOrUpdateResponse, + EnvironmentsGetOptionalParams, + EnvironmentsGetResponse, + EnvironmentUpdateParametersUnion, + EnvironmentsUpdateOptionalParams, + EnvironmentsUpdateResponse, + EnvironmentsDeleteOptionalParams, + EnvironmentsListByResourceGroupOptionalParams, + EnvironmentsListByResourceGroupResponse, + EnvironmentsListBySubscriptionOptionalParams, + EnvironmentsListBySubscriptionResponse +} from "../models"; + +/** Interface representing a Environments. */ +export interface Environments { + /** + * Create or update an environment in the specified subscription and resource group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName Name of the environment + * @param parameters Parameters for creating an environment resource. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + environmentName: string, + parameters: EnvironmentCreateOrUpdateParametersUnion, + options?: EnvironmentsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + EnvironmentsCreateOrUpdateResponse + > + >; + /** + * Create or update an environment in the specified subscription and resource group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName Name of the environment + * @param parameters Parameters for creating an environment resource. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + environmentName: string, + parameters: EnvironmentCreateOrUpdateParametersUnion, + options?: EnvironmentsCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets the environment with the specified name in the specified subscription and resource group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + environmentName: string, + options?: EnvironmentsGetOptionalParams + ): Promise; + /** + * Updates the environment with the specified name in the specified subscription and resource group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param environmentUpdateParameters Request object that contains the updated information for the + * environment. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + environmentName: string, + environmentUpdateParameters: EnvironmentUpdateParametersUnion, + options?: EnvironmentsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + EnvironmentsUpdateResponse + > + >; + /** + * Updates the environment with the specified name in the specified subscription and resource group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param environmentUpdateParameters Request object that contains the updated information for the + * environment. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + environmentName: string, + environmentUpdateParameters: EnvironmentUpdateParametersUnion, + options?: EnvironmentsUpdateOptionalParams + ): Promise; + /** + * Deletes the environment with the specified name in the specified subscription and resource group. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + environmentName: string, + options?: EnvironmentsDeleteOptionalParams + ): Promise; + /** + * Lists all the available environments associated with the subscription and within the specified + * resource group. + * @param resourceGroupName Name of an Azure Resource group. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: EnvironmentsListByResourceGroupOptionalParams + ): Promise; + /** + * Lists all the available environments within a subscription, irrespective of the resource groups. + * @param options The options parameters. + */ + listBySubscription( + options?: EnvironmentsListBySubscriptionOptionalParams + ): Promise; +} diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/eventSources.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/eventSources.ts new file mode 100644 index 000000000000..2816111d366d --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/eventSources.ts @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + EventSourceCreateOrUpdateParametersUnion, + EventSourcesCreateOrUpdateOptionalParams, + EventSourcesCreateOrUpdateResponse, + EventSourcesGetOptionalParams, + EventSourcesGetResponse, + EventSourceUpdateParametersUnion, + EventSourcesUpdateOptionalParams, + EventSourcesUpdateResponse, + EventSourcesDeleteOptionalParams, + EventSourcesListByEnvironmentOptionalParams, + EventSourcesListByEnvironmentResponse +} from "../models"; + +/** Interface representing a EventSources. */ +export interface EventSources { + /** + * Create or update an event source under the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName Name of the event source. + * @param parameters Parameters for creating an event source resource. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + environmentName: string, + eventSourceName: string, + parameters: EventSourceCreateOrUpdateParametersUnion, + options?: EventSourcesCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets the event source with the specified name in the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + environmentName: string, + eventSourceName: string, + options?: EventSourcesGetOptionalParams + ): Promise; + /** + * Updates the event source with the specified name in the specified subscription, resource group, and + * environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param eventSourceUpdateParameters Request object that contains the updated information for the + * event source. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + environmentName: string, + eventSourceName: string, + eventSourceUpdateParameters: EventSourceUpdateParametersUnion, + options?: EventSourcesUpdateOptionalParams + ): Promise; + /** + * Deletes the event source with the specified name in the specified subscription, resource group, and + * environment + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param eventSourceName The name of the Time Series Insights event source associated with the + * specified environment. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + environmentName: string, + eventSourceName: string, + options?: EventSourcesDeleteOptionalParams + ): Promise; + /** + * Lists all the available event sources associated with the subscription and within the specified + * resource group and environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param options The options parameters. + */ + listByEnvironment( + resourceGroupName: string, + environmentName: string, + options?: EventSourcesListByEnvironmentOptionalParams + ): Promise; +} diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/index.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..acba1d2d811f --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./environments"; +export * from "./eventSources"; +export * from "./referenceDataSets"; +export * from "./accessPolicies"; diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/operations.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..543fa4f6f26c --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available Time Series Insights related operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/referenceDataSets.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/referenceDataSets.ts new file mode 100644 index 000000000000..40c0a5c5fc88 --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/operationsInterfaces/referenceDataSets.ts @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + ReferenceDataSetCreateOrUpdateParameters, + ReferenceDataSetsCreateOrUpdateOptionalParams, + ReferenceDataSetsCreateOrUpdateResponse, + ReferenceDataSetsGetOptionalParams, + ReferenceDataSetsGetResponse, + ReferenceDataSetUpdateParameters, + ReferenceDataSetsUpdateOptionalParams, + ReferenceDataSetsUpdateResponse, + ReferenceDataSetsDeleteOptionalParams, + ReferenceDataSetsListByEnvironmentOptionalParams, + ReferenceDataSetsListByEnvironmentResponse +} from "../models"; + +/** Interface representing a ReferenceDataSets. */ +export interface ReferenceDataSets { + /** + * Create or update a reference data set in the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName Name of the reference data set. + * @param parameters Parameters for creating a reference data set. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + environmentName: string, + referenceDataSetName: string, + parameters: ReferenceDataSetCreateOrUpdateParameters, + options?: ReferenceDataSetsCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets the reference data set with the specified name in the specified environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated with + * the specified environment. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + environmentName: string, + referenceDataSetName: string, + options?: ReferenceDataSetsGetOptionalParams + ): Promise; + /** + * Updates the reference data set with the specified name in the specified subscription, resource + * group, and environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated with + * the specified environment. + * @param referenceDataSetUpdateParameters Request object that contains the updated information for the + * reference data set. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + environmentName: string, + referenceDataSetName: string, + referenceDataSetUpdateParameters: ReferenceDataSetUpdateParameters, + options?: ReferenceDataSetsUpdateOptionalParams + ): Promise; + /** + * Deletes the reference data set with the specified name in the specified subscription, resource + * group, and environment + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param referenceDataSetName The name of the Time Series Insights reference data set associated with + * the specified environment. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + environmentName: string, + referenceDataSetName: string, + options?: ReferenceDataSetsDeleteOptionalParams + ): Promise; + /** + * Lists all the available reference data sets associated with the subscription and within the + * specified resource group and environment. + * @param resourceGroupName Name of an Azure Resource group. + * @param environmentName The name of the Time Series Insights environment associated with the + * specified resource group. + * @param options The options parameters. + */ + listByEnvironment( + resourceGroupName: string, + environmentName: string, + options?: ReferenceDataSetsListByEnvironmentOptionalParams + ): Promise; +} diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/timeSeriesInsightsClient.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/timeSeriesInsightsClient.ts index e42685b68999..ee660f6dc1ec 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/timeSeriesInsightsClient.ts +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/src/timeSeriesInsightsClient.ts @@ -1,50 +1,95 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { TimeSeriesInsightsClientContext } from "./timeSeriesInsightsClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + EnvironmentsImpl, + EventSourcesImpl, + ReferenceDataSetsImpl, + AccessPoliciesImpl +} from "./operations"; +import { + Operations, + Environments, + EventSources, + ReferenceDataSets, + AccessPolicies +} from "./operationsInterfaces"; +import { TimeSeriesInsightsClientOptionalParams } from "./models"; - -class TimeSeriesInsightsClient extends TimeSeriesInsightsClientContext { - // Operation groups - operations: operations.Operations; - environments: operations.Environments; - eventSources: operations.EventSources; - referenceDataSets: operations.ReferenceDataSets; - accessPolicies: operations.AccessPolicies; +export class TimeSeriesInsightsClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the TimeSeriesInsightsClient class. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Azure Subscription ID. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.TimeSeriesInsightsClientOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.environments = new operations.Environments(this); - this.eventSources = new operations.EventSources(this); - this.referenceDataSets = new operations.ReferenceDataSets(this); - this.accessPolicies = new operations.AccessPolicies(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: TimeSeriesInsightsClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: TimeSeriesInsightsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-timeseriesinsights/2.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - TimeSeriesInsightsClient, - TimeSeriesInsightsClientContext, - Models as TimeSeriesInsightsModels, - Mappers as TimeSeriesInsightsMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2020-05-15"; + this.operations = new OperationsImpl(this); + this.environments = new EnvironmentsImpl(this); + this.eventSources = new EventSourcesImpl(this); + this.referenceDataSets = new ReferenceDataSetsImpl(this); + this.accessPolicies = new AccessPoliciesImpl(this); + } + + operations: Operations; + environments: Environments; + eventSources: EventSources; + referenceDataSets: ReferenceDataSets; + accessPolicies: AccessPolicies; +} diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/src/timeSeriesInsightsClientContext.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/src/timeSeriesInsightsClientContext.ts deleted file mode 100644 index a472e6cfb5f7..000000000000 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/src/timeSeriesInsightsClientContext.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-timeseriesinsights"; -const packageVersion = "1.2.1"; - -export class TimeSeriesInsightsClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the TimeSeriesInsightsClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId Azure Subscription ID. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.TimeSeriesInsightsClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2017-11-15'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/test/sampleTest.ts b/sdk/timeseriesinsights/arm-timeseriesinsights/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/timeseriesinsights/arm-timeseriesinsights/tsconfig.json b/sdk/timeseriesinsights/arm-timeseriesinsights/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/timeseriesinsights/arm-timeseriesinsights/tsconfig.json +++ b/sdk/timeseriesinsights/arm-timeseriesinsights/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/timeseriesinsights/ci.yml b/sdk/timeseriesinsights/ci.yml new file mode 100644 index 000000000000..6cf8e2791357 --- /dev/null +++ b/sdk/timeseriesinsights/ci.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/timeseriesinsights/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/timeseriesinsights/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: timeseriesinsights + Artifacts: + - name: azure-arm-timeseriesinsights + safeName: azurearmtimeseriesinsights + \ No newline at end of file diff --git a/sdk/trafficmanager/arm-trafficmanager/CHANGELOG.md b/sdk/trafficmanager/arm-trafficmanager/CHANGELOG.md new file mode 100644 index 000000000000..626a1763f22a --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 6.0.0 (2022-01-21) + +The package of @azure/arm-trafficmanager is using our next generation design principles since version 6.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/trafficmanager/arm-trafficmanager/LICENSE b/sdk/trafficmanager/arm-trafficmanager/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/trafficmanager/arm-trafficmanager/README.md b/sdk/trafficmanager/arm-trafficmanager/README.md index 72d87a5e5739..ac5087c55539 100644 --- a/sdk/trafficmanager/arm-trafficmanager/README.md +++ b/sdk/trafficmanager/arm-trafficmanager/README.md @@ -1,114 +1,98 @@ -## Azure TrafficManagerManagementClient SDK for JavaScript +# Azure TrafficManagerManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for TrafficManagerManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure TrafficManagerManagement client. + + + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/trafficmanager/arm-trafficmanager) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-trafficmanager) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-trafficmanager) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-trafficmanager` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-trafficmanager` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure TrafficManagerManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-trafficmanager @azure/identity +npm install @azure/arm-trafficmanager ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. -### How to use +### Create and authenticate a `TrafficManagerManagementClient` -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +To create a client object to access the Azure TrafficManagerManagement API, you will need the `endpoint` of your Azure TrafficManagerManagement resource and a `credential`. The Azure TrafficManagerManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure TrafficManagerManagement resource in the [Azure Portal][azure_portal]. -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. -#### nodejs - Authentication, client creation, and get endpoints as an example written in JavaScript. +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -##### Sample code +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure TrafficManagerManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new TrafficManagerManagementClient(creds, subscriptionId); -const resourceGroupName = "testresourceGroupName"; -const profileName = "testprofileName"; -const endpointType = "testendpointType"; -const endpointName = "testendpointName"; -client.endpoints.get(resourceGroupName, profileName, endpointType, endpointName).then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new TrafficManagerManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and get endpoints as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-trafficmanager sample - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### TrafficManagerManagementClient + +`TrafficManagerManagementClient` is the primary interface for developers using the Azure TrafficManagerManagement client library. Explore the methods on this client object to understand the different features of the Azure TrafficManagerManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ftrafficmanager%2Farm-trafficmanager%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/trafficmanager/arm-trafficmanager/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/trafficmanager/arm-trafficmanager/_meta.json b/sdk/trafficmanager/arm-trafficmanager/_meta.json new file mode 100644 index 000000000000..4b817929e9bf --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "readme": "specification/trafficmanager/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/trafficmanager/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1 --generate-sample=true", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" +} \ No newline at end of file diff --git a/sdk/trafficmanager/arm-trafficmanager/api-extractor.json b/sdk/trafficmanager/arm-trafficmanager/api-extractor.json new file mode 100644 index 000000000000..25d68fac86b4 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-trafficmanager.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/trafficmanager/arm-trafficmanager/package.json b/sdk/trafficmanager/arm-trafficmanager/package.json index 41b4ac47a42a..f6e7497db6f6 100644 --- a/sdk/trafficmanager/arm-trafficmanager/package.json +++ b/sdk/trafficmanager/arm-trafficmanager/package.json @@ -1,59 +1,104 @@ { "name": "@azure/arm-trafficmanager", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "TrafficManagerManagementClient Library with typescript type definitions for node.js and browser.", - "version": "5.1.0", + "description": "A generated SDK for TrafficManagerManagementClient.", + "version": "6.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-trafficmanager.js", - "module": "./esm/trafficManagerManagementClient.js", - "types": "./esm/trafficManagerManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-trafficmanager.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/trafficmanager/arm-trafficmanager", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-trafficmanager.js.map'\" -o ./dist/arm-trafficmanager.min.js ./dist/arm-trafficmanager.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, - "autoPublish": true + "//metadata": { + "constantPaths": [ + { + "path": "src/TrafficManagerManagementClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "//sampleConfiguration": { + "productName": "", + "productSlugs": ["azure"], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-trafficmanager?view=azure-node-preview" + } } diff --git a/sdk/trafficmanager/arm-trafficmanager/recordings/node/my_test/recording_sample_test.js b/sdk/trafficmanager/arm-trafficmanager/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/trafficmanager/arm-trafficmanager/review/arm-trafficmanager.api.md b/sdk/trafficmanager/arm-trafficmanager/review/arm-trafficmanager.api.md new file mode 100644 index 000000000000..5b21e372812f --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/review/arm-trafficmanager.api.md @@ -0,0 +1,486 @@ +## API Report File for "@azure/arm-trafficmanager" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; + +// @public +export type AllowedEndpointRecordType = string; + +// @public +export interface CheckTrafficManagerRelativeDnsNameAvailabilityParameters { + name?: string; + type?: string; +} + +// @public +export interface CloudError { + error?: CloudErrorBody; +} + +// @public +export interface CloudErrorBody { + code?: string; + details?: CloudErrorBody[]; + message?: string; + target?: string; +} + +// @public +export interface DeleteOperationResult { + readonly operationResult?: boolean; +} + +// @public +export interface DnsConfig { + readonly fqdn?: string; + relativeName?: string; + ttl?: number; +} + +// @public +export type Endpoint = ProxyResource & { + targetResourceId?: string; + target?: string; + endpointStatus?: EndpointStatus; + weight?: number; + priority?: number; + endpointLocation?: string; + endpointMonitorStatus?: EndpointMonitorStatus; + minChildEndpoints?: number; + minChildEndpointsIPv4?: number; + minChildEndpointsIPv6?: number; + geoMapping?: string[]; + subnets?: EndpointPropertiesSubnetsItem[]; + customHeaders?: EndpointPropertiesCustomHeadersItem[]; +}; + +// @public +export type EndpointMonitorStatus = string; + +// @public +export interface EndpointPropertiesCustomHeadersItem { + name?: string; + value?: string; +} + +// @public +export interface EndpointPropertiesSubnetsItem { + first?: string; + last?: string; + scope?: number; +} + +// @public +export interface Endpoints { + createOrUpdate(resourceGroupName: string, profileName: string, endpointType: EndpointType, endpointName: string, parameters: Endpoint, options?: EndpointsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, profileName: string, endpointType: EndpointType, endpointName: string, options?: EndpointsDeleteOptionalParams): Promise; + get(resourceGroupName: string, profileName: string, endpointType: EndpointType, endpointName: string, options?: EndpointsGetOptionalParams): Promise; + update(resourceGroupName: string, profileName: string, endpointType: EndpointType, endpointName: string, parameters: Endpoint, options?: EndpointsUpdateOptionalParams): Promise; +} + +// @public +export interface EndpointsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EndpointsCreateOrUpdateResponse = Endpoint; + +// @public +export interface EndpointsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EndpointsDeleteResponse = DeleteOperationResult; + +// @public +export interface EndpointsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EndpointsGetResponse = Endpoint; + +// @public +export type EndpointStatus = string; + +// @public +export interface EndpointsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EndpointsUpdateResponse = Endpoint; + +// @public +export type EndpointType = "AzureEndpoints" | "ExternalEndpoints" | "NestedEndpoints"; + +// @public +export interface GeographicHierarchies { + getDefault(options?: GeographicHierarchiesGetDefaultOptionalParams): Promise; +} + +// @public +export interface GeographicHierarchiesGetDefaultOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GeographicHierarchiesGetDefaultResponse = TrafficManagerGeographicHierarchy; + +// @public +export interface HeatMap { + get(resourceGroupName: string, profileName: string, options?: HeatMapGetOptionalParams): Promise; +} + +// @public +export interface HeatMapEndpoint { + endpointId?: number; + resourceId?: string; +} + +// @public +export interface HeatMapGetOptionalParams extends coreClient.OperationOptions { + botRight?: number[]; + topLeft?: number[]; +} + +// @public +export type HeatMapGetResponse = HeatMapModel; + +// @public +export type HeatMapModel = ProxyResource & { + startTime?: Date; + endTime?: Date; + endpoints?: HeatMapEndpoint[]; + trafficFlows?: TrafficFlow[]; +}; + +// @public +export enum KnownAllowedEndpointRecordType { + // (undocumented) + Any = "Any", + // (undocumented) + DomainName = "DomainName", + // (undocumented) + IPv4Address = "IPv4Address", + // (undocumented) + IPv6Address = "IPv6Address" +} + +// @public +export enum KnownEndpointMonitorStatus { + // (undocumented) + CheckingEndpoint = "CheckingEndpoint", + // (undocumented) + Degraded = "Degraded", + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Inactive = "Inactive", + // (undocumented) + Online = "Online", + // (undocumented) + Stopped = "Stopped" +} + +// @public +export enum KnownEndpointStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownMonitorProtocol { + // (undocumented) + Http = "HTTP", + // (undocumented) + Https = "HTTPS", + // (undocumented) + TCP = "TCP" +} + +// @public +export enum KnownProfileMonitorStatus { + // (undocumented) + CheckingEndpoints = "CheckingEndpoints", + // (undocumented) + Degraded = "Degraded", + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Inactive = "Inactive", + // (undocumented) + Online = "Online" +} + +// @public +export enum KnownProfileStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownTrafficRoutingMethod { + // (undocumented) + Geographic = "Geographic", + // (undocumented) + MultiValue = "MultiValue", + // (undocumented) + Performance = "Performance", + // (undocumented) + Priority = "Priority", + // (undocumented) + Subnet = "Subnet", + // (undocumented) + Weighted = "Weighted" +} + +// @public +export enum KnownTrafficViewEnrollmentStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export interface MonitorConfig { + customHeaders?: MonitorConfigCustomHeadersItem[]; + expectedStatusCodeRanges?: MonitorConfigExpectedStatusCodeRangesItem[]; + intervalInSeconds?: number; + path?: string; + port?: number; + profileMonitorStatus?: ProfileMonitorStatus; + protocol?: MonitorProtocol; + timeoutInSeconds?: number; + toleratedNumberOfFailures?: number; +} + +// @public +export interface MonitorConfigCustomHeadersItem { + name?: string; + value?: string; +} + +// @public +export interface MonitorConfigExpectedStatusCodeRangesItem { + max?: number; + min?: number; +} + +// @public +export type MonitorProtocol = string; + +// @public +export type Profile = TrackedResource & { + profileStatus?: ProfileStatus; + trafficRoutingMethod?: TrafficRoutingMethod; + dnsConfig?: DnsConfig; + monitorConfig?: MonitorConfig; + endpoints?: Endpoint[]; + trafficViewEnrollmentStatus?: TrafficViewEnrollmentStatus; + allowedEndpointRecordTypes?: AllowedEndpointRecordType[]; + maxReturn?: number; +}; + +// @public +export interface ProfileListResult { + value?: Profile[]; +} + +// @public +export type ProfileMonitorStatus = string; + +// @public +export interface Profiles { + checkTrafficManagerRelativeDnsNameAvailability(parameters: CheckTrafficManagerRelativeDnsNameAvailabilityParameters, options?: ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, profileName: string, parameters: Profile, options?: ProfilesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, profileName: string, options?: ProfilesDeleteOptionalParams): Promise; + get(resourceGroupName: string, profileName: string, options?: ProfilesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ProfilesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ProfilesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, profileName: string, parameters: Profile, options?: ProfilesUpdateOptionalParams): Promise; +} + +// @public +export interface ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityResponse = TrafficManagerNameAvailability; + +// @public +export interface ProfilesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProfilesCreateOrUpdateResponse = Profile; + +// @public +export interface ProfilesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProfilesDeleteResponse = DeleteOperationResult; + +// @public +export interface ProfilesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProfilesGetResponse = Profile; + +// @public +export interface ProfilesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProfilesListByResourceGroupResponse = ProfileListResult; + +// @public +export interface ProfilesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProfilesListBySubscriptionResponse = ProfileListResult; + +// @public +export type ProfileStatus = string; + +// @public +export interface ProfilesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProfilesUpdateResponse = Profile; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export interface QueryExperience { + endpointId: number; + latency?: number; + queryCount: number; +} + +// @public +export interface Region { + code?: string; + name?: string; + regions?: Region[]; +} + +// @public +export interface Resource { + id?: string; + name?: string; + type?: string; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location?: string; +}; + +// @public +export interface TrafficFlow { + latitude?: number; + longitude?: number; + queryExperiences?: QueryExperience[]; + sourceIp?: string; +} + +// @public +export type TrafficManagerGeographicHierarchy = ProxyResource & { + geographicHierarchy?: Region; +}; + +// @public (undocumented) +export class TrafficManagerManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: TrafficManagerManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + endpoints: Endpoints; + // (undocumented) + geographicHierarchies: GeographicHierarchies; + // (undocumented) + heatMap: HeatMap; + // (undocumented) + profiles: Profiles; + // (undocumented) + subscriptionId: string; + // (undocumented) + trafficManagerUserMetricsKeys: TrafficManagerUserMetricsKeys; +} + +// @public +export interface TrafficManagerManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface TrafficManagerNameAvailability { + message?: string; + name?: string; + nameAvailable?: boolean; + reason?: string; + type?: string; +} + +// @public +export interface TrafficManagerUserMetricsKeys { + createOrUpdate(options?: TrafficManagerUserMetricsKeysCreateOrUpdateOptionalParams): Promise; + delete(options?: TrafficManagerUserMetricsKeysDeleteOptionalParams): Promise; + get(options?: TrafficManagerUserMetricsKeysGetOptionalParams): Promise; +} + +// @public +export interface TrafficManagerUserMetricsKeysCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TrafficManagerUserMetricsKeysCreateOrUpdateResponse = UserMetricsModel; + +// @public +export interface TrafficManagerUserMetricsKeysDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TrafficManagerUserMetricsKeysDeleteResponse = DeleteOperationResult; + +// @public +export interface TrafficManagerUserMetricsKeysGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TrafficManagerUserMetricsKeysGetResponse = UserMetricsModel; + +// @public +export type TrafficRoutingMethod = string; + +// @public +export type TrafficViewEnrollmentStatus = string; + +// @public +export type UserMetricsModel = ProxyResource & { + key?: string; +}; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/trafficmanager/arm-trafficmanager/rollup.config.js b/sdk/trafficmanager/arm-trafficmanager/rollup.config.js index 164228bd9fad..9be1955eb7f1 100644 --- a/sdk/trafficmanager/arm-trafficmanager/rollup.config.js +++ b/sdk/trafficmanager/arm-trafficmanager/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; -import sourcemaps from "rollup-plugin-sourcemaps"; - -/** - * @type {rollup.RollupFileOptions} - */ -const config = { - input: "./esm/trafficManagerManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-trafficmanager.js", - format: "umd", - name: "Azure.ArmTrafficmanager", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" - }, - banner: `/* +/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/trafficmanager/arm-trafficmanager/sample.env b/sdk/trafficmanager/arm-trafficmanager/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointDeleteExternal.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointDeleteExternal.ts new file mode 100644 index 000000000000..0bdaa5a1031e --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointDeleteExternal.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a Traffic Manager endpoint. + * + * @summary Deletes a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-DELETE-External.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointDeleteExternal() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.delete( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointDeleteExternal().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithGeoMapping.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithGeoMapping.ts new file mode 100644 index 000000000000..0600634fca41 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithGeoMapping.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager endpoint. + * + * @summary Gets a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithGeoMapping.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointGetExternalWithGeoMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.get( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointGetExternalWithGeoMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithLocation.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithLocation.ts new file mode 100644 index 000000000000..c283b89ce82e --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithLocation.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager endpoint. + * + * @summary Gets a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithLocation.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointGetExternalWithLocation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.get( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointGetExternalWithLocation().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithSubnetMapping.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithSubnetMapping.ts new file mode 100644 index 000000000000..c7ff78225c90 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointGetExternalWithSubnetMapping.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager endpoint. + * + * @summary Gets a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithSubnetMapping.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointGetExternalWithSubnetMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.get( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointGetExternalWithSubnetMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPatchExternalTarget.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPatchExternalTarget.ts new file mode 100644 index 000000000000..f5d0651456ae --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPatchExternalTarget.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Update a Traffic Manager endpoint. + * + * @summary Update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PATCH-External-Target.json + */ +import { + Endpoint, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointPatchExternalTarget() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const parameters: Endpoint = { + name: "azsmnet7187", + type: "Microsoft.Network/trafficManagerProfiles/externalEndpoints", + id: + "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187", + target: "another.foobar.contoso.com" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.update( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPatchExternalTarget().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithCustomHeaders.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithCustomHeaders.ts new file mode 100644 index 000000000000..d17729c2b9ab --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithCustomHeaders.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithCustomHeaders.json + */ +import { + Endpoint, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointPutExternalWithCustomHeaders() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const parameters: Endpoint = { + name: "azsmnet7187", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + customHeaders: [ + { name: "header-1", value: "value-1" }, + { name: "header-2", value: "value-2" } + ], + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithCustomHeaders().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithGeoMapping.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithGeoMapping.ts new file mode 100644 index 000000000000..66e52f174653 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithGeoMapping.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithGeoMapping.json + */ +import { + Endpoint, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointPutExternalWithGeoMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const parameters: Endpoint = { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointStatus: "Enabled", + geoMapping: ["GEO-AS", "GEO-AF"], + target: "foobar.contoso.com" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithGeoMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithLocation.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithLocation.ts new file mode 100644 index 000000000000..092ae0cd26af --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithLocation.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithLocation.json + */ +import { + Endpoint, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointPutExternalWithLocation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const parameters: Endpoint = { + name: "azsmnet7187", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithLocation().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithSubnetMapping.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithSubnetMapping.ts new file mode 100644 index 000000000000..a4b1dcc2fcc9 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/endpointPutExternalWithSubnetMapping.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithSubnetMapping.json + */ +import { + Endpoint, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointPutExternalWithSubnetMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const parameters: Endpoint = { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointStatus: "Enabled", + subnets: [ + { first: "1.2.3.0", scope: 24 }, + { first: "25.26.27.28", last: "29.30.31.32" } + ], + target: "foobar.contoso.com" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithSubnetMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/geographicHierarchyGetDefault.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/geographicHierarchyGetDefault.ts new file mode 100644 index 000000000000..f4337c6113a6 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/geographicHierarchyGetDefault.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @summary Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/GeographicHierarchy-GET-default.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function geographicHierarchyGetDefault() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.geographicHierarchies.getDefault(); + console.log(result); +} + +geographicHierarchyGetDefault().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGet.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGet.ts new file mode 100644 index 000000000000..435b3d649f24 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGet.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets latest heatmap for Traffic Manager profile. + * + * @summary Gets latest heatmap for Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function heatMapGet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.heatMap.get(resourceGroupName, profileName); + console.log(result); +} + +heatMapGet().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGetWithNullValues.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGetWithNullValues.ts new file mode 100644 index 000000000000..0e3118cc8ca8 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGetWithNullValues.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets latest heatmap for Traffic Manager profile. + * + * @summary Gets latest heatmap for Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET-With-Null-Values.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function heatMapGetWithNullValues() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.heatMap.get(resourceGroupName, profileName); + console.log(result); +} + +heatMapGetWithNullValues().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGetWithTopLeftBotRight.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGetWithTopLeftBotRight.ts new file mode 100644 index 000000000000..41dfbef60a09 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/heatMapGetWithTopLeftBotRight.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets latest heatmap for Traffic Manager profile. + * + * @summary Gets latest heatmap for Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET-With-TopLeft-BotRight.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function heatMapGetWithTopLeftBotRight() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const topLeft = [10, 50.001]; + const botRight = [-50.001, 80]; + const options = { topLeft: topLeft, botRight: botRight }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.heatMap.get( + resourceGroupName, + profileName, + options + ); + console.log(result); +} + +heatMapGetWithTopLeftBotRight().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/listBySubscription.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/listBySubscription.ts new file mode 100644 index 000000000000..db9efcd81c9f --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/listBySubscription.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all Traffic Manager profiles within a subscription. + * + * @summary Lists all Traffic Manager profiles within a subscription. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-BySubscription.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listBySubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.profiles.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listBySubscription().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/listProfilesByResourceGroup.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/listProfilesByResourceGroup.ts new file mode 100644 index 000000000000..7d6dbb063067 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/listProfilesByResourceGroup.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all Traffic Manager profiles within a resource group. + * + * @summary Lists all Traffic Manager profiles within a resource group. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-ByResourceGroup.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listProfilesByResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager3640"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.profiles.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listProfilesByResourceGroup().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/nameAvailabilityTestNameAvailablePost21.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/nameAvailabilityTestNameAvailablePost21.ts new file mode 100644 index 000000000000..7aa3e052ae5c --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/nameAvailabilityTestNameAvailablePost21.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Checks the availability of a Traffic Manager Relative DNS name. + * + * @summary Checks the availability of a Traffic Manager Relative DNS name. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/NameAvailabilityTest_NameAvailable-POST-example-21.json + */ +import { + CheckTrafficManagerRelativeDnsNameAvailabilityParameters, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function nameAvailabilityTestNameAvailablePost21() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const parameters: CheckTrafficManagerRelativeDnsNameAvailabilityParameters = { + name: "azsmnet5403", + type: "microsoft.network/trafficmanagerprofiles" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.checkTrafficManagerRelativeDnsNameAvailability( + parameters + ); + console.log(result); +} + +nameAvailabilityTestNameAvailablePost21().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/nameAvailabilityTestNameNotAvailablePost23.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/nameAvailabilityTestNameNotAvailablePost23.ts new file mode 100644 index 000000000000..f068994acb0b --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/nameAvailabilityTestNameNotAvailablePost23.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Checks the availability of a Traffic Manager Relative DNS name. + * + * @summary Checks the availability of a Traffic Manager Relative DNS name. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/NameAvailabilityTest_NameNotAvailable-POST-example-23.json + */ +import { + CheckTrafficManagerRelativeDnsNameAvailabilityParameters, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function nameAvailabilityTestNameNotAvailablePost23() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const parameters: CheckTrafficManagerRelativeDnsNameAvailabilityParameters = { + name: "azsmnet4696", + type: "microsoft.network/trafficmanagerprofiles" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.checkTrafficManagerRelativeDnsNameAvailability( + parameters + ); + console.log(result); +} + +nameAvailabilityTestNameNotAvailablePost23().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileDelete.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileDelete.ts new file mode 100644 index 000000000000..52d313b7c18e --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileDelete.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a Traffic Manager profile. + * + * @summary Deletes a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-DELETE.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profileDelete() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.delete(resourceGroupName, profileName); + console.log(result); +} + +profileDelete().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithEndpoints.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithEndpoints.ts new file mode 100644 index 000000000000..e25767f7f4cc --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithEndpoints.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager profile. + * + * @summary Gets a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithEndpoints.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profileGetWithEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.get(resourceGroupName, profileName); + console.log(result); +} + +profileGetWithEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithTrafficViewDisabled.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithTrafficViewDisabled.ts new file mode 100644 index 000000000000..a4be8df241d0 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithTrafficViewDisabled.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager profile. + * + * @summary Gets a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithTrafficViewDisabled.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profileGetWithTrafficViewDisabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.get(resourceGroupName, profileName); + console.log(result); +} + +profileGetWithTrafficViewDisabled().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithTrafficViewEnabled.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithTrafficViewEnabled.ts new file mode 100644 index 000000000000..9225a2bb2db7 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profileGetWithTrafficViewEnabled.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager profile. + * + * @summary Gets a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithTrafficViewEnabled.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profileGetWithTrafficViewEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.get(resourceGroupName, profileName); + console.log(result); +} + +profileGetWithTrafficViewEnabled().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePatchMonitorConfig.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePatchMonitorConfig.ts new file mode 100644 index 000000000000..f6252e3dd19e --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePatchMonitorConfig.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Update a Traffic Manager profile. + * + * @summary Update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PATCH-MonitorConfig.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePatchMonitorConfig() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters: Profile = { + monitorConfig: { + path: "/testpath.aspx", + customHeaders: [ + { name: "header-1", value: "value-1" }, + { name: "header-2", value: "value-2" } + ], + intervalInSeconds: 30, + port: 80, + timeoutInSeconds: 6, + toleratedNumberOfFailures: 4, + protocol: "HTTP" + } + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.update( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePatchMonitorConfig().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutMultiValue.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutMultiValue.ts new file mode 100644 index 000000000000..80f900ad17fd --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutMultiValue.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-MultiValue.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutMultiValue() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const parameters: Profile = { + dnsConfig: { relativeName: "azsmnet6386", ttl: 35 }, + location: "global", + maxReturn: 2, + monitorConfig: { path: "/testpath.aspx", port: 80, protocol: "HTTP" }, + profileStatus: "Enabled", + trafficRoutingMethod: "MultiValue", + trafficViewEnrollmentStatus: "Disabled" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutMultiValue().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutNoEndpoints.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutNoEndpoints.ts new file mode 100644 index 000000000000..82743c46499c --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutNoEndpoints.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-NoEndpoints.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutNoEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const parameters: Profile = { + dnsConfig: { relativeName: "azsmnet6386", ttl: 35 }, + location: "global", + monitorConfig: { path: "/testpath.aspx", port: 80, protocol: "HTTP" }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutNoEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithAliasing.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithAliasing.ts new file mode 100644 index 000000000000..11d49cc3ab25 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithAliasing.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithAliasing.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutWithAliasing() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters: Profile = { + allowedEndpointRecordTypes: ["DomainName"], + dnsConfig: { + relativeName: "azuresdkfornetautoresttrafficmanager6192", + ttl: 35 + }, + endpoints: [ + { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com" + } + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP" + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutWithAliasing().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithCustomHeaders.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithCustomHeaders.ts new file mode 100644 index 000000000000..4256963cd135 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithCustomHeaders.ts @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithCustomHeaders.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutWithCustomHeaders() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters: Profile = { + dnsConfig: { + relativeName: "azuresdkfornetautoresttrafficmanager6192", + ttl: 35 + }, + endpoints: [ + { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + customHeaders: [{ name: "header-2", value: "value-2-overridden" }], + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com" + } + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + customHeaders: [ + { name: "header-1", value: "value-1" }, + { name: "header-2", value: "value-2" } + ], + expectedStatusCodeRanges: [ + { max: 205, min: 200 }, + { max: 410, min: 400 } + ], + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP" + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance", + trafficViewEnrollmentStatus: "Disabled" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutWithCustomHeaders().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithEndpoints.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithEndpoints.ts new file mode 100644 index 000000000000..effad6abd74b --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithEndpoints.ts @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithEndpoints.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutWithEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters: Profile = { + dnsConfig: { + relativeName: "azuresdkfornetautoresttrafficmanager6192", + ttl: 35 + }, + endpoints: [ + { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com" + } + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP" + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutWithEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithNestedEndpoints.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithNestedEndpoints.ts new file mode 100644 index 000000000000..53d7e20c75fa --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/profilePutWithNestedEndpoints.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithNestedEndpoints.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutWithNestedEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myresourcegroup"; + const profileName = "parentprofile"; + const parameters: Profile = { + dnsConfig: { relativeName: "parentprofile", ttl: 35 }, + endpoints: [ + { + name: "MyFirstNestedEndpoint", + type: "Microsoft.Network/trafficManagerProfiles/nestedEndpoints", + endpointStatus: "Enabled", + minChildEndpoints: 2, + minChildEndpointsIPv4: 1, + minChildEndpointsIPv6: 2, + priority: 1, + target: "firstnestedprofile.tmpreview.watmtest.azure-test.net", + weight: 1 + }, + { + name: "MySecondNestedEndpoint", + type: "Microsoft.Network/trafficManagerProfiles/nestedEndpoints", + endpointStatus: "Enabled", + minChildEndpoints: 2, + minChildEndpointsIPv4: 2, + minChildEndpointsIPv6: 1, + priority: 2, + target: "secondnestedprofile.tmpreview.watmtest.azure-test.net", + weight: 1 + } + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP" + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Priority" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutWithNestedEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysDelete.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysDelete.ts new file mode 100644 index 000000000000..a08813838d86 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysDelete.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Delete a subscription-level key used for Real User Metrics collection. + * + * @summary Delete a subscription-level key used for Real User Metrics collection. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-DELETE.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function trafficManagerUserMetricsKeysDelete() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.trafficManagerUserMetricsKeys.delete(); + console.log(result); +} + +trafficManagerUserMetricsKeysDelete().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysGet.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysGet.ts new file mode 100644 index 000000000000..df43ac9f9394 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysGet.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Get the subscription-level key used for Real User Metrics collection. + * + * @summary Get the subscription-level key used for Real User Metrics collection. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-GET.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function trafficManagerUserMetricsKeysGet() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.trafficManagerUserMetricsKeys.get(); + console.log(result); +} + +trafficManagerUserMetricsKeysGet().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysPut.ts b/sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysPut.ts new file mode 100644 index 000000000000..68ce54729af5 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples-dev/trafficManagerUserMetricsKeysPut.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a subscription-level key used for Real User Metrics collection. + * + * @summary Create or update a subscription-level key used for Real User Metrics collection. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-PUT.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function trafficManagerUserMetricsKeysPut() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.trafficManagerUserMetricsKeys.createOrUpdate(); + console.log(result); +} + +trafficManagerUserMetricsKeysPut().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/README.md b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/README.md new file mode 100644 index 000000000000..490573659002 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/README.md @@ -0,0 +1,110 @@ +# client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [endpointDeleteExternal.js][endpointdeleteexternal] | Deletes a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-DELETE-External.json | +| [endpointGetExternalWithGeoMapping.js][endpointgetexternalwithgeomapping] | Gets a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithGeoMapping.json | +| [endpointGetExternalWithLocation.js][endpointgetexternalwithlocation] | Gets a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithLocation.json | +| [endpointGetExternalWithSubnetMapping.js][endpointgetexternalwithsubnetmapping] | Gets a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithSubnetMapping.json | +| [endpointPatchExternalTarget.js][endpointpatchexternaltarget] | Update a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PATCH-External-Target.json | +| [endpointPutExternalWithCustomHeaders.js][endpointputexternalwithcustomheaders] | Create or update a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithCustomHeaders.json | +| [endpointPutExternalWithGeoMapping.js][endpointputexternalwithgeomapping] | Create or update a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithGeoMapping.json | +| [endpointPutExternalWithLocation.js][endpointputexternalwithlocation] | Create or update a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithLocation.json | +| [endpointPutExternalWithSubnetMapping.js][endpointputexternalwithsubnetmapping] | Create or update a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithSubnetMapping.json | +| [geographicHierarchyGetDefault.js][geographichierarchygetdefault] | Gets the default Geographic Hierarchy used by the Geographic traffic routing method. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/GeographicHierarchy-GET-default.json | +| [heatMapGet.js][heatmapget] | Gets latest heatmap for Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET.json | +| [heatMapGetWithNullValues.js][heatmapgetwithnullvalues] | Gets latest heatmap for Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET-With-Null-Values.json | +| [heatMapGetWithTopLeftBotRight.js][heatmapgetwithtopleftbotright] | Gets latest heatmap for Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET-With-TopLeft-BotRight.json | +| [listBySubscription.js][listbysubscription] | Lists all Traffic Manager profiles within a subscription. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-BySubscription.json | +| [listProfilesByResourceGroup.js][listprofilesbyresourcegroup] | Lists all Traffic Manager profiles within a resource group. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-ByResourceGroup.json | +| [nameAvailabilityTestNameAvailablePost21.js][nameavailabilitytestnameavailablepost21] | Checks the availability of a Traffic Manager Relative DNS name. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/NameAvailabilityTest_NameAvailable-POST-example-21.json | +| [nameAvailabilityTestNameNotAvailablePost23.js][nameavailabilitytestnamenotavailablepost23] | Checks the availability of a Traffic Manager Relative DNS name. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/NameAvailabilityTest_NameNotAvailable-POST-example-23.json | +| [profileDelete.js][profiledelete] | Deletes a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-DELETE.json | +| [profileGetWithEndpoints.js][profilegetwithendpoints] | Gets a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithEndpoints.json | +| [profileGetWithTrafficViewDisabled.js][profilegetwithtrafficviewdisabled] | Gets a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithTrafficViewDisabled.json | +| [profileGetWithTrafficViewEnabled.js][profilegetwithtrafficviewenabled] | Gets a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithTrafficViewEnabled.json | +| [profilePatchMonitorConfig.js][profilepatchmonitorconfig] | Update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PATCH-MonitorConfig.json | +| [profilePutMultiValue.js][profileputmultivalue] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-MultiValue.json | +| [profilePutNoEndpoints.js][profileputnoendpoints] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-NoEndpoints.json | +| [profilePutWithAliasing.js][profileputwithaliasing] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithAliasing.json | +| [profilePutWithCustomHeaders.js][profileputwithcustomheaders] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithCustomHeaders.json | +| [profilePutWithEndpoints.js][profileputwithendpoints] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithEndpoints.json | +| [profilePutWithNestedEndpoints.js][profileputwithnestedendpoints] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithNestedEndpoints.json | +| [trafficManagerUserMetricsKeysDelete.js][trafficmanagerusermetricskeysdelete] | Delete a subscription-level key used for Real User Metrics collection. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-DELETE.json | +| [trafficManagerUserMetricsKeysGet.js][trafficmanagerusermetricskeysget] | Get the subscription-level key used for Real User Metrics collection. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-GET.json | +| [trafficManagerUserMetricsKeysPut.js][trafficmanagerusermetricskeysput] | Create or update a subscription-level key used for Real User Metrics collection. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-PUT.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node endpointDeleteExternal.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node endpointDeleteExternal.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[endpointdeleteexternal]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointDeleteExternal.js +[endpointgetexternalwithgeomapping]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithGeoMapping.js +[endpointgetexternalwithlocation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithLocation.js +[endpointgetexternalwithsubnetmapping]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithSubnetMapping.js +[endpointpatchexternaltarget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPatchExternalTarget.js +[endpointputexternalwithcustomheaders]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithCustomHeaders.js +[endpointputexternalwithgeomapping]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithGeoMapping.js +[endpointputexternalwithlocation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithLocation.js +[endpointputexternalwithsubnetmapping]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithSubnetMapping.js +[geographichierarchygetdefault]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/geographicHierarchyGetDefault.js +[heatmapget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGet.js +[heatmapgetwithnullvalues]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGetWithNullValues.js +[heatmapgetwithtopleftbotright]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGetWithTopLeftBotRight.js +[listbysubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/listBySubscription.js +[listprofilesbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/listProfilesByResourceGroup.js +[nameavailabilitytestnameavailablepost21]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/nameAvailabilityTestNameAvailablePost21.js +[nameavailabilitytestnamenotavailablepost23]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/nameAvailabilityTestNameNotAvailablePost23.js +[profiledelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileDelete.js +[profilegetwithendpoints]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithEndpoints.js +[profilegetwithtrafficviewdisabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithTrafficViewDisabled.js +[profilegetwithtrafficviewenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithTrafficViewEnabled.js +[profilepatchmonitorconfig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePatchMonitorConfig.js +[profileputmultivalue]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutMultiValue.js +[profileputnoendpoints]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutNoEndpoints.js +[profileputwithaliasing]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithAliasing.js +[profileputwithcustomheaders]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithCustomHeaders.js +[profileputwithendpoints]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithEndpoints.js +[profileputwithnestedendpoints]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithNestedEndpoints.js +[trafficmanagerusermetricskeysdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysDelete.js +[trafficmanagerusermetricskeysget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysGet.js +[trafficmanagerusermetricskeysput]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysPut.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-trafficmanager?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/trafficmanager/arm-trafficmanager/README.md diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointDeleteExternal.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointDeleteExternal.js new file mode 100644 index 000000000000..cda61268b404 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointDeleteExternal.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a Traffic Manager endpoint. + * + * @summary Deletes a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-DELETE-External.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function endpointDeleteExternal() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.delete( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointDeleteExternal().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithGeoMapping.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithGeoMapping.js new file mode 100644 index 000000000000..bfef5ed50da0 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithGeoMapping.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager endpoint. + * + * @summary Gets a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithGeoMapping.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function endpointGetExternalWithGeoMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.get( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointGetExternalWithGeoMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithLocation.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithLocation.js new file mode 100644 index 000000000000..6e8037d89142 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithLocation.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager endpoint. + * + * @summary Gets a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithLocation.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function endpointGetExternalWithLocation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.get( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointGetExternalWithLocation().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithSubnetMapping.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithSubnetMapping.js new file mode 100644 index 000000000000..3f92e2aa1d4c --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointGetExternalWithSubnetMapping.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager endpoint. + * + * @summary Gets a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithSubnetMapping.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function endpointGetExternalWithSubnetMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.get( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointGetExternalWithSubnetMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPatchExternalTarget.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPatchExternalTarget.js new file mode 100644 index 000000000000..468383c27fb1 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPatchExternalTarget.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Update a Traffic Manager endpoint. + * + * @summary Update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PATCH-External-Target.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function endpointPatchExternalTarget() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const parameters = { + name: "azsmnet7187", + type: "Microsoft.Network/trafficManagerProfiles/externalEndpoints", + id: "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187", + target: "another.foobar.contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.update( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPatchExternalTarget().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithCustomHeaders.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithCustomHeaders.js new file mode 100644 index 000000000000..6f177c6b0782 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithCustomHeaders.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithCustomHeaders.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function endpointPutExternalWithCustomHeaders() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const parameters = { + name: "azsmnet7187", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + customHeaders: [ + { name: "header-1", value: "value-1" }, + { name: "header-2", value: "value-2" }, + ], + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithCustomHeaders().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithGeoMapping.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithGeoMapping.js new file mode 100644 index 000000000000..7da77c302b6c --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithGeoMapping.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithGeoMapping.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function endpointPutExternalWithGeoMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const parameters = { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointStatus: "Enabled", + geoMapping: ["GEO-AS", "GEO-AF"], + target: "foobar.contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithGeoMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithLocation.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithLocation.js new file mode 100644 index 000000000000..45ac8b2e02f7 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithLocation.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithLocation.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function endpointPutExternalWithLocation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const parameters = { + name: "azsmnet7187", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithLocation().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithSubnetMapping.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithSubnetMapping.js new file mode 100644 index 000000000000..3cefc10f0f70 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/endpointPutExternalWithSubnetMapping.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithSubnetMapping.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function endpointPutExternalWithSubnetMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const parameters = { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointStatus: "Enabled", + subnets: [ + { first: "1.2.3.0", scope: 24 }, + { first: "25.26.27.28", last: "29.30.31.32" }, + ], + target: "foobar.contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithSubnetMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/geographicHierarchyGetDefault.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/geographicHierarchyGetDefault.js new file mode 100644 index 000000000000..b64542d59cad --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/geographicHierarchyGetDefault.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @summary Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/GeographicHierarchy-GET-default.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function geographicHierarchyGetDefault() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.geographicHierarchies.getDefault(); + console.log(result); +} + +geographicHierarchyGetDefault().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGet.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGet.js new file mode 100644 index 000000000000..62cf4db9e6f6 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGet.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets latest heatmap for Traffic Manager profile. + * + * @summary Gets latest heatmap for Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function heatMapGet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.heatMap.get(resourceGroupName, profileName); + console.log(result); +} + +heatMapGet().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGetWithNullValues.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGetWithNullValues.js new file mode 100644 index 000000000000..1643368d3458 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGetWithNullValues.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets latest heatmap for Traffic Manager profile. + * + * @summary Gets latest heatmap for Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET-With-Null-Values.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function heatMapGetWithNullValues() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.heatMap.get(resourceGroupName, profileName); + console.log(result); +} + +heatMapGetWithNullValues().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGetWithTopLeftBotRight.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGetWithTopLeftBotRight.js new file mode 100644 index 000000000000..89d7e1b5e475 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/heatMapGetWithTopLeftBotRight.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets latest heatmap for Traffic Manager profile. + * + * @summary Gets latest heatmap for Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET-With-TopLeft-BotRight.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function heatMapGetWithTopLeftBotRight() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const topLeft = [10, 50.001]; + const botRight = [-50.001, 80]; + const options = { topLeft: topLeft, botRight: botRight }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.heatMap.get(resourceGroupName, profileName, options); + console.log(result); +} + +heatMapGetWithTopLeftBotRight().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/listBySubscription.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/listBySubscription.js new file mode 100644 index 000000000000..801415c6b548 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/listBySubscription.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all Traffic Manager profiles within a subscription. + * + * @summary Lists all Traffic Manager profiles within a subscription. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-BySubscription.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listBySubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.profiles.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listBySubscription().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/listProfilesByResourceGroup.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/listProfilesByResourceGroup.js new file mode 100644 index 000000000000..34f799ed28a5 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/listProfilesByResourceGroup.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all Traffic Manager profiles within a resource group. + * + * @summary Lists all Traffic Manager profiles within a resource group. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-ByResourceGroup.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listProfilesByResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager3640"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.profiles.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listProfilesByResourceGroup().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/nameAvailabilityTestNameAvailablePost21.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/nameAvailabilityTestNameAvailablePost21.js new file mode 100644 index 000000000000..392034c487c8 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/nameAvailabilityTestNameAvailablePost21.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Checks the availability of a Traffic Manager Relative DNS name. + * + * @summary Checks the availability of a Traffic Manager Relative DNS name. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/NameAvailabilityTest_NameAvailable-POST-example-21.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function nameAvailabilityTestNameAvailablePost21() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const parameters = { + name: "azsmnet5403", + type: "microsoft.network/trafficmanagerprofiles", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.checkTrafficManagerRelativeDnsNameAvailability(parameters); + console.log(result); +} + +nameAvailabilityTestNameAvailablePost21().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/nameAvailabilityTestNameNotAvailablePost23.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/nameAvailabilityTestNameNotAvailablePost23.js new file mode 100644 index 000000000000..18d5176acb73 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/nameAvailabilityTestNameNotAvailablePost23.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Checks the availability of a Traffic Manager Relative DNS name. + * + * @summary Checks the availability of a Traffic Manager Relative DNS name. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/NameAvailabilityTest_NameNotAvailable-POST-example-23.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function nameAvailabilityTestNameNotAvailablePost23() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const parameters = { + name: "azsmnet4696", + type: "microsoft.network/trafficmanagerprofiles", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.checkTrafficManagerRelativeDnsNameAvailability(parameters); + console.log(result); +} + +nameAvailabilityTestNameNotAvailablePost23().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/package.json b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/package.json new file mode 100644 index 000000000000..2e0924bd0e33 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "azure-arm-trafficmanager-samples-js", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/trafficmanager/arm-trafficmanager" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/trafficmanager/arm-trafficmanager", + "dependencies": { + "@azure/arm-trafficmanager": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileDelete.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileDelete.js new file mode 100644 index 000000000000..afde0e7ea552 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileDelete.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a Traffic Manager profile. + * + * @summary Deletes a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-DELETE.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function profileDelete() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.delete(resourceGroupName, profileName); + console.log(result); +} + +profileDelete().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithEndpoints.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithEndpoints.js new file mode 100644 index 000000000000..94fbc8b2afbe --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithEndpoints.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager profile. + * + * @summary Gets a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithEndpoints.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function profileGetWithEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.get(resourceGroupName, profileName); + console.log(result); +} + +profileGetWithEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithTrafficViewDisabled.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithTrafficViewDisabled.js new file mode 100644 index 000000000000..d6826f6a7c27 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithTrafficViewDisabled.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager profile. + * + * @summary Gets a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithTrafficViewDisabled.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function profileGetWithTrafficViewDisabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.get(resourceGroupName, profileName); + console.log(result); +} + +profileGetWithTrafficViewDisabled().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithTrafficViewEnabled.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithTrafficViewEnabled.js new file mode 100644 index 000000000000..18ec0f29818a --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profileGetWithTrafficViewEnabled.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager profile. + * + * @summary Gets a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithTrafficViewEnabled.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function profileGetWithTrafficViewEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.get(resourceGroupName, profileName); + console.log(result); +} + +profileGetWithTrafficViewEnabled().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePatchMonitorConfig.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePatchMonitorConfig.js new file mode 100644 index 000000000000..e27c1648833c --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePatchMonitorConfig.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Update a Traffic Manager profile. + * + * @summary Update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PATCH-MonitorConfig.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function profilePatchMonitorConfig() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters = { + monitorConfig: { + path: "/testpath.aspx", + customHeaders: [ + { name: "header-1", value: "value-1" }, + { name: "header-2", value: "value-2" }, + ], + intervalInSeconds: 30, + port: 80, + timeoutInSeconds: 6, + toleratedNumberOfFailures: 4, + protocol: "HTTP", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.update(resourceGroupName, profileName, parameters); + console.log(result); +} + +profilePatchMonitorConfig().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutMultiValue.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutMultiValue.js new file mode 100644 index 000000000000..8a6c178704a9 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutMultiValue.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-MultiValue.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function profilePutMultiValue() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const parameters = { + dnsConfig: { relativeName: "azsmnet6386", ttl: 35 }, + location: "global", + maxReturn: 2, + monitorConfig: { path: "/testpath.aspx", port: 80, protocol: "HTTP" }, + profileStatus: "Enabled", + trafficRoutingMethod: "MultiValue", + trafficViewEnrollmentStatus: "Disabled", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate(resourceGroupName, profileName, parameters); + console.log(result); +} + +profilePutMultiValue().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutNoEndpoints.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutNoEndpoints.js new file mode 100644 index 000000000000..1cab65808246 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutNoEndpoints.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-NoEndpoints.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function profilePutNoEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const parameters = { + dnsConfig: { relativeName: "azsmnet6386", ttl: 35 }, + location: "global", + monitorConfig: { path: "/testpath.aspx", port: 80, protocol: "HTTP" }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate(resourceGroupName, profileName, parameters); + console.log(result); +} + +profilePutNoEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithAliasing.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithAliasing.js new file mode 100644 index 000000000000..dd4798fb2104 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithAliasing.js @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithAliasing.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function profilePutWithAliasing() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters = { + allowedEndpointRecordTypes: ["DomainName"], + dnsConfig: { + relativeName: "azuresdkfornetautoresttrafficmanager6192", + ttl: 35, + }, + endpoints: [ + { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com", + }, + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP", + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate(resourceGroupName, profileName, parameters); + console.log(result); +} + +profilePutWithAliasing().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithCustomHeaders.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithCustomHeaders.js new file mode 100644 index 000000000000..5dda7f31afdf --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithCustomHeaders.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithCustomHeaders.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function profilePutWithCustomHeaders() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters = { + dnsConfig: { + relativeName: "azuresdkfornetautoresttrafficmanager6192", + ttl: 35, + }, + endpoints: [ + { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + customHeaders: [{ name: "header-2", value: "value-2-overridden" }], + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com", + }, + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + customHeaders: [ + { name: "header-1", value: "value-1" }, + { name: "header-2", value: "value-2" }, + ], + expectedStatusCodeRanges: [ + { max: 205, min: 200 }, + { max: 410, min: 400 }, + ], + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP", + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance", + trafficViewEnrollmentStatus: "Disabled", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate(resourceGroupName, profileName, parameters); + console.log(result); +} + +profilePutWithCustomHeaders().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithEndpoints.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithEndpoints.js new file mode 100644 index 000000000000..6ceaebecf8e2 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithEndpoints.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithEndpoints.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function profilePutWithEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters = { + dnsConfig: { + relativeName: "azuresdkfornetautoresttrafficmanager6192", + ttl: 35, + }, + endpoints: [ + { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com", + }, + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP", + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate(resourceGroupName, profileName, parameters); + console.log(result); +} + +profilePutWithEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithNestedEndpoints.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithNestedEndpoints.js new file mode 100644 index 000000000000..3a4d440a4add --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/profilePutWithNestedEndpoints.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithNestedEndpoints.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function profilePutWithNestedEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myresourcegroup"; + const profileName = "parentprofile"; + const parameters = { + dnsConfig: { relativeName: "parentprofile", ttl: 35 }, + endpoints: [ + { + name: "MyFirstNestedEndpoint", + type: "Microsoft.Network/trafficManagerProfiles/nestedEndpoints", + endpointStatus: "Enabled", + minChildEndpoints: 2, + minChildEndpointsIPv4: 1, + minChildEndpointsIPv6: 2, + priority: 1, + target: "firstnestedprofile.tmpreview.watmtest.azure-test.net", + weight: 1, + }, + { + name: "MySecondNestedEndpoint", + type: "Microsoft.Network/trafficManagerProfiles/nestedEndpoints", + endpointStatus: "Enabled", + minChildEndpoints: 2, + minChildEndpointsIPv4: 2, + minChildEndpointsIPv6: 1, + priority: 2, + target: "secondnestedprofile.tmpreview.watmtest.azure-test.net", + weight: 1, + }, + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP", + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Priority", + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate(resourceGroupName, profileName, parameters); + console.log(result); +} + +profilePutWithNestedEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/sample.env b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysDelete.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysDelete.js new file mode 100644 index 000000000000..bb5e0a1b8885 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysDelete.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Delete a subscription-level key used for Real User Metrics collection. + * + * @summary Delete a subscription-level key used for Real User Metrics collection. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-DELETE.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function trafficManagerUserMetricsKeysDelete() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.trafficManagerUserMetricsKeys.delete(); + console.log(result); +} + +trafficManagerUserMetricsKeysDelete().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysGet.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysGet.js new file mode 100644 index 000000000000..aaa4dadc6238 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysGet.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Get the subscription-level key used for Real User Metrics collection. + * + * @summary Get the subscription-level key used for Real User Metrics collection. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-GET.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function trafficManagerUserMetricsKeysGet() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.trafficManagerUserMetricsKeys.get(); + console.log(result); +} + +trafficManagerUserMetricsKeysGet().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysPut.js b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysPut.js new file mode 100644 index 000000000000..5e34c3e58c33 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/javascript/trafficManagerUserMetricsKeysPut.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a subscription-level key used for Real User Metrics collection. + * + * @summary Create or update a subscription-level key used for Real User Metrics collection. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-PUT.json + */ +const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function trafficManagerUserMetricsKeysPut() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.trafficManagerUserMetricsKeys.createOrUpdate(); + console.log(result); +} + +trafficManagerUserMetricsKeysPut().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/README.md b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/README.md new file mode 100644 index 000000000000..e6b8ad8a21cf --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/README.md @@ -0,0 +1,123 @@ +# client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [endpointDeleteExternal.ts][endpointdeleteexternal] | Deletes a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-DELETE-External.json | +| [endpointGetExternalWithGeoMapping.ts][endpointgetexternalwithgeomapping] | Gets a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithGeoMapping.json | +| [endpointGetExternalWithLocation.ts][endpointgetexternalwithlocation] | Gets a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithLocation.json | +| [endpointGetExternalWithSubnetMapping.ts][endpointgetexternalwithsubnetmapping] | Gets a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithSubnetMapping.json | +| [endpointPatchExternalTarget.ts][endpointpatchexternaltarget] | Update a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PATCH-External-Target.json | +| [endpointPutExternalWithCustomHeaders.ts][endpointputexternalwithcustomheaders] | Create or update a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithCustomHeaders.json | +| [endpointPutExternalWithGeoMapping.ts][endpointputexternalwithgeomapping] | Create or update a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithGeoMapping.json | +| [endpointPutExternalWithLocation.ts][endpointputexternalwithlocation] | Create or update a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithLocation.json | +| [endpointPutExternalWithSubnetMapping.ts][endpointputexternalwithsubnetmapping] | Create or update a Traffic Manager endpoint. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithSubnetMapping.json | +| [geographicHierarchyGetDefault.ts][geographichierarchygetdefault] | Gets the default Geographic Hierarchy used by the Geographic traffic routing method. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/GeographicHierarchy-GET-default.json | +| [heatMapGet.ts][heatmapget] | Gets latest heatmap for Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET.json | +| [heatMapGetWithNullValues.ts][heatmapgetwithnullvalues] | Gets latest heatmap for Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET-With-Null-Values.json | +| [heatMapGetWithTopLeftBotRight.ts][heatmapgetwithtopleftbotright] | Gets latest heatmap for Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET-With-TopLeft-BotRight.json | +| [listBySubscription.ts][listbysubscription] | Lists all Traffic Manager profiles within a subscription. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-BySubscription.json | +| [listProfilesByResourceGroup.ts][listprofilesbyresourcegroup] | Lists all Traffic Manager profiles within a resource group. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-ByResourceGroup.json | +| [nameAvailabilityTestNameAvailablePost21.ts][nameavailabilitytestnameavailablepost21] | Checks the availability of a Traffic Manager Relative DNS name. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/NameAvailabilityTest_NameAvailable-POST-example-21.json | +| [nameAvailabilityTestNameNotAvailablePost23.ts][nameavailabilitytestnamenotavailablepost23] | Checks the availability of a Traffic Manager Relative DNS name. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/NameAvailabilityTest_NameNotAvailable-POST-example-23.json | +| [profileDelete.ts][profiledelete] | Deletes a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-DELETE.json | +| [profileGetWithEndpoints.ts][profilegetwithendpoints] | Gets a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithEndpoints.json | +| [profileGetWithTrafficViewDisabled.ts][profilegetwithtrafficviewdisabled] | Gets a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithTrafficViewDisabled.json | +| [profileGetWithTrafficViewEnabled.ts][profilegetwithtrafficviewenabled] | Gets a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithTrafficViewEnabled.json | +| [profilePatchMonitorConfig.ts][profilepatchmonitorconfig] | Update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PATCH-MonitorConfig.json | +| [profilePutMultiValue.ts][profileputmultivalue] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-MultiValue.json | +| [profilePutNoEndpoints.ts][profileputnoendpoints] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-NoEndpoints.json | +| [profilePutWithAliasing.ts][profileputwithaliasing] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithAliasing.json | +| [profilePutWithCustomHeaders.ts][profileputwithcustomheaders] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithCustomHeaders.json | +| [profilePutWithEndpoints.ts][profileputwithendpoints] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithEndpoints.json | +| [profilePutWithNestedEndpoints.ts][profileputwithnestedendpoints] | Create or update a Traffic Manager profile. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithNestedEndpoints.json | +| [trafficManagerUserMetricsKeysDelete.ts][trafficmanagerusermetricskeysdelete] | Delete a subscription-level key used for Real User Metrics collection. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-DELETE.json | +| [trafficManagerUserMetricsKeysGet.ts][trafficmanagerusermetricskeysget] | Get the subscription-level key used for Real User Metrics collection. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-GET.json | +| [trafficManagerUserMetricsKeysPut.ts][trafficmanagerusermetricskeysput] | Create or update a subscription-level key used for Real User Metrics collection. x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-PUT.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/endpointDeleteExternal.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/endpointDeleteExternal.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[endpointdeleteexternal]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointDeleteExternal.ts +[endpointgetexternalwithgeomapping]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithGeoMapping.ts +[endpointgetexternalwithlocation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithLocation.ts +[endpointgetexternalwithsubnetmapping]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithSubnetMapping.ts +[endpointpatchexternaltarget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPatchExternalTarget.ts +[endpointputexternalwithcustomheaders]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithCustomHeaders.ts +[endpointputexternalwithgeomapping]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithGeoMapping.ts +[endpointputexternalwithlocation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithLocation.ts +[endpointputexternalwithsubnetmapping]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithSubnetMapping.ts +[geographichierarchygetdefault]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/geographicHierarchyGetDefault.ts +[heatmapget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGet.ts +[heatmapgetwithnullvalues]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGetWithNullValues.ts +[heatmapgetwithtopleftbotright]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGetWithTopLeftBotRight.ts +[listbysubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/listBySubscription.ts +[listprofilesbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/listProfilesByResourceGroup.ts +[nameavailabilitytestnameavailablepost21]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/nameAvailabilityTestNameAvailablePost21.ts +[nameavailabilitytestnamenotavailablepost23]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/nameAvailabilityTestNameNotAvailablePost23.ts +[profiledelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileDelete.ts +[profilegetwithendpoints]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithEndpoints.ts +[profilegetwithtrafficviewdisabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithTrafficViewDisabled.ts +[profilegetwithtrafficviewenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithTrafficViewEnabled.ts +[profilepatchmonitorconfig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePatchMonitorConfig.ts +[profileputmultivalue]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutMultiValue.ts +[profileputnoendpoints]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutNoEndpoints.ts +[profileputwithaliasing]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithAliasing.ts +[profileputwithcustomheaders]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithCustomHeaders.ts +[profileputwithendpoints]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithEndpoints.ts +[profileputwithnestedendpoints]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithNestedEndpoints.ts +[trafficmanagerusermetricskeysdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysDelete.ts +[trafficmanagerusermetricskeysget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysGet.ts +[trafficmanagerusermetricskeysput]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysPut.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-trafficmanager?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/trafficmanager/arm-trafficmanager/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/package.json b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/package.json new file mode 100644 index 000000000000..2dc944c0343f --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "azure-arm-trafficmanager-samples-ts", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/trafficmanager/arm-trafficmanager" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/trafficmanager/arm-trafficmanager", + "dependencies": { + "@azure/arm-trafficmanager": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.4.0", + "rimraf": "latest" + } +} diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/sample.env b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointDeleteExternal.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointDeleteExternal.ts new file mode 100644 index 000000000000..0bdaa5a1031e --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointDeleteExternal.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a Traffic Manager endpoint. + * + * @summary Deletes a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-DELETE-External.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointDeleteExternal() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.delete( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointDeleteExternal().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithGeoMapping.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithGeoMapping.ts new file mode 100644 index 000000000000..0600634fca41 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithGeoMapping.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager endpoint. + * + * @summary Gets a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithGeoMapping.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointGetExternalWithGeoMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.get( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointGetExternalWithGeoMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithLocation.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithLocation.ts new file mode 100644 index 000000000000..c283b89ce82e --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithLocation.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager endpoint. + * + * @summary Gets a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithLocation.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointGetExternalWithLocation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.get( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointGetExternalWithLocation().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithSubnetMapping.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithSubnetMapping.ts new file mode 100644 index 000000000000..c7ff78225c90 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointGetExternalWithSubnetMapping.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager endpoint. + * + * @summary Gets a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-GET-External-WithSubnetMapping.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointGetExternalWithSubnetMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.get( + resourceGroupName, + profileName, + endpointType, + endpointName + ); + console.log(result); +} + +endpointGetExternalWithSubnetMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPatchExternalTarget.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPatchExternalTarget.ts new file mode 100644 index 000000000000..f5d0651456ae --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPatchExternalTarget.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Update a Traffic Manager endpoint. + * + * @summary Update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PATCH-External-Target.json + */ +import { + Endpoint, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointPatchExternalTarget() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const parameters: Endpoint = { + name: "azsmnet7187", + type: "Microsoft.Network/trafficManagerProfiles/externalEndpoints", + id: + "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187", + target: "another.foobar.contoso.com" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.update( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPatchExternalTarget().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithCustomHeaders.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithCustomHeaders.ts new file mode 100644 index 000000000000..d17729c2b9ab --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithCustomHeaders.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithCustomHeaders.json + */ +import { + Endpoint, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointPutExternalWithCustomHeaders() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const parameters: Endpoint = { + name: "azsmnet7187", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + customHeaders: [ + { name: "header-1", value: "value-1" }, + { name: "header-2", value: "value-2" } + ], + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithCustomHeaders().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithGeoMapping.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithGeoMapping.ts new file mode 100644 index 000000000000..66e52f174653 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithGeoMapping.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithGeoMapping.json + */ +import { + Endpoint, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointPutExternalWithGeoMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const parameters: Endpoint = { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointStatus: "Enabled", + geoMapping: ["GEO-AS", "GEO-AF"], + target: "foobar.contoso.com" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithGeoMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithLocation.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithLocation.ts new file mode 100644 index 000000000000..092ae0cd26af --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithLocation.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithLocation.json + */ +import { + Endpoint, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointPutExternalWithLocation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const endpointType = "ExternalEndpoints"; + const endpointName = "azsmnet7187"; + const parameters: Endpoint = { + name: "azsmnet7187", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithLocation().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithSubnetMapping.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithSubnetMapping.ts new file mode 100644 index 000000000000..a4b1dcc2fcc9 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/endpointPutExternalWithSubnetMapping.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager endpoint. + * + * @summary Create or update a Traffic Manager endpoint. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Endpoint-PUT-External-WithSubnetMapping.json + */ +import { + Endpoint, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function endpointPutExternalWithSubnetMapping() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2191"; + const profileName = "azuresdkfornetautoresttrafficmanager8224"; + const endpointType = "ExternalEndpoints"; + const endpointName = "My%20external%20endpoint"; + const parameters: Endpoint = { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointStatus: "Enabled", + subnets: [ + { first: "1.2.3.0", scope: 24 }, + { first: "25.26.27.28", last: "29.30.31.32" } + ], + target: "foobar.contoso.com" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.endpoints.createOrUpdate( + resourceGroupName, + profileName, + endpointType, + endpointName, + parameters + ); + console.log(result); +} + +endpointPutExternalWithSubnetMapping().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/geographicHierarchyGetDefault.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/geographicHierarchyGetDefault.ts new file mode 100644 index 000000000000..f4337c6113a6 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/geographicHierarchyGetDefault.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @summary Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/GeographicHierarchy-GET-default.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function geographicHierarchyGetDefault() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.geographicHierarchies.getDefault(); + console.log(result); +} + +geographicHierarchyGetDefault().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGet.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGet.ts new file mode 100644 index 000000000000..435b3d649f24 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGet.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets latest heatmap for Traffic Manager profile. + * + * @summary Gets latest heatmap for Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function heatMapGet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.heatMap.get(resourceGroupName, profileName); + console.log(result); +} + +heatMapGet().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGetWithNullValues.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGetWithNullValues.ts new file mode 100644 index 000000000000..0e3118cc8ca8 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGetWithNullValues.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets latest heatmap for Traffic Manager profile. + * + * @summary Gets latest heatmap for Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET-With-Null-Values.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function heatMapGetWithNullValues() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.heatMap.get(resourceGroupName, profileName); + console.log(result); +} + +heatMapGetWithNullValues().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGetWithTopLeftBotRight.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGetWithTopLeftBotRight.ts new file mode 100644 index 000000000000..41dfbef60a09 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/heatMapGetWithTopLeftBotRight.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets latest heatmap for Traffic Manager profile. + * + * @summary Gets latest heatmap for Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/HeatMap-GET-With-TopLeft-BotRight.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function heatMapGetWithTopLeftBotRight() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const topLeft = [10, 50.001]; + const botRight = [-50.001, 80]; + const options = { topLeft: topLeft, botRight: botRight }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.heatMap.get( + resourceGroupName, + profileName, + options + ); + console.log(result); +} + +heatMapGetWithTopLeftBotRight().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/listBySubscription.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/listBySubscription.ts new file mode 100644 index 000000000000..db9efcd81c9f --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/listBySubscription.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all Traffic Manager profiles within a subscription. + * + * @summary Lists all Traffic Manager profiles within a subscription. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-BySubscription.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listBySubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.profiles.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listBySubscription().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/listProfilesByResourceGroup.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/listProfilesByResourceGroup.ts new file mode 100644 index 000000000000..7d6dbb063067 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/listProfilesByResourceGroup.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists all Traffic Manager profiles within a resource group. + * + * @summary Lists all Traffic Manager profiles within a resource group. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-ByResourceGroup.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listProfilesByResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager3640"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.profiles.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listProfilesByResourceGroup().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/nameAvailabilityTestNameAvailablePost21.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/nameAvailabilityTestNameAvailablePost21.ts new file mode 100644 index 000000000000..7aa3e052ae5c --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/nameAvailabilityTestNameAvailablePost21.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Checks the availability of a Traffic Manager Relative DNS name. + * + * @summary Checks the availability of a Traffic Manager Relative DNS name. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/NameAvailabilityTest_NameAvailable-POST-example-21.json + */ +import { + CheckTrafficManagerRelativeDnsNameAvailabilityParameters, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function nameAvailabilityTestNameAvailablePost21() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const parameters: CheckTrafficManagerRelativeDnsNameAvailabilityParameters = { + name: "azsmnet5403", + type: "microsoft.network/trafficmanagerprofiles" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.checkTrafficManagerRelativeDnsNameAvailability( + parameters + ); + console.log(result); +} + +nameAvailabilityTestNameAvailablePost21().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/nameAvailabilityTestNameNotAvailablePost23.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/nameAvailabilityTestNameNotAvailablePost23.ts new file mode 100644 index 000000000000..f068994acb0b --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/nameAvailabilityTestNameNotAvailablePost23.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Checks the availability of a Traffic Manager Relative DNS name. + * + * @summary Checks the availability of a Traffic Manager Relative DNS name. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/NameAvailabilityTest_NameNotAvailable-POST-example-23.json + */ +import { + CheckTrafficManagerRelativeDnsNameAvailabilityParameters, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function nameAvailabilityTestNameNotAvailablePost23() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const parameters: CheckTrafficManagerRelativeDnsNameAvailabilityParameters = { + name: "azsmnet4696", + type: "microsoft.network/trafficmanagerprofiles" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.checkTrafficManagerRelativeDnsNameAvailability( + parameters + ); + console.log(result); +} + +nameAvailabilityTestNameNotAvailablePost23().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileDelete.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileDelete.ts new file mode 100644 index 000000000000..52d313b7c18e --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileDelete.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a Traffic Manager profile. + * + * @summary Deletes a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-DELETE.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profileDelete() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.delete(resourceGroupName, profileName); + console.log(result); +} + +profileDelete().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithEndpoints.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithEndpoints.ts new file mode 100644 index 000000000000..e25767f7f4cc --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithEndpoints.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager profile. + * + * @summary Gets a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithEndpoints.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profileGetWithEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.get(resourceGroupName, profileName); + console.log(result); +} + +profileGetWithEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithTrafficViewDisabled.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithTrafficViewDisabled.ts new file mode 100644 index 000000000000..a4be8df241d0 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithTrafficViewDisabled.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager profile. + * + * @summary Gets a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithTrafficViewDisabled.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profileGetWithTrafficViewDisabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.get(resourceGroupName, profileName); + console.log(result); +} + +profileGetWithTrafficViewDisabled().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithTrafficViewEnabled.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithTrafficViewEnabled.ts new file mode 100644 index 000000000000..9225a2bb2db7 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profileGetWithTrafficViewEnabled.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a Traffic Manager profile. + * + * @summary Gets a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-GET-WithTrafficViewEnabled.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profileGetWithTrafficViewEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1323"; + const profileName = "azuresdkfornetautoresttrafficmanager3880"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.get(resourceGroupName, profileName); + console.log(result); +} + +profileGetWithTrafficViewEnabled().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePatchMonitorConfig.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePatchMonitorConfig.ts new file mode 100644 index 000000000000..f6252e3dd19e --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePatchMonitorConfig.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Update a Traffic Manager profile. + * + * @summary Update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PATCH-MonitorConfig.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePatchMonitorConfig() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters: Profile = { + monitorConfig: { + path: "/testpath.aspx", + customHeaders: [ + { name: "header-1", value: "value-1" }, + { name: "header-2", value: "value-2" } + ], + intervalInSeconds: 30, + port: 80, + timeoutInSeconds: 6, + toleratedNumberOfFailures: 4, + protocol: "HTTP" + } + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.update( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePatchMonitorConfig().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutMultiValue.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutMultiValue.ts new file mode 100644 index 000000000000..80f900ad17fd --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutMultiValue.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-MultiValue.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutMultiValue() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const parameters: Profile = { + dnsConfig: { relativeName: "azsmnet6386", ttl: 35 }, + location: "global", + maxReturn: 2, + monitorConfig: { path: "/testpath.aspx", port: 80, protocol: "HTTP" }, + profileStatus: "Enabled", + trafficRoutingMethod: "MultiValue", + trafficViewEnrollmentStatus: "Disabled" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutMultiValue().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutNoEndpoints.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutNoEndpoints.ts new file mode 100644 index 000000000000..82743c46499c --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutNoEndpoints.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-NoEndpoints.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutNoEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager1421"; + const profileName = "azsmnet6386"; + const parameters: Profile = { + dnsConfig: { relativeName: "azsmnet6386", ttl: 35 }, + location: "global", + monitorConfig: { path: "/testpath.aspx", port: 80, protocol: "HTTP" }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutNoEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithAliasing.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithAliasing.ts new file mode 100644 index 000000000000..11d49cc3ab25 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithAliasing.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithAliasing.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutWithAliasing() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters: Profile = { + allowedEndpointRecordTypes: ["DomainName"], + dnsConfig: { + relativeName: "azuresdkfornetautoresttrafficmanager6192", + ttl: 35 + }, + endpoints: [ + { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com" + } + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP" + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutWithAliasing().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithCustomHeaders.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithCustomHeaders.ts new file mode 100644 index 000000000000..4256963cd135 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithCustomHeaders.ts @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithCustomHeaders.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutWithCustomHeaders() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters: Profile = { + dnsConfig: { + relativeName: "azuresdkfornetautoresttrafficmanager6192", + ttl: 35 + }, + endpoints: [ + { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + customHeaders: [{ name: "header-2", value: "value-2-overridden" }], + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com" + } + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + customHeaders: [ + { name: "header-1", value: "value-1" }, + { name: "header-2", value: "value-2" } + ], + expectedStatusCodeRanges: [ + { max: 205, min: 200 }, + { max: 410, min: 400 } + ], + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP" + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance", + trafficViewEnrollmentStatus: "Disabled" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutWithCustomHeaders().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithEndpoints.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithEndpoints.ts new file mode 100644 index 000000000000..effad6abd74b --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithEndpoints.ts @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithEndpoints.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutWithEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "azuresdkfornetautoresttrafficmanager2583"; + const profileName = "azuresdkfornetautoresttrafficmanager6192"; + const parameters: Profile = { + dnsConfig: { + relativeName: "azuresdkfornetautoresttrafficmanager6192", + ttl: 35 + }, + endpoints: [ + { + name: "My external endpoint", + type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints", + endpointLocation: "North Europe", + endpointStatus: "Enabled", + target: "foobar.contoso.com" + } + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP" + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Performance" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutWithEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithNestedEndpoints.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithNestedEndpoints.ts new file mode 100644 index 000000000000..53d7e20c75fa --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/profilePutWithNestedEndpoints.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a Traffic Manager profile. + * + * @summary Create or update a Traffic Manager profile. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/Profile-PUT-WithNestedEndpoints.json + */ +import { + Profile, + TrafficManagerManagementClient +} from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function profilePutWithNestedEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myresourcegroup"; + const profileName = "parentprofile"; + const parameters: Profile = { + dnsConfig: { relativeName: "parentprofile", ttl: 35 }, + endpoints: [ + { + name: "MyFirstNestedEndpoint", + type: "Microsoft.Network/trafficManagerProfiles/nestedEndpoints", + endpointStatus: "Enabled", + minChildEndpoints: 2, + minChildEndpointsIPv4: 1, + minChildEndpointsIPv6: 2, + priority: 1, + target: "firstnestedprofile.tmpreview.watmtest.azure-test.net", + weight: 1 + }, + { + name: "MySecondNestedEndpoint", + type: "Microsoft.Network/trafficManagerProfiles/nestedEndpoints", + endpointStatus: "Enabled", + minChildEndpoints: 2, + minChildEndpointsIPv4: 2, + minChildEndpointsIPv6: 1, + priority: 2, + target: "secondnestedprofile.tmpreview.watmtest.azure-test.net", + weight: 1 + } + ], + location: "global", + monitorConfig: { + path: "/testpath.aspx", + intervalInSeconds: 10, + port: 80, + timeoutInSeconds: 5, + toleratedNumberOfFailures: 2, + protocol: "HTTP" + }, + profileStatus: "Enabled", + trafficRoutingMethod: "Priority" + }; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.profiles.createOrUpdate( + resourceGroupName, + profileName, + parameters + ); + console.log(result); +} + +profilePutWithNestedEndpoints().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysDelete.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysDelete.ts new file mode 100644 index 000000000000..a08813838d86 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysDelete.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Delete a subscription-level key used for Real User Metrics collection. + * + * @summary Delete a subscription-level key used for Real User Metrics collection. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-DELETE.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function trafficManagerUserMetricsKeysDelete() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.trafficManagerUserMetricsKeys.delete(); + console.log(result); +} + +trafficManagerUserMetricsKeysDelete().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysGet.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysGet.ts new file mode 100644 index 000000000000..df43ac9f9394 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysGet.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Get the subscription-level key used for Real User Metrics collection. + * + * @summary Get the subscription-level key used for Real User Metrics collection. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-GET.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function trafficManagerUserMetricsKeysGet() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.trafficManagerUserMetricsKeys.get(); + console.log(result); +} + +trafficManagerUserMetricsKeysGet().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysPut.ts b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysPut.ts new file mode 100644 index 000000000000..68ce54729af5 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/src/trafficManagerUserMetricsKeysPut.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Create or update a subscription-level key used for Real User Metrics collection. + * + * @summary Create or update a subscription-level key used for Real User Metrics collection. + * x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/examples/TrafficManagerUserMetricsKeys-PUT.json + */ +import { TrafficManagerManagementClient } from "@azure/arm-trafficmanager"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function trafficManagerUserMetricsKeysPut() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new TrafficManagerManagementClient(credential, subscriptionId); + const result = await client.trafficManagerUserMetricsKeys.createOrUpdate(); + console.log(result); +} + +trafficManagerUserMetricsKeysPut().catch(console.error); diff --git a/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/tsconfig.json b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/samples/v6/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/trafficmanager/arm-trafficmanager/src/index.ts b/sdk/trafficmanager/arm-trafficmanager/src/index.ts new file mode 100644 index 000000000000..23f35fce0f97 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { TrafficManagerManagementClient } from "./trafficManagerManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/models/endpointsMappers.ts b/sdk/trafficmanager/arm-trafficmanager/src/models/endpointsMappers.ts deleted file mode 100644 index a13fdcfe3a69..000000000000 --- a/sdk/trafficmanager/arm-trafficmanager/src/models/endpointsMappers.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CloudError, - DeleteOperationResult, - DnsConfig, - Endpoint, - EndpointPropertiesCustomHeadersItem, - EndpointPropertiesSubnetsItem, - HeatMapEndpoint, - HeatMapModel, - MonitorConfig, - MonitorConfigCustomHeadersItem, - MonitorConfigExpectedStatusCodeRangesItem, - Profile, - ProxyResource, - QueryExperience, - Region, - Resource, - TrackedResource, - TrafficFlow, - TrafficManagerGeographicHierarchy, - UserMetricsModel -} from "../models/mappers"; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/models/geographicHierarchiesMappers.ts b/sdk/trafficmanager/arm-trafficmanager/src/models/geographicHierarchiesMappers.ts deleted file mode 100644 index 509feee44585..000000000000 --- a/sdk/trafficmanager/arm-trafficmanager/src/models/geographicHierarchiesMappers.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CloudError, - DnsConfig, - Endpoint, - EndpointPropertiesCustomHeadersItem, - EndpointPropertiesSubnetsItem, - HeatMapEndpoint, - HeatMapModel, - MonitorConfig, - MonitorConfigCustomHeadersItem, - MonitorConfigExpectedStatusCodeRangesItem, - Profile, - ProxyResource, - QueryExperience, - Region, - Resource, - TrackedResource, - TrafficFlow, - TrafficManagerGeographicHierarchy, - UserMetricsModel -} from "../models/mappers"; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/models/heatMapMappers.ts b/sdk/trafficmanager/arm-trafficmanager/src/models/heatMapMappers.ts deleted file mode 100644 index 509feee44585..000000000000 --- a/sdk/trafficmanager/arm-trafficmanager/src/models/heatMapMappers.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CloudError, - DnsConfig, - Endpoint, - EndpointPropertiesCustomHeadersItem, - EndpointPropertiesSubnetsItem, - HeatMapEndpoint, - HeatMapModel, - MonitorConfig, - MonitorConfigCustomHeadersItem, - MonitorConfigExpectedStatusCodeRangesItem, - Profile, - ProxyResource, - QueryExperience, - Region, - Resource, - TrackedResource, - TrafficFlow, - TrafficManagerGeographicHierarchy, - UserMetricsModel -} from "../models/mappers"; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/models/index.ts b/sdk/trafficmanager/arm-trafficmanager/src/models/index.ts index 33650bcd99cf..379499e018c8 100644 --- a/sdk/trafficmanager/arm-trafficmanager/src/models/index.ts +++ b/sdk/trafficmanager/arm-trafficmanager/src/models/index.ts @@ -6,877 +6,551 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; - -/** - * The result of the request or operation. - */ -export interface DeleteOperationResult { - /** - * The result of the operation or request. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operationResult?: boolean; -} - -/** - * Subnet first address, scope, and/or last address. - */ +/** Subnet first address, scope, and/or last address. */ export interface EndpointPropertiesSubnetsItem { - /** - * First address in the subnet. - */ + /** First address in the subnet. */ first?: string; - /** - * Last address in the subnet. - */ + /** Last address in the subnet. */ last?: string; - /** - * Block size (number of leading bits in the subnet mask). - */ + /** Block size (number of leading bits in the subnet mask). */ scope?: number; } -/** - * Custom header name and value. - */ +/** Custom header name and value. */ export interface EndpointPropertiesCustomHeadersItem { - /** - * Header name. - */ + /** Header name. */ name?: string; - /** - * Header value. - */ + /** Header value. */ value?: string; } -/** - * Class which is a sparse representation of a Traffic Manager endpoint. - */ -export interface HeatMapEndpoint { - /** - * The ARM Resource ID of this Traffic Manager endpoint. - */ - resourceId?: string; - /** - * A number uniquely identifying this endpoint in query experiences. - */ - endpointId?: number; -} - -/** - * Class representing a Traffic Manager HeatMap query experience properties. - */ -export interface QueryExperience { - /** - * The id of the endpoint from the 'endpoints' array which these queries were routed to. - */ - endpointId: number; - /** - * The number of queries originating from this location. - */ - queryCount: number; - /** - * The latency experienced by queries originating from this location. - */ - latency?: number; -} - -/** - * Class representing a Traffic Manager HeatMap traffic flow properties. - */ -export interface TrafficFlow { - /** - * The IP address that this query experience originated from. - */ - sourceIp?: string; - /** - * The approximate latitude that these queries originated from. - */ - latitude?: number; - /** - * The approximate longitude that these queries originated from. - */ - longitude?: number; - /** - * The query experiences produced in this HeatMap calculation. - */ - queryExperiences?: QueryExperience[]; -} - -/** - * The core properties of ARM resources - */ -export interface Resource extends BaseResource { - /** - * Fully qualified resource Id for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} - */ +/** The core properties of ARM resources */ +export interface Resource { + /** Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} */ id?: string; - /** - * The name of the resource - */ + /** The name of the resource */ name?: string; - /** - * The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles. - */ + /** The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles. */ type?: string; } -/** - * The resource model definition for a ARM proxy resource. It will have everything other than - * required location and tags - */ -export interface ProxyResource extends Resource { +/** An error returned by the Azure Resource Manager */ +export interface CloudError { + /** The content of the error. */ + error?: CloudErrorBody; } -/** - * Class representing a Traffic Manager HeatMap. - */ -export interface HeatMapModel extends ProxyResource { - /** - * The beginning of the time window for this HeatMap, inclusive. - */ - startTime?: Date; - /** - * The ending of the time window for this HeatMap, exclusive. - */ - endTime?: Date; - /** - * The endpoints used in this HeatMap calculation. - */ - endpoints?: HeatMapEndpoint[]; - /** - * The traffic flows produced in this HeatMap calculation. - */ - trafficFlows?: TrafficFlow[]; +/** The content of an error returned by the Azure Resource Manager */ +export interface CloudErrorBody { + /** Error code */ + code?: string; + /** Error message */ + message?: string; + /** Error target */ + target?: string; + /** Error details */ + details?: CloudErrorBody[]; } -/** - * Class representing Traffic Manager User Metrics. - */ -export interface UserMetricsModel extends ProxyResource { +/** The result of the request or operation. */ +export interface DeleteOperationResult { /** - * The key returned by the User Metrics operation. + * The result of the operation or request. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - key?: string; + readonly operationResult?: boolean; } -/** - * Class representing a Traffic Manager endpoint. - */ -export interface Endpoint extends ProxyResource { - /** - * The Azure Resource URI of the of the endpoint. Not applicable to endpoints of type - * 'ExternalEndpoints'. - */ - targetResourceId?: string; - /** - * The fully-qualified DNS name or IP address of the endpoint. Traffic Manager returns this value - * in DNS responses to direct traffic to this endpoint. - */ - target?: string; - /** - * The status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and - * is included in the traffic routing method. Possible values include: 'Enabled', 'Disabled' - */ - endpointStatus?: EndpointStatus; - /** - * The weight of this endpoint when using the 'Weighted' traffic routing method. Possible values - * are from 1 to 1000. - */ - weight?: number; - /** - * The priority of this endpoint when using the 'Priority' traffic routing method. Possible - * values are from 1 to 1000, lower values represent higher priority. This is an optional - * parameter. If specified, it must be specified on all endpoints, and no two endpoints can - * share the same priority value. - */ - priority?: number; - /** - * Specifies the location of the external or nested endpoints when using the 'Performance' - * traffic routing method. - */ - endpointLocation?: string; - /** - * The monitoring status of the endpoint. Possible values include: 'CheckingEndpoint', 'Online', - * 'Degraded', 'Disabled', 'Inactive', 'Stopped' - */ - endpointMonitorStatus?: EndpointMonitorStatus; - /** - * The minimum number of endpoints that must be available in the child profile in order for the - * parent profile to be considered available. Only applicable to endpoint of type - * 'NestedEndpoints'. - */ - minChildEndpoints?: number; - /** - * The minimum number of IPv4 (DNS record type A) endpoints that must be available in the child - * profile in order for the parent profile to be considered available. Only applicable to - * endpoint of type 'NestedEndpoints'. - */ - minChildEndpointsIPv4?: number; - /** - * The minimum number of IPv6 (DNS record type AAAA) endpoints that must be available in the - * child profile in order for the parent profile to be considered available. Only applicable to - * endpoint of type 'NestedEndpoints'. - */ - minChildEndpointsIPv6?: number; - /** - * The list of countries/regions mapped to this endpoint when using the 'Geographic' traffic - * routing method. Please consult Traffic Manager Geographic documentation for a full list of - * accepted values. - */ - geoMapping?: string[]; - /** - * The list of subnets, IP addresses, and/or address ranges mapped to this endpoint when using - * the 'Subnet' traffic routing method. An empty list will match all ranges not covered by other - * endpoints. - */ - subnets?: EndpointPropertiesSubnetsItem[]; - /** - * List of custom headers. - */ - customHeaders?: EndpointPropertiesCustomHeadersItem[]; +/** Parameters supplied to check Traffic Manager name operation. */ +export interface CheckTrafficManagerRelativeDnsNameAvailabilityParameters { + /** The name of the resource. */ + name?: string; + /** The type of the resource. */ + type?: string; } -/** - * Parameters supplied to check Traffic Manager name operation. - */ -export interface CheckTrafficManagerRelativeDnsNameAvailabilityParameters { - /** - * The name of the resource. - */ +/** Class representing a Traffic Manager Name Availability response. */ +export interface TrafficManagerNameAvailability { + /** The relative name. */ name?: string; - /** - * The type of the resource. - */ + /** Traffic Manager profile resource type. */ type?: string; + /** Describes whether the relative name is available or not. */ + nameAvailable?: boolean; + /** The reason why the name is not available, when applicable. */ + reason?: string; + /** Descriptive message that explains why the name is not available, when applicable. */ + message?: string; } -/** - * Class containing DNS settings in a Traffic Manager profile. - */ +/** The list Traffic Manager profiles operation response. */ +export interface ProfileListResult { + /** Gets the list of Traffic manager profiles. */ + value?: Profile[]; +} + +/** Class containing DNS settings in a Traffic Manager profile. */ export interface DnsConfig { - /** - * The relative DNS name provided by this Traffic Manager profile. This value is combined with - * the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name - * (FQDN) of the profile. - */ + /** The relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile. */ relativeName?: string; /** - * The fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the - * concatenation of the RelativeName with the DNS domain used by Azure Traffic Manager. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation of the RelativeName with the DNS domain used by Azure Traffic Manager. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly fqdn?: string; - /** - * The DNS Time-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients - * how long to cache DNS responses provided by this Traffic Manager profile. - */ + /** The DNS Time-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile. */ ttl?: number; } -/** - * Custom header name and value. - */ -export interface MonitorConfigCustomHeadersItem { - /** - * Header name. - */ - name?: string; - /** - * Header value. - */ - value?: string; -} - -/** - * Min and max value of a status code range. - */ -export interface MonitorConfigExpectedStatusCodeRangesItem { - /** - * Min status code. - */ - min?: number; - /** - * Max status code. - */ - max?: number; -} - -/** - * Class containing endpoint monitoring settings in a Traffic Manager profile. - */ +/** Class containing endpoint monitoring settings in a Traffic Manager profile. */ export interface MonitorConfig { - /** - * The profile-level monitoring status of the Traffic Manager profile. Possible values include: - * 'CheckingEndpoints', 'Online', 'Degraded', 'Disabled', 'Inactive' - */ + /** The profile-level monitoring status of the Traffic Manager profile. */ profileMonitorStatus?: ProfileMonitorStatus; - /** - * The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health. Possible values include: - * 'HTTP', 'HTTPS', 'TCP' - */ + /** The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health. */ protocol?: MonitorProtocol; - /** - * The TCP port used to probe for endpoint health. - */ + /** The TCP port used to probe for endpoint health. */ port?: number; - /** - * The path relative to the endpoint domain name used to probe for endpoint health. - */ + /** The path relative to the endpoint domain name used to probe for endpoint health. */ path?: string; - /** - * The monitor interval for endpoints in this profile. This is the interval at which Traffic - * Manager will check the health of each endpoint in this profile. - */ + /** The monitor interval for endpoints in this profile. This is the interval at which Traffic Manager will check the health of each endpoint in this profile. */ intervalInSeconds?: number; - /** - * The monitor timeout for endpoints in this profile. This is the time that Traffic Manager - * allows endpoints in this profile to response to the health check. - */ + /** The monitor timeout for endpoints in this profile. This is the time that Traffic Manager allows endpoints in this profile to response to the health check. */ timeoutInSeconds?: number; - /** - * The number of consecutive failed health check that Traffic Manager tolerates before declaring - * an endpoint in this profile Degraded after the next failed health check. - */ + /** The number of consecutive failed health check that Traffic Manager tolerates before declaring an endpoint in this profile Degraded after the next failed health check. */ toleratedNumberOfFailures?: number; - /** - * List of custom headers. - */ + /** List of custom headers. */ customHeaders?: MonitorConfigCustomHeadersItem[]; - /** - * List of expected status code ranges. - */ + /** List of expected status code ranges. */ expectedStatusCodeRanges?: MonitorConfigExpectedStatusCodeRangesItem[]; } -/** - * The resource model definition for a ARM tracked top level resource - */ -export interface TrackedResource extends Resource { - /** - * Resource tags. - */ +/** Custom header name and value. */ +export interface MonitorConfigCustomHeadersItem { + /** Header name. */ + name?: string; + /** Header value. */ + value?: string; +} + +/** Min and max value of a status code range. */ +export interface MonitorConfigExpectedStatusCodeRangesItem { + /** Min status code. */ + min?: number; + /** Max status code. */ + max?: number; +} + +/** Class representing a region in the Geographic hierarchy used with the Geographic traffic routing method. */ +export interface Region { + /** The code of the region */ + code?: string; + /** The name of the region */ + name?: string; + /** The list of Regions grouped under this Region in the Geographic Hierarchy. */ + regions?: Region[]; +} + +/** Class which is a sparse representation of a Traffic Manager endpoint. */ +export interface HeatMapEndpoint { + /** The ARM Resource ID of this Traffic Manager endpoint. */ + resourceId?: string; + /** A number uniquely identifying this endpoint in query experiences. */ + endpointId?: number; +} + +/** Class representing a Traffic Manager HeatMap traffic flow properties. */ +export interface TrafficFlow { + /** The IP address that this query experience originated from. */ + sourceIp?: string; + /** The approximate latitude that these queries originated from. */ + latitude?: number; + /** The approximate longitude that these queries originated from. */ + longitude?: number; + /** The query experiences produced in this HeatMap calculation. */ + queryExperiences?: QueryExperience[]; +} + +/** Class representing a Traffic Manager HeatMap query experience properties. */ +export interface QueryExperience { + /** The id of the endpoint from the 'endpoints' array which these queries were routed to. */ + endpointId: number; + /** The number of queries originating from this location. */ + queryCount: number; + /** The latency experienced by queries originating from this location. */ + latency?: number; +} + +/** The resource model definition for a ARM proxy resource. It will have everything other than required location and tags */ +export type ProxyResource = Resource & {}; + +/** The resource model definition for a ARM tracked top level resource */ +export type TrackedResource = Resource & { + /** Resource tags. */ tags?: { [propertyName: string]: string }; - /** - * The Azure Region where the resource lives - */ + /** The Azure Region where the resource lives */ location?: string; -} +}; -/** - * Class representing a Traffic Manager profile. - */ -export interface Profile extends TrackedResource { - /** - * The status of the Traffic Manager profile. Possible values include: 'Enabled', 'Disabled' - */ +/** Class representing a Traffic Manager endpoint. */ +export type Endpoint = ProxyResource & { + /** The Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. */ + targetResourceId?: string; + /** The fully-qualified DNS name or IP address of the endpoint. Traffic Manager returns this value in DNS responses to direct traffic to this endpoint. */ + target?: string; + /** The status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method. */ + endpointStatus?: EndpointStatus; + /** The weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000. */ + weight?: number; + /** The priority of this endpoint when using the 'Priority' traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter. If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value. */ + priority?: number; + /** Specifies the location of the external or nested endpoints when using the 'Performance' traffic routing method. */ + endpointLocation?: string; + /** The monitoring status of the endpoint. */ + endpointMonitorStatus?: EndpointMonitorStatus; + /** The minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'. */ + minChildEndpoints?: number; + /** The minimum number of IPv4 (DNS record type A) endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'. */ + minChildEndpointsIPv4?: number; + /** The minimum number of IPv6 (DNS record type AAAA) endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'. */ + minChildEndpointsIPv6?: number; + /** The list of countries/regions mapped to this endpoint when using the 'Geographic' traffic routing method. Please consult Traffic Manager Geographic documentation for a full list of accepted values. */ + geoMapping?: string[]; + /** The list of subnets, IP addresses, and/or address ranges mapped to this endpoint when using the 'Subnet' traffic routing method. An empty list will match all ranges not covered by other endpoints. */ + subnets?: EndpointPropertiesSubnetsItem[]; + /** List of custom headers. */ + customHeaders?: EndpointPropertiesCustomHeadersItem[]; +}; + +/** Class representing the Geographic hierarchy used with the Geographic traffic routing method. */ +export type TrafficManagerGeographicHierarchy = ProxyResource & { + /** The region at the root of the hierarchy from all the regions in the hierarchy can be retrieved. */ + geographicHierarchy?: Region; +}; + +/** Class representing a Traffic Manager HeatMap. */ +export type HeatMapModel = ProxyResource & { + /** The beginning of the time window for this HeatMap, inclusive. */ + startTime?: Date; + /** The ending of the time window for this HeatMap, exclusive. */ + endTime?: Date; + /** The endpoints used in this HeatMap calculation. */ + endpoints?: HeatMapEndpoint[]; + /** The traffic flows produced in this HeatMap calculation. */ + trafficFlows?: TrafficFlow[]; +}; + +/** Class representing Traffic Manager User Metrics. */ +export type UserMetricsModel = ProxyResource & { + /** The key returned by the User Metrics operation. */ + key?: string; +}; + +/** Class representing a Traffic Manager profile. */ +export type Profile = TrackedResource & { + /** The status of the Traffic Manager profile. */ profileStatus?: ProfileStatus; - /** - * The traffic routing method of the Traffic Manager profile. Possible values include: - * 'Performance', 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' - */ + /** The traffic routing method of the Traffic Manager profile. */ trafficRoutingMethod?: TrafficRoutingMethod; - /** - * The DNS settings of the Traffic Manager profile. - */ + /** The DNS settings of the Traffic Manager profile. */ dnsConfig?: DnsConfig; - /** - * The endpoint monitoring settings of the Traffic Manager profile. - */ + /** The endpoint monitoring settings of the Traffic Manager profile. */ monitorConfig?: MonitorConfig; - /** - * The list of endpoints in the Traffic Manager profile. - */ + /** The list of endpoints in the Traffic Manager profile. */ endpoints?: Endpoint[]; - /** - * Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. - * Null, indicates 'Disabled'. Enabling this feature will increase the cost of the Traffic Manage - * profile. Possible values include: 'Enabled', 'Disabled' - */ + /** Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, indicates 'Disabled'. Enabling this feature will increase the cost of the Traffic Manage profile. */ trafficViewEnrollmentStatus?: TrafficViewEnrollmentStatus; - /** - * The list of allowed endpoint record types. - */ + /** The list of allowed endpoint record types. */ allowedEndpointRecordTypes?: AllowedEndpointRecordType[]; - /** - * Maximum number of endpoints to be returned for MultiValue routing type. - */ + /** Maximum number of endpoints to be returned for MultiValue routing type. */ maxReturn?: number; +}; + +/** Known values of {@link EndpointStatus} that the service accepts. */ +export enum KnownEndpointStatus { + Enabled = "Enabled", + Disabled = "Disabled" } /** - * Class representing a Traffic Manager Name Availability response. + * Defines values for EndpointStatus. \ + * {@link KnownEndpointStatus} can be used interchangeably with EndpointStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** */ -export interface TrafficManagerNameAvailability { - /** - * The relative name. - */ - name?: string; - /** - * Traffic Manager profile resource type. - */ - type?: string; - /** - * Describes whether the relative name is available or not. - */ - nameAvailable?: boolean; - /** - * The reason why the name is not available, when applicable. - */ - reason?: string; - /** - * Descriptive message that explains why the name is not available, when applicable. - */ - message?: string; +export type EndpointStatus = string; + +/** Known values of {@link EndpointMonitorStatus} that the service accepts. */ +export enum KnownEndpointMonitorStatus { + CheckingEndpoint = "CheckingEndpoint", + Online = "Online", + Degraded = "Degraded", + Disabled = "Disabled", + Inactive = "Inactive", + Stopped = "Stopped" } /** - * Class representing a region in the Geographic hierarchy used with the Geographic traffic routing - * method. + * Defines values for EndpointMonitorStatus. \ + * {@link KnownEndpointMonitorStatus} can be used interchangeably with EndpointMonitorStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CheckingEndpoint** \ + * **Online** \ + * **Degraded** \ + * **Disabled** \ + * **Inactive** \ + * **Stopped** */ -export interface Region { - /** - * The code of the region - */ - code?: string; - /** - * The name of the region - */ - name?: string; - /** - * The list of Regions grouped under this Region in the Geographic Hierarchy. - */ - regions?: Region[]; +export type EndpointMonitorStatus = string; + +/** Known values of {@link ProfileStatus} that the service accepts. */ +export enum KnownProfileStatus { + Enabled = "Enabled", + Disabled = "Disabled" } /** - * Class representing the Geographic hierarchy used with the Geographic traffic routing method. + * Defines values for ProfileStatus. \ + * {@link KnownProfileStatus} can be used interchangeably with ProfileStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** */ -export interface TrafficManagerGeographicHierarchy extends ProxyResource { - /** - * The region at the root of the hierarchy from all the regions in the hierarchy can be - * retrieved. - */ - geographicHierarchy?: Region; +export type ProfileStatus = string; + +/** Known values of {@link TrafficRoutingMethod} that the service accepts. */ +export enum KnownTrafficRoutingMethod { + Performance = "Performance", + Priority = "Priority", + Weighted = "Weighted", + Geographic = "Geographic", + MultiValue = "MultiValue", + Subnet = "Subnet" } /** - * Optional Parameters. - */ -export interface HeatMapGetOptionalParams extends msRest.RequestOptionsBase { - /** - * The top left latitude,longitude pair of the rectangular viewport to query for. - */ - topLeft?: number[]; - /** - * The bottom right latitude,longitude pair of the rectangular viewport to query for. - */ - botRight?: number[]; + * Defines values for TrafficRoutingMethod. \ + * {@link KnownTrafficRoutingMethod} can be used interchangeably with TrafficRoutingMethod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Performance** \ + * **Priority** \ + * **Weighted** \ + * **Geographic** \ + * **MultiValue** \ + * **Subnet** + */ +export type TrafficRoutingMethod = string; + +/** Known values of {@link ProfileMonitorStatus} that the service accepts. */ +export enum KnownProfileMonitorStatus { + CheckingEndpoints = "CheckingEndpoints", + Online = "Online", + Degraded = "Degraded", + Disabled = "Disabled", + Inactive = "Inactive" } /** - * An interface representing TrafficManagerManagementClientOptions. + * Defines values for ProfileMonitorStatus. \ + * {@link KnownProfileMonitorStatus} can be used interchangeably with ProfileMonitorStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CheckingEndpoints** \ + * **Online** \ + * **Degraded** \ + * **Disabled** \ + * **Inactive** */ -export interface TrafficManagerManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; +export type ProfileMonitorStatus = string; + +/** Known values of {@link MonitorProtocol} that the service accepts. */ +export enum KnownMonitorProtocol { + Http = "HTTP", + Https = "HTTPS", + TCP = "TCP" } /** - * @interface - * The list Traffic Manager profiles operation response. - * @extends Array + * Defines values for MonitorProtocol. \ + * {@link KnownMonitorProtocol} can be used interchangeably with MonitorProtocol, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **HTTP** \ + * **HTTPS** \ + * **TCP** */ -export interface ProfileListResult extends Array { +export type MonitorProtocol = string; + +/** Known values of {@link TrafficViewEnrollmentStatus} that the service accepts. */ +export enum KnownTrafficViewEnrollmentStatus { + Enabled = "Enabled", + Disabled = "Disabled" } /** - * Defines values for EndpointStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} + * Defines values for TrafficViewEnrollmentStatus. \ + * {@link KnownTrafficViewEnrollmentStatus} can be used interchangeably with TrafficViewEnrollmentStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** */ -export type EndpointStatus = 'Enabled' | 'Disabled'; +export type TrafficViewEnrollmentStatus = string; -/** - * Defines values for EndpointMonitorStatus. - * Possible values include: 'CheckingEndpoint', 'Online', 'Degraded', 'Disabled', 'Inactive', - * 'Stopped' - * @readonly - * @enum {string} - */ -export type EndpointMonitorStatus = 'CheckingEndpoint' | 'Online' | 'Degraded' | 'Disabled' | 'Inactive' | 'Stopped'; +/** Known values of {@link AllowedEndpointRecordType} that the service accepts. */ +export enum KnownAllowedEndpointRecordType { + DomainName = "DomainName", + IPv4Address = "IPv4Address", + IPv6Address = "IPv6Address", + Any = "Any" +} /** - * Defines values for ProfileMonitorStatus. - * Possible values include: 'CheckingEndpoints', 'Online', 'Degraded', 'Disabled', 'Inactive' - * @readonly - * @enum {string} + * Defines values for AllowedEndpointRecordType. \ + * {@link KnownAllowedEndpointRecordType} can be used interchangeably with AllowedEndpointRecordType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **DomainName** \ + * **IPv4Address** \ + * **IPv6Address** \ + * **Any** */ -export type ProfileMonitorStatus = 'CheckingEndpoints' | 'Online' | 'Degraded' | 'Disabled' | 'Inactive'; +export type AllowedEndpointRecordType = string; +/** Defines values for EndpointType. */ +export type EndpointType = + | "AzureEndpoints" + | "ExternalEndpoints" + | "NestedEndpoints"; -/** - * Defines values for MonitorProtocol. - * Possible values include: 'HTTP', 'HTTPS', 'TCP' - * @readonly - * @enum {string} - */ -export type MonitorProtocol = 'HTTP' | 'HTTPS' | 'TCP'; +/** Optional parameters. */ +export interface EndpointsUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ProfileStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type ProfileStatus = 'Enabled' | 'Disabled'; +/** Contains response data for the update operation. */ +export type EndpointsUpdateResponse = Endpoint; -/** - * Defines values for TrafficRoutingMethod. - * Possible values include: 'Performance', 'Priority', 'Weighted', 'Geographic', 'MultiValue', - * 'Subnet' - * @readonly - * @enum {string} - */ -export type TrafficRoutingMethod = 'Performance' | 'Priority' | 'Weighted' | 'Geographic' | 'MultiValue' | 'Subnet'; +/** Optional parameters. */ +export interface EndpointsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for TrafficViewEnrollmentStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type TrafficViewEnrollmentStatus = 'Enabled' | 'Disabled'; +/** Contains response data for the get operation. */ +export type EndpointsGetResponse = Endpoint; -/** - * Defines values for AllowedEndpointRecordType. - * Possible values include: 'DomainName', 'IPv4Address', 'IPv6Address', 'Any' - * @readonly - * @enum {string} - */ -export type AllowedEndpointRecordType = 'DomainName' | 'IPv4Address' | 'IPv6Address' | 'Any'; +/** Optional parameters. */ +export interface EndpointsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type EndpointsUpdateResponse = Endpoint & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Endpoint; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type EndpointsCreateOrUpdateResponse = Endpoint; -/** - * Contains response data for the get operation. - */ -export type EndpointsGetResponse = Endpoint & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Endpoint; - }; -}; +/** Optional parameters. */ +export interface EndpointsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type EndpointsCreateOrUpdateResponse = Endpoint & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Endpoint; - }; -}; +/** Contains response data for the delete operation. */ +export type EndpointsDeleteResponse = DeleteOperationResult; -/** - * Contains response data for the deleteMethod operation. - */ -export type EndpointsDeleteMethodResponse = DeleteOperationResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DeleteOperationResult; - }; -}; +/** Optional parameters. */ +export interface ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the checkTrafficManagerRelativeDnsNameAvailability operation. - */ -export type ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityResponse = TrafficManagerNameAvailability & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: TrafficManagerNameAvailability; - }; -}; +/** Contains response data for the checkTrafficManagerRelativeDnsNameAvailability operation. */ +export type ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityResponse = TrafficManagerNameAvailability; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ProfilesListByResourceGroupResponse = ProfileListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProfileListResult; - }; -}; +/** Optional parameters. */ +export interface ProfilesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listBySubscription operation. - */ -export type ProfilesListBySubscriptionResponse = ProfileListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProfileListResult; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type ProfilesListByResourceGroupResponse = ProfileListResult; -/** - * Contains response data for the get operation. - */ -export type ProfilesGetResponse = Profile & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Profile; - }; -}; +/** Optional parameters. */ +export interface ProfilesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ProfilesCreateOrUpdateResponse = Profile & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Profile; - }; -}; +/** Contains response data for the listBySubscription operation. */ +export type ProfilesListBySubscriptionResponse = ProfileListResult; -/** - * Contains response data for the deleteMethod operation. - */ -export type ProfilesDeleteMethodResponse = DeleteOperationResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DeleteOperationResult; - }; -}; +/** Optional parameters. */ +export interface ProfilesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type ProfilesUpdateResponse = Profile & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Profile; - }; -}; +/** Contains response data for the get operation. */ +export type ProfilesGetResponse = Profile; -/** - * Contains response data for the getDefault operation. - */ -export type GeographicHierarchiesGetDefaultResponse = TrafficManagerGeographicHierarchy & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: TrafficManagerGeographicHierarchy; - }; -}; +/** Optional parameters. */ +export interface ProfilesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type HeatMapGetResponse = HeatMapModel & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: HeatMapModel; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type ProfilesCreateOrUpdateResponse = Profile; -/** - * Contains response data for the get operation. - */ -export type TrafficManagerUserMetricsKeysGetResponse = UserMetricsModel & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UserMetricsModel; - }; -}; +/** Optional parameters. */ +export interface ProfilesDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type TrafficManagerUserMetricsKeysCreateOrUpdateResponse = UserMetricsModel & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UserMetricsModel; - }; -}; +/** Contains response data for the delete operation. */ +export type ProfilesDeleteResponse = DeleteOperationResult; -/** - * Contains response data for the deleteMethod operation. - */ -export type TrafficManagerUserMetricsKeysDeleteMethodResponse = DeleteOperationResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DeleteOperationResult; - }; -}; +/** Optional parameters. */ +export interface ProfilesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ProfilesUpdateResponse = Profile; + +/** Optional parameters. */ +export interface GeographicHierarchiesGetDefaultOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getDefault operation. */ +export type GeographicHierarchiesGetDefaultResponse = TrafficManagerGeographicHierarchy; + +/** Optional parameters. */ +export interface HeatMapGetOptionalParams extends coreClient.OperationOptions { + /** The top left latitude,longitude pair of the rectangular viewport to query for. */ + topLeft?: number[]; + /** The bottom right latitude,longitude pair of the rectangular viewport to query for. */ + botRight?: number[]; +} + +/** Contains response data for the get operation. */ +export type HeatMapGetResponse = HeatMapModel; + +/** Optional parameters. */ +export interface TrafficManagerUserMetricsKeysGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TrafficManagerUserMetricsKeysGetResponse = UserMetricsModel; + +/** Optional parameters. */ +export interface TrafficManagerUserMetricsKeysCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type TrafficManagerUserMetricsKeysCreateOrUpdateResponse = UserMetricsModel; + +/** Optional parameters. */ +export interface TrafficManagerUserMetricsKeysDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the delete operation. */ +export type TrafficManagerUserMetricsKeysDeleteResponse = DeleteOperationResult; + +/** Optional parameters. */ +export interface TrafficManagerManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/trafficmanager/arm-trafficmanager/src/models/mappers.ts b/sdk/trafficmanager/arm-trafficmanager/src/models/mappers.ts index 530afca7e3c0..00159cc76293 100644 --- a/sdk/trafficmanager/arm-trafficmanager/src/models/mappers.ts +++ b/sdk/trafficmanager/arm-trafficmanager/src/models/mappers.ts @@ -6,31 +6,9 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const DeleteOperationResult: msRest.CompositeMapper = { - serializedName: "DeleteOperationResult", - type: { - name: "Composite", - className: "DeleteOperationResult", - modelProperties: { - operationResult: { - readOnly: true, - serializedName: "boolean", - type: { - name: "Boolean" - } - } - } - } -}; - -export const EndpointPropertiesSubnetsItem: msRest.CompositeMapper = { - serializedName: "EndpointProperties_subnetsItem", +export const EndpointPropertiesSubnetsItem: coreClient.CompositeMapper = { type: { name: "Composite", className: "EndpointPropertiesSubnetsItem", @@ -57,8 +35,7 @@ export const EndpointPropertiesSubnetsItem: msRest.CompositeMapper = { } }; -export const EndpointPropertiesCustomHeadersItem: msRest.CompositeMapper = { - serializedName: "EndpointProperties_customHeadersItem", +export const EndpointPropertiesCustomHeadersItem: coreClient.CompositeMapper = { type: { name: "Composite", className: "EndpointPropertiesCustomHeadersItem", @@ -79,90 +56,80 @@ export const EndpointPropertiesCustomHeadersItem: msRest.CompositeMapper = { } }; -export const HeatMapEndpoint: msRest.CompositeMapper = { - serializedName: "HeatMapEndpoint", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HeatMapEndpoint", + className: "Resource", modelProperties: { - resourceId: { - serializedName: "resourceId", + id: { + serializedName: "id", type: { name: "String" } }, - endpointId: { - serializedName: "endpointId", + name: { + serializedName: "name", type: { - name: "Number" + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" } } } } }; -export const QueryExperience: msRest.CompositeMapper = { - serializedName: "QueryExperience", +export const CloudError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "QueryExperience", + className: "CloudError", modelProperties: { - endpointId: { - required: true, - serializedName: "endpointId", - type: { - name: "Number" - } - }, - queryCount: { - required: true, - serializedName: "queryCount", - type: { - name: "Number" - } - }, - latency: { - serializedName: "latency", + error: { + serializedName: "error", type: { - name: "Number" + name: "Composite", + className: "CloudErrorBody" } } } } }; -export const TrafficFlow: msRest.CompositeMapper = { - serializedName: "TrafficFlow", +export const CloudErrorBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrafficFlow", + className: "CloudErrorBody", modelProperties: { - sourceIp: { - serializedName: "sourceIp", + code: { + serializedName: "code", type: { name: "String" } }, - latitude: { - serializedName: "latitude", + message: { + serializedName: "message", type: { - name: "Number" + name: "String" } }, - longitude: { - serializedName: "longitude", + target: { + serializedName: "target", type: { - name: "Number" + name: "String" } }, - queryExperiences: { - serializedName: "queryExperiences", + details: { + serializedName: "details", type: { name: "Sequence", element: { type: { name: "Composite", - className: "QueryExperience" + className: "CloudErrorBody" } } } @@ -171,18 +138,27 @@ export const TrafficFlow: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const DeleteOperationResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "DeleteOperationResult", modelProperties: { - id: { - serializedName: "id", + operationResult: { + serializedName: "boolean", + readOnly: true, type: { - name: "String" + name: "Boolean" } - }, + } + } + } +}; + +export const CheckTrafficManagerRelativeDnsNameAvailabilityParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckTrafficManagerRelativeDnsNameAvailabilityParameters", + modelProperties: { name: { serializedName: "name", type: { @@ -199,179 +175,161 @@ export const Resource: msRest.CompositeMapper = { } }; -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties - } - } -}; - -export const HeatMapModel: msRest.CompositeMapper = { - serializedName: "HeatMapModel", +export const TrafficManagerNameAvailability: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HeatMapModel", + className: "TrafficManagerNameAvailability", modelProperties: { - ...ProxyResource.type.modelProperties, - startTime: { - serializedName: "properties.startTime", + name: { + serializedName: "name", type: { - name: "DateTime" + name: "String" } }, - endTime: { - serializedName: "properties.endTime", + type: { + serializedName: "type", type: { - name: "DateTime" + name: "String" } }, - endpoints: { - serializedName: "properties.endpoints", + nameAvailable: { + serializedName: "nameAvailable", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "HeatMapEndpoint" - } - } + name: "Boolean" } }, - trafficFlows: { - serializedName: "properties.trafficFlows", + reason: { + serializedName: "reason", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TrafficFlow" - } - } + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" } } } } }; -export const UserMetricsModel: msRest.CompositeMapper = { - serializedName: "UserMetricsModel", +export const ProfileListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UserMetricsModel", + className: "ProfileListResult", modelProperties: { - ...ProxyResource.type.modelProperties, - key: { - serializedName: "properties.key", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Profile" + } + } } } } } }; -export const Endpoint: msRest.CompositeMapper = { - serializedName: "Endpoint", +export const DnsConfig: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Endpoint", + className: "DnsConfig", modelProperties: { - ...ProxyResource.type.modelProperties, - targetResourceId: { - serializedName: "properties.targetResourceId", - type: { - name: "String" - } - }, - target: { - serializedName: "properties.target", + relativeName: { + serializedName: "relativeName", type: { name: "String" } }, - endpointStatus: { - serializedName: "properties.endpointStatus", + fqdn: { + serializedName: "fqdn", + readOnly: true, type: { name: "String" } }, - weight: { - serializedName: "properties.weight", + ttl: { + serializedName: "ttl", type: { name: "Number" } - }, - priority: { - serializedName: "properties.priority", + } + } + } +}; + +export const MonitorConfig: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorConfig", + modelProperties: { + profileMonitorStatus: { + serializedName: "profileMonitorStatus", type: { - name: "Number" + name: "String" } }, - endpointLocation: { - serializedName: "properties.endpointLocation", + protocol: { + serializedName: "protocol", type: { name: "String" } }, - endpointMonitorStatus: { - serializedName: "properties.endpointMonitorStatus", + port: { + serializedName: "port", type: { - name: "String" + name: "Number" } }, - minChildEndpoints: { - serializedName: "properties.minChildEndpoints", + path: { + serializedName: "path", type: { - name: "Number" + name: "String" } }, - minChildEndpointsIPv4: { - serializedName: "properties.minChildEndpointsIPv4", + intervalInSeconds: { + serializedName: "intervalInSeconds", type: { name: "Number" } }, - minChildEndpointsIPv6: { - serializedName: "properties.minChildEndpointsIPv6", + timeoutInSeconds: { + serializedName: "timeoutInSeconds", type: { name: "Number" } }, - geoMapping: { - serializedName: "properties.geoMapping", + toleratedNumberOfFailures: { + serializedName: "toleratedNumberOfFailures", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Number" } }, - subnets: { - serializedName: "properties.subnets", + customHeaders: { + serializedName: "customHeaders", type: { name: "Sequence", element: { type: { name: "Composite", - className: "EndpointPropertiesSubnetsItem" + className: "MonitorConfigCustomHeadersItem" } } } }, - customHeaders: { - serializedName: "properties.customHeaders", + expectedStatusCodeRanges: { + serializedName: "expectedStatusCodeRanges", type: { name: "Sequence", element: { type: { name: "Composite", - className: "EndpointPropertiesCustomHeadersItem" + className: "MonitorConfigExpectedStatusCodeRangesItem" } } } @@ -380,11 +338,10 @@ export const Endpoint: msRest.CompositeMapper = { } }; -export const CheckTrafficManagerRelativeDnsNameAvailabilityParameters: msRest.CompositeMapper = { - serializedName: "CheckTrafficManagerRelativeDnsNameAvailabilityParameters", +export const MonitorConfigCustomHeadersItem: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CheckTrafficManagerRelativeDnsNameAvailabilityParameters", + className: "MonitorConfigCustomHeadersItem", modelProperties: { name: { serializedName: "name", @@ -392,8 +349,8 @@ export const CheckTrafficManagerRelativeDnsNameAvailabilityParameters: msRest.Co name: "String" } }, - type: { - serializedName: "type", + value: { + serializedName: "value", type: { name: "String" } @@ -402,27 +359,19 @@ export const CheckTrafficManagerRelativeDnsNameAvailabilityParameters: msRest.Co } }; -export const DnsConfig: msRest.CompositeMapper = { - serializedName: "DnsConfig", +export const MonitorConfigExpectedStatusCodeRangesItem: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DnsConfig", + className: "MonitorConfigExpectedStatusCodeRangesItem", modelProperties: { - relativeName: { - serializedName: "relativeName", - type: { - name: "String" - } - }, - fqdn: { - readOnly: true, - serializedName: "fqdn", + min: { + serializedName: "min", type: { - name: "String" + name: "Number" } }, - ttl: { - serializedName: "ttl", + max: { + serializedName: "max", type: { name: "Number" } @@ -431,42 +380,52 @@ export const DnsConfig: msRest.CompositeMapper = { } }; -export const MonitorConfigCustomHeadersItem: msRest.CompositeMapper = { - serializedName: "MonitorConfig_customHeadersItem", +export const Region: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitorConfigCustomHeadersItem", + className: "Region", modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, name: { serializedName: "name", type: { name: "String" } }, - value: { - serializedName: "value", + regions: { + serializedName: "regions", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Region" + } + } } } } } }; -export const MonitorConfigExpectedStatusCodeRangesItem: msRest.CompositeMapper = { - serializedName: "MonitorConfig_expectedStatusCodeRangesItem", +export const HeatMapEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitorConfigExpectedStatusCodeRangesItem", + className: "HeatMapEndpoint", modelProperties: { - min: { - serializedName: "min", + resourceId: { + serializedName: "resourceId", type: { - name: "Number" + name: "String" } }, - max: { - serializedName: "max", + endpointId: { + serializedName: "endpointId", type: { name: "Number" } @@ -475,84 +434,85 @@ export const MonitorConfigExpectedStatusCodeRangesItem: msRest.CompositeMapper = } }; -export const MonitorConfig: msRest.CompositeMapper = { - serializedName: "MonitorConfig", +export const TrafficFlow: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitorConfig", + className: "TrafficFlow", modelProperties: { - profileMonitorStatus: { - serializedName: "profileMonitorStatus", + sourceIp: { + serializedName: "sourceIp", type: { name: "String" } }, - protocol: { - serializedName: "protocol", + latitude: { + serializedName: "latitude", type: { - name: "String" + name: "Number" } }, - port: { - serializedName: "port", + longitude: { + serializedName: "longitude", type: { name: "Number" } }, - path: { - serializedName: "path", + queryExperiences: { + serializedName: "queryExperiences", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "QueryExperience" + } + } } - }, - intervalInSeconds: { - serializedName: "intervalInSeconds", + } + } + } +}; + +export const QueryExperience: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QueryExperience", + modelProperties: { + endpointId: { + serializedName: "endpointId", + required: true, type: { name: "Number" } }, - timeoutInSeconds: { - serializedName: "timeoutInSeconds", + queryCount: { + serializedName: "queryCount", + required: true, type: { name: "Number" } }, - toleratedNumberOfFailures: { - serializedName: "toleratedNumberOfFailures", + latency: { + serializedName: "latency", type: { name: "Number" } - }, - customHeaders: { - serializedName: "customHeaders", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MonitorConfigCustomHeadersItem" - } - } - } - }, - expectedStatusCodeRanges: { - serializedName: "expectedStatusCodeRanges", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MonitorConfigExpectedStatusCodeRangesItem" - } - } - } } } } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", className: "TrackedResource", @@ -562,11 +522,7 @@ export const TrackedResource: msRest.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } }, location: { @@ -579,59 +535,74 @@ export const TrackedResource: msRest.CompositeMapper = { } }; -export const Profile: msRest.CompositeMapper = { - serializedName: "Profile", +export const Endpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Profile", + className: "Endpoint", modelProperties: { - ...TrackedResource.type.modelProperties, - profileStatus: { - serializedName: "properties.profileStatus", + ...ProxyResource.type.modelProperties, + targetResourceId: { + serializedName: "properties.targetResourceId", type: { name: "String" } }, - trafficRoutingMethod: { - serializedName: "properties.trafficRoutingMethod", + target: { + serializedName: "properties.target", type: { name: "String" } }, - dnsConfig: { - serializedName: "properties.dnsConfig", + endpointStatus: { + serializedName: "properties.endpointStatus", type: { - name: "Composite", - className: "DnsConfig" + name: "String" } }, - monitorConfig: { - serializedName: "properties.monitorConfig", + weight: { + serializedName: "properties.weight", type: { - name: "Composite", - className: "MonitorConfig" + name: "Number" } }, - endpoints: { - serializedName: "properties.endpoints", + priority: { + serializedName: "properties.priority", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Endpoint" - } - } + name: "Number" } }, - trafficViewEnrollmentStatus: { - serializedName: "properties.trafficViewEnrollmentStatus", + endpointLocation: { + serializedName: "properties.endpointLocation", type: { name: "String" } }, - allowedEndpointRecordTypes: { - serializedName: "properties.allowedEndpointRecordTypes", + endpointMonitorStatus: { + serializedName: "properties.endpointMonitorStatus", + type: { + name: "String" + } + }, + minChildEndpoints: { + serializedName: "properties.minChildEndpoints", + type: { + name: "Number" + } + }, + minChildEndpointsIPv4: { + serializedName: "properties.minChildEndpointsIPv4", + type: { + name: "Number" + } + }, + minChildEndpointsIPv6: { + serializedName: "properties.minChildEndpointsIPv6", + type: { + name: "Number" + } + }, + geoMapping: { + serializedName: "properties.geoMapping", type: { name: "Sequence", element: { @@ -641,82 +612,89 @@ export const Profile: msRest.CompositeMapper = { } } }, - maxReturn: { - serializedName: "properties.maxReturn", + subnets: { + serializedName: "properties.subnets", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EndpointPropertiesSubnetsItem" + } + } + } + }, + customHeaders: { + serializedName: "properties.customHeaders", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EndpointPropertiesCustomHeadersItem" + } + } } } } } }; -export const TrafficManagerNameAvailability: msRest.CompositeMapper = { - serializedName: "TrafficManagerNameAvailability", +export const TrafficManagerGeographicHierarchy: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrafficManagerNameAvailability", + className: "TrafficManagerGeographicHierarchy", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" - } - }, - nameAvailable: { - serializedName: "nameAvailable", - type: { - name: "Boolean" - } - }, - reason: { - serializedName: "reason", - type: { - name: "String" - } - }, - message: { - serializedName: "message", + ...ProxyResource.type.modelProperties, + geographicHierarchy: { + serializedName: "properties.geographicHierarchy", type: { - name: "String" + name: "Composite", + className: "Region" } } } } }; -export const Region: msRest.CompositeMapper = { - serializedName: "Region", +export const HeatMapModel: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Region", + className: "HeatMapModel", modelProperties: { - code: { - serializedName: "code", + ...ProxyResource.type.modelProperties, + startTime: { + serializedName: "properties.startTime", type: { - name: "String" + name: "DateTime" } }, - name: { - serializedName: "name", + endTime: { + serializedName: "properties.endTime", type: { - name: "String" + name: "DateTime" } }, - regions: { - serializedName: "regions", + endpoints: { + serializedName: "properties.endpoints", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Region" + className: "HeatMapEndpoint" + } + } + } + }, + trafficFlows: { + serializedName: "properties.trafficFlows", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TrafficFlow" } } } @@ -725,41 +703,88 @@ export const Region: msRest.CompositeMapper = { } }; -export const TrafficManagerGeographicHierarchy: msRest.CompositeMapper = { - serializedName: "TrafficManagerGeographicHierarchy", +export const UserMetricsModel: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrafficManagerGeographicHierarchy", + className: "UserMetricsModel", modelProperties: { ...ProxyResource.type.modelProperties, - geographicHierarchy: { - serializedName: "properties.geographicHierarchy", + key: { + serializedName: "properties.key", type: { - name: "Composite", - className: "Region" + name: "String" } } } } }; -export const ProfileListResult: msRest.CompositeMapper = { - serializedName: "ProfileListResult", +export const Profile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProfileListResult", + className: "Profile", modelProperties: { - value: { - serializedName: "", + ...TrackedResource.type.modelProperties, + profileStatus: { + serializedName: "properties.profileStatus", + type: { + name: "String" + } + }, + trafficRoutingMethod: { + serializedName: "properties.trafficRoutingMethod", + type: { + name: "String" + } + }, + dnsConfig: { + serializedName: "properties.dnsConfig", + type: { + name: "Composite", + className: "DnsConfig" + } + }, + monitorConfig: { + serializedName: "properties.monitorConfig", + type: { + name: "Composite", + className: "MonitorConfig" + } + }, + endpoints: { + serializedName: "properties.endpoints", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Profile" + className: "Endpoint" } } } + }, + trafficViewEnrollmentStatus: { + serializedName: "properties.trafficViewEnrollmentStatus", + type: { + name: "String" + } + }, + allowedEndpointRecordTypes: { + serializedName: "properties.allowedEndpointRecordTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + maxReturn: { + serializedName: "properties.maxReturn", + type: { + name: "Number" + } } } } diff --git a/sdk/trafficmanager/arm-trafficmanager/src/models/parameters.ts b/sdk/trafficmanager/arm-trafficmanager/src/models/parameters.ts index 1b2b07e257c7..7c6d5ab5d149 100644 --- a/sdk/trafficmanager/arm-trafficmanager/src/models/parameters.ts +++ b/sdk/trafficmanager/arm-trafficmanager/src/models/parameters.ts @@ -3,127 +3,179 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + Endpoint as EndpointMapper, + CheckTrafficManagerRelativeDnsNameAvailabilityParameters as CheckTrafficManagerRelativeDnsNameAvailabilityParametersMapper, + Profile as ProfileMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: EndpointMapper +}; + +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - required: true, - serializedName: "api-version", + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const botRight: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "botRight" - ], + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { - serializedName: "botRight", - constraints: { - MaxItems: 2, - MinItems: 2 - }, + serializedName: "$host", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Number" - } - } + name: "String" } }, - collectionFormat: msRest.QueryCollectionFormat.Csv + skipEncoding: true }; -export const endpointName: msRest.OperationURLParameter = { - parameterPath: "endpointName", + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + serializedName: "resourceGroupName", required: true, - serializedName: "endpointName", type: { name: "String" } } }; -export const endpointType: msRest.OperationURLParameter = { - parameterPath: "endpointType", + +export const profileName: OperationURLParameter = { + parameterPath: "profileName", mapper: { + serializedName: "profileName", required: true, - serializedName: "endpointType", type: { name: "String" } } }; -export const heatMapType: msRest.OperationURLParameter = { - parameterPath: "heatMapType", + +export const endpointType: OperationURLParameter = { + parameterPath: "endpointType", mapper: { + serializedName: "endpointType", required: true, - isConstant: true, - serializedName: "heatMapType", - defaultValue: 'default', type: { - name: "String" + name: "Enum", + allowedValues: ["AzureEndpoints", "ExternalEndpoints", "NestedEndpoints"] } } }; -export const profileName: msRest.OperationURLParameter = { - parameterPath: "profileName", + +export const endpointName: OperationURLParameter = { + parameterPath: "endpointName", mapper: { + serializedName: "endpointName", required: true, - serializedName: "profileName", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "resourceGroupName", + defaultValue: "2018-08-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { + +export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { - required: true, serializedName: "subscriptionId", + required: true, type: { name: "String" } } }; -export const topLeft: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "topLeft" - ], + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: CheckTrafficManagerRelativeDnsNameAvailabilityParametersMapper +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: ProfileMapper +}; + +export const heatMapType: OperationURLParameter = { + parameterPath: "heatMapType", mapper: { + defaultValue: "default", + isConstant: true, + serializedName: "heatMapType", + type: { + name: "String" + } + } +}; + +export const topLeft: OperationQueryParameter = { + parameterPath: ["options", "topLeft"], + mapper: { + constraints: { + MinItems: 2, + MaxItems: 2 + }, serializedName: "topLeft", + type: { + name: "Sequence", + element: { + type: { + name: "Number" + } + } + } + }, + collectionFormat: "CSV" +}; + +export const botRight: OperationQueryParameter = { + parameterPath: ["options", "botRight"], + mapper: { constraints: { - MaxItems: 2, - MinItems: 2 + MinItems: 2, + MaxItems: 2 }, + serializedName: "botRight", type: { name: "Sequence", element: { @@ -133,5 +185,5 @@ export const topLeft: msRest.OperationQueryParameter = { } } }, - collectionFormat: msRest.QueryCollectionFormat.Csv + collectionFormat: "CSV" }; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/models/profilesMappers.ts b/sdk/trafficmanager/arm-trafficmanager/src/models/profilesMappers.ts deleted file mode 100644 index d2876b523221..000000000000 --- a/sdk/trafficmanager/arm-trafficmanager/src/models/profilesMappers.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CheckTrafficManagerRelativeDnsNameAvailabilityParameters, - CloudError, - DeleteOperationResult, - DnsConfig, - Endpoint, - EndpointPropertiesCustomHeadersItem, - EndpointPropertiesSubnetsItem, - HeatMapEndpoint, - HeatMapModel, - MonitorConfig, - MonitorConfigCustomHeadersItem, - MonitorConfigExpectedStatusCodeRangesItem, - Profile, - ProfileListResult, - ProxyResource, - QueryExperience, - Region, - Resource, - TrackedResource, - TrafficFlow, - TrafficManagerGeographicHierarchy, - TrafficManagerNameAvailability, - UserMetricsModel -} from "../models/mappers"; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/models/trafficManagerUserMetricsKeysMappers.ts b/sdk/trafficmanager/arm-trafficmanager/src/models/trafficManagerUserMetricsKeysMappers.ts deleted file mode 100644 index a13fdcfe3a69..000000000000 --- a/sdk/trafficmanager/arm-trafficmanager/src/models/trafficManagerUserMetricsKeysMappers.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CloudError, - DeleteOperationResult, - DnsConfig, - Endpoint, - EndpointPropertiesCustomHeadersItem, - EndpointPropertiesSubnetsItem, - HeatMapEndpoint, - HeatMapModel, - MonitorConfig, - MonitorConfigCustomHeadersItem, - MonitorConfigExpectedStatusCodeRangesItem, - Profile, - ProxyResource, - QueryExperience, - Region, - Resource, - TrackedResource, - TrafficFlow, - TrafficManagerGeographicHierarchy, - UserMetricsModel -} from "../models/mappers"; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operations/endpoints.ts b/sdk/trafficmanager/arm-trafficmanager/src/operations/endpoints.ts index 6a73995ea38c..8c5aa05dc16e 100644 --- a/sdk/trafficmanager/arm-trafficmanager/src/operations/endpoints.ts +++ b/sdk/trafficmanager/arm-trafficmanager/src/operations/endpoints.ts @@ -3,62 +3,57 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/endpointsMappers"; +import { Endpoints } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { TrafficManagerManagementClientContext } from "../trafficManagerManagementClientContext"; +import { TrafficManagerManagementClient } from "../trafficManagerManagementClient"; +import { + Endpoint, + EndpointType, + EndpointsUpdateOptionalParams, + EndpointsUpdateResponse, + EndpointsGetOptionalParams, + EndpointsGetResponse, + EndpointsCreateOrUpdateOptionalParams, + EndpointsCreateOrUpdateResponse, + EndpointsDeleteOptionalParams, + EndpointsDeleteResponse +} from "../models"; -/** Class representing a Endpoints. */ -export class Endpoints { - private readonly client: TrafficManagerManagementClientContext; +/** Class containing Endpoints operations. */ +export class EndpointsImpl implements Endpoints { + private readonly client: TrafficManagerManagementClient; /** - * Create a Endpoints. - * @param {TrafficManagerManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Endpoints class. + * @param client Reference to the service client */ - constructor(client: TrafficManagerManagementClientContext) { + constructor(client: TrafficManagerManagementClient) { this.client = client; } /** * Update a Traffic Manager endpoint. - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint - * to be updated. + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to + * be updated. * @param profileName The name of the Traffic Manager profile. * @param endpointType The type of the Traffic Manager endpoint to be updated. * @param endpointName The name of the Traffic Manager endpoint to be updated. * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, parameters: Models.Endpoint, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint - * to be updated. - * @param profileName The name of the Traffic Manager profile. - * @param endpointType The type of the Traffic Manager endpoint to be updated. - * @param endpointName The name of the Traffic Manager endpoint to be updated. - * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. - * @param callback The callback - */ - update(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, parameters: Models.Endpoint, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint - * to be updated. - * @param profileName The name of the Traffic Manager profile. - * @param endpointType The type of the Traffic Manager endpoint to be updated. - * @param endpointName The name of the Traffic Manager endpoint to be updated. - * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, parameters: Models.Endpoint, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, parameters: Models.Endpoint, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + profileName: string, + endpointType: EndpointType, + endpointName: string, + parameters: Endpoint, + options?: EndpointsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -68,8 +63,8 @@ export class Endpoints { parameters, options }, - updateOperationSpec, - callback) as Promise; + updateOperationSpec + ); } /** @@ -78,77 +73,39 @@ export class Endpoints { * @param profileName The name of the Traffic Manager profile. * @param endpointType The type of the Traffic Manager endpoint. * @param endpointName The name of the Traffic Manager endpoint. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. - * @param profileName The name of the Traffic Manager profile. - * @param endpointType The type of the Traffic Manager endpoint. - * @param endpointName The name of the Traffic Manager endpoint. - * @param callback The callback - */ - get(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. - * @param profileName The name of the Traffic Manager profile. - * @param endpointType The type of the Traffic Manager endpoint. - * @param endpointName The name of the Traffic Manager endpoint. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + profileName: string, + endpointType: EndpointType, + endpointName: string, + options?: EndpointsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - profileName, - endpointType, - endpointName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, profileName, endpointType, endpointName, options }, + getOperationSpec + ); } /** * Create or update a Traffic Manager endpoint. - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint - * to be created or updated. - * @param profileName The name of the Traffic Manager profile. - * @param endpointType The type of the Traffic Manager endpoint to be created or updated. - * @param endpointName The name of the Traffic Manager endpoint to be created or updated. - * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate - * operation. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, parameters: Models.Endpoint, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint - * to be created or updated. - * @param profileName The name of the Traffic Manager profile. - * @param endpointType The type of the Traffic Manager endpoint to be created or updated. - * @param endpointName The name of the Traffic Manager endpoint to be created or updated. - * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate - * operation. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, parameters: Models.Endpoint, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint - * to be created or updated. + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to + * be created or updated. * @param profileName The name of the Traffic Manager profile. * @param endpointType The type of the Traffic Manager endpoint to be created or updated. * @param endpointName The name of the Traffic Manager endpoint to be created or updated. - * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate - * operation. - * @param options The optional parameters - * @param callback The callback + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, parameters: Models.Endpoint, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, parameters: Models.Endpoint, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + profileName: string, + endpointType: EndpointType, + endpointName: string, + parameters: Endpoint, + options?: EndpointsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -158,79 +115,39 @@ export class Endpoints { parameters, options }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); } /** * Deletes a Traffic Manager endpoint. - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint - * to be deleted. + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to + * be deleted. * @param profileName The name of the Traffic Manager profile. * @param endpointType The type of the Traffic Manager endpoint to be deleted. * @param endpointName The name of the Traffic Manager endpoint to be deleted. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint - * to be deleted. - * @param profileName The name of the Traffic Manager profile. - * @param endpointType The type of the Traffic Manager endpoint to be deleted. - * @param endpointName The name of the Traffic Manager endpoint to be deleted. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint - * to be deleted. - * @param profileName The name of the Traffic Manager profile. - * @param endpointType The type of the Traffic Manager endpoint to be deleted. - * @param endpointName The name of the Traffic Manager endpoint to be deleted. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, profileName: string, endpointType: string, endpointName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + profileName: string, + endpointType: EndpointType, + endpointName: string, + options?: EndpointsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - profileName, - endpointType, - endpointName, - options - }, - deleteMethodOperationSpec, - callback) as Promise; + { resourceGroupName, profileName, endpointType, endpointName, options }, + deleteOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const updateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.profileName, - Parameters.endpointType, - Parameters.endpointName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Endpoint, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.Endpoint @@ -239,25 +156,24 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.profileName, Parameters.endpointType, Parameters.endpointName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Endpoint @@ -266,32 +182,22 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.profileName, Parameters.endpointType, Parameters.endpointName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Endpoint, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Endpoint @@ -303,25 +209,24 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.profileName, Parameters.endpointType, Parameters.endpointName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", + httpMethod: "DELETE", responses: { 200: { bodyMapper: Mappers.DeleteOperationResult @@ -331,5 +236,15 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointType, + Parameters.endpointName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operations/geographicHierarchies.ts b/sdk/trafficmanager/arm-trafficmanager/src/operations/geographicHierarchies.ts index 7beed3575e5f..ac79040e541b 100644 --- a/sdk/trafficmanager/arm-trafficmanager/src/operations/geographicHierarchies.ts +++ b/sdk/trafficmanager/arm-trafficmanager/src/operations/geographicHierarchies.ts @@ -3,64 +3,51 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/geographicHierarchiesMappers"; +import { GeographicHierarchies } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { TrafficManagerManagementClientContext } from "../trafficManagerManagementClientContext"; +import { TrafficManagerManagementClient } from "../trafficManagerManagementClient"; +import { + GeographicHierarchiesGetDefaultOptionalParams, + GeographicHierarchiesGetDefaultResponse +} from "../models"; -/** Class representing a GeographicHierarchies. */ -export class GeographicHierarchies { - private readonly client: TrafficManagerManagementClientContext; +/** Class containing GeographicHierarchies operations. */ +export class GeographicHierarchiesImpl implements GeographicHierarchies { + private readonly client: TrafficManagerManagementClient; /** - * Create a GeographicHierarchies. - * @param {TrafficManagerManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class GeographicHierarchies class. + * @param client Reference to the service client */ - constructor(client: TrafficManagerManagementClientContext) { + constructor(client: TrafficManagerManagementClient) { this.client = client; } /** * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getDefault(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - getDefault(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - getDefault(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getDefault(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getDefault( + options?: GeographicHierarchiesGetDefaultOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - getDefaultOperationSpec, - callback) as Promise; + { options }, + getDefaultOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getDefaultOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getDefaultOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default", httpMethod: "GET", - path: "providers/Microsoft.Network/trafficManagerGeographicHierarchies/default", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.TrafficManagerGeographicHierarchy @@ -69,5 +56,8 @@ const getDefaultOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operations/heatMap.ts b/sdk/trafficmanager/arm-trafficmanager/src/operations/heatMap.ts index 858cad24fbc2..9ea031fa2b93 100644 --- a/sdk/trafficmanager/arm-trafficmanager/src/operations/heatMap.ts +++ b/sdk/trafficmanager/arm-trafficmanager/src/operations/heatMap.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/heatMapMappers"; +import { HeatMap } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { TrafficManagerManagementClientContext } from "../trafficManagerManagementClientContext"; +import { TrafficManagerManagementClient } from "../trafficManagerManagementClient"; +import { HeatMapGetOptionalParams, HeatMapGetResponse } from "../models"; -/** Class representing a HeatMap. */ -export class HeatMap { - private readonly client: TrafficManagerManagementClientContext; +/** Class containing HeatMap operations. */ +export class HeatMapImpl implements HeatMap { + private readonly client: TrafficManagerManagementClient; /** - * Create a HeatMap. - * @param {TrafficManagerManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class HeatMap class. + * @param client Reference to the service client */ - constructor(client: TrafficManagerManagementClientContext) { + constructor(client: TrafficManagerManagementClient) { this.client = client; } @@ -29,54 +29,26 @@ export class HeatMap { * Gets latest heatmap for Traffic Manager profile. * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. * @param profileName The name of the Traffic Manager profile. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, profileName: string, options?: Models.HeatMapGetOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. - * @param profileName The name of the Traffic Manager profile. - * @param callback The callback - */ - get(resourceGroupName: string, profileName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. - * @param profileName The name of the Traffic Manager profile. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, profileName: string, options: Models.HeatMapGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, profileName: string, options?: Models.HeatMapGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + profileName: string, + options?: HeatMapGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - profileName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, profileName, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/heatMaps/{heatMapType}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/heatMaps/{heatMapType}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.profileName, - Parameters.heatMapType - ], - queryParameters: [ - Parameters.topLeft, - Parameters.botRight, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.HeatMapModel @@ -85,5 +57,18 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.topLeft, + Parameters.botRight + ], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.subscriptionId, + Parameters.heatMapType + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operations/index.ts b/sdk/trafficmanager/arm-trafficmanager/src/operations/index.ts index 6c8f9d8ebee2..905f82d01e88 100644 --- a/sdk/trafficmanager/arm-trafficmanager/src/operations/index.ts +++ b/sdk/trafficmanager/arm-trafficmanager/src/operations/index.ts @@ -3,8 +3,7 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./endpoints"; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operations/profiles.ts b/sdk/trafficmanager/arm-trafficmanager/src/operations/profiles.ts index df121d1e6dc9..3ab7078459b7 100644 --- a/sdk/trafficmanager/arm-trafficmanager/src/operations/profiles.ts +++ b/sdk/trafficmanager/arm-trafficmanager/src/operations/profiles.ts @@ -3,218 +3,224 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/profilesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Profiles } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { TrafficManagerManagementClientContext } from "../trafficManagerManagementClientContext"; +import { TrafficManagerManagementClient } from "../trafficManagerManagementClient"; +import { + Profile, + ProfilesListByResourceGroupOptionalParams, + ProfilesListBySubscriptionOptionalParams, + CheckTrafficManagerRelativeDnsNameAvailabilityParameters, + ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityOptionalParams, + ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityResponse, + ProfilesListByResourceGroupResponse, + ProfilesListBySubscriptionResponse, + ProfilesGetOptionalParams, + ProfilesGetResponse, + ProfilesCreateOrUpdateOptionalParams, + ProfilesCreateOrUpdateResponse, + ProfilesDeleteOptionalParams, + ProfilesDeleteResponse, + ProfilesUpdateOptionalParams, + ProfilesUpdateResponse +} from "../models"; -/** Class representing a Profiles. */ -export class Profiles { - private readonly client: TrafficManagerManagementClientContext; +/// +/** Class containing Profiles operations. */ +export class ProfilesImpl implements Profiles { + private readonly client: TrafficManagerManagementClient; /** - * Create a Profiles. - * @param {TrafficManagerManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Profiles class. + * @param client Reference to the service client */ - constructor(client: TrafficManagerManagementClientContext) { + constructor(client: TrafficManagerManagementClient) { this.client = client; } /** - * Checks the availability of a Traffic Manager Relative DNS name. - * @param parameters The Traffic Manager name parameters supplied to the - * CheckTrafficManagerNameAvailability operation. - * @param [options] The optional parameters - * @returns Promise + * Lists all Traffic Manager profiles within a resource group. + * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to + * be listed. + * @param options The options parameters. */ - checkTrafficManagerRelativeDnsNameAvailability(parameters: Models.CheckTrafficManagerRelativeDnsNameAvailabilityParameters, options?: msRest.RequestOptionsBase): Promise; + public listByResourceGroup( + resourceGroupName: string, + options?: ProfilesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ProfilesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ProfilesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param parameters The Traffic Manager name parameters supplied to the - * CheckTrafficManagerNameAvailability operation. - * @param callback The callback + * Lists all Traffic Manager profiles within a subscription. + * @param options The options parameters. */ - checkTrafficManagerRelativeDnsNameAvailability(parameters: Models.CheckTrafficManagerRelativeDnsNameAvailabilityParameters, callback: msRest.ServiceCallback): void; + public listBySubscription( + options?: ProfilesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: ProfilesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + } + + private async *listBySubscriptionPagingAll( + options?: ProfilesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + /** + * Checks the availability of a Traffic Manager Relative DNS name. * @param parameters The Traffic Manager name parameters supplied to the - * CheckTrafficManagerNameAvailability operation. - * @param options The optional parameters - * @param callback The callback + * CheckTrafficManagerNameAvailability operation. + * @param options The options parameters. */ - checkTrafficManagerRelativeDnsNameAvailability(parameters: Models.CheckTrafficManagerRelativeDnsNameAvailabilityParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkTrafficManagerRelativeDnsNameAvailability(parameters: Models.CheckTrafficManagerRelativeDnsNameAvailabilityParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + checkTrafficManagerRelativeDnsNameAvailability( + parameters: CheckTrafficManagerRelativeDnsNameAvailabilityParameters, + options?: ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - parameters, - options - }, - checkTrafficManagerRelativeDnsNameAvailabilityOperationSpec, - callback) as Promise; + { parameters, options }, + checkTrafficManagerRelativeDnsNameAvailabilityOperationSpec + ); } /** * Lists all Traffic Manager profiles within a resource group. - * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles - * to be listed. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles - * to be listed. - * @param callback The callback + * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to + * be listed. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles - * to be listed. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: ProfilesListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** * Lists all Traffic Manager profiles within a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscription(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscription( + options?: ProfilesListBySubscriptionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listBySubscriptionOperationSpec, - callback) as Promise; + { options }, + listBySubscriptionOperationSpec + ); } /** * Gets a Traffic Manager profile. * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. * @param profileName The name of the Traffic Manager profile. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. - * @param profileName The name of the Traffic Manager profile. - * @param callback The callback - */ - get(resourceGroupName: string, profileName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. - * @param profileName The name of the Traffic Manager profile. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, profileName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + profileName: string, + options?: ProfilesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - profileName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, profileName, options }, + getOperationSpec + ); } /** * Create or update a Traffic Manager profile. * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. * @param profileName The name of the Traffic Manager profile. - * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate - * operation. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, profileName: string, parameters: Models.Profile, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. - * @param profileName The name of the Traffic Manager profile. - * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate - * operation. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, profileName: string, parameters: Models.Profile, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. - * @param profileName The name of the Traffic Manager profile. - * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate - * operation. - * @param options The optional parameters - * @param callback The callback + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, profileName: string, parameters: Models.Profile, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, profileName: string, parameters: Models.Profile, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + profileName: string, + parameters: Profile, + options?: ProfilesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - profileName, - parameters, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, profileName, parameters, options }, + createOrUpdateOperationSpec + ); } /** * Deletes a Traffic Manager profile. - * @param resourceGroupName The name of the resource group containing the Traffic Manager profile - * to be deleted. + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be + * deleted. * @param profileName The name of the Traffic Manager profile to be deleted. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager profile - * to be deleted. - * @param profileName The name of the Traffic Manager profile to be deleted. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, profileName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager profile - * to be deleted. - * @param profileName The name of the Traffic Manager profile to be deleted. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, profileName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + profileName: string, + options?: ProfilesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - profileName, - options - }, - deleteMethodOperationSpec, - callback) as Promise; + { resourceGroupName, profileName, options }, + deleteOperationSpec + ); } /** @@ -222,56 +228,26 @@ export class Profiles { * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. * @param profileName The name of the Traffic Manager profile. * @param parameters The Traffic Manager profile parameters supplied to the Update operation. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, profileName: string, parameters: Models.Profile, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. - * @param profileName The name of the Traffic Manager profile. - * @param parameters The Traffic Manager profile parameters supplied to the Update operation. - * @param callback The callback - */ - update(resourceGroupName: string, profileName: string, parameters: Models.Profile, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. - * @param profileName The name of the Traffic Manager profile. - * @param parameters The Traffic Manager profile parameters supplied to the Update operation. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, profileName: string, parameters: Models.Profile, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, profileName: string, parameters: Models.Profile, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + profileName: string, + parameters: Profile, + options?: ProfilesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - profileName, - parameters, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, profileName, parameters, options }, + updateOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkTrafficManagerRelativeDnsNameAvailabilityOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkTrafficManagerRelativeDnsNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Network/checkTrafficManagerNameAvailability", httpMethod: "POST", - path: "providers/Microsoft.Network/checkTrafficManagerNameAvailability", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.CheckTrafficManagerRelativeDnsNameAvailabilityParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.TrafficManagerNameAvailability @@ -280,22 +256,17 @@ const checkTrafficManagerRelativeDnsNameAvailabilityOperationSpec: msRest.Operat bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ProfileListResult @@ -304,21 +275,19 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listBySubscriptionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficmanagerprofiles", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficmanagerprofiles", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ProfileListResult @@ -327,23 +296,15 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.profileName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.Profile @@ -352,30 +313,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.profileName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Profile, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Profile @@ -387,23 +338,22 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.profileName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", + httpMethod: "DELETE", responses: { 200: { bodyMapper: Mappers.DeleteOperationResult @@ -413,30 +363,20 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.profileName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Profile, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.Profile @@ -445,5 +385,15 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", serializer }; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operations/trafficManagerUserMetricsKeys.ts b/sdk/trafficmanager/arm-trafficmanager/src/operations/trafficManagerUserMetricsKeys.ts index 0a514e8258d8..c508104ff9d2 100644 --- a/sdk/trafficmanager/arm-trafficmanager/src/operations/trafficManagerUserMetricsKeys.ts +++ b/sdk/trafficmanager/arm-trafficmanager/src/operations/trafficManagerUserMetricsKeys.ts @@ -3,115 +3,76 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/trafficManagerUserMetricsKeysMappers"; +import { TrafficManagerUserMetricsKeys } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { TrafficManagerManagementClientContext } from "../trafficManagerManagementClientContext"; +import { TrafficManagerManagementClient } from "../trafficManagerManagementClient"; +import { + TrafficManagerUserMetricsKeysGetOptionalParams, + TrafficManagerUserMetricsKeysGetResponse, + TrafficManagerUserMetricsKeysCreateOrUpdateOptionalParams, + TrafficManagerUserMetricsKeysCreateOrUpdateResponse, + TrafficManagerUserMetricsKeysDeleteOptionalParams, + TrafficManagerUserMetricsKeysDeleteResponse +} from "../models"; -/** Class representing a TrafficManagerUserMetricsKeys. */ -export class TrafficManagerUserMetricsKeys { - private readonly client: TrafficManagerManagementClientContext; +/** Class containing TrafficManagerUserMetricsKeys operations. */ +export class TrafficManagerUserMetricsKeysImpl + implements TrafficManagerUserMetricsKeys { + private readonly client: TrafficManagerManagementClient; /** - * Create a TrafficManagerUserMetricsKeys. - * @param {TrafficManagerManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class TrafficManagerUserMetricsKeys class. + * @param client Reference to the service client */ - constructor(client: TrafficManagerManagementClientContext) { + constructor(client: TrafficManagerManagementClient) { this.client = client; } /** * Get the subscription-level key used for Real User Metrics collection. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - get(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - get(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - getOperationSpec, - callback) as Promise; + get( + options?: TrafficManagerUserMetricsKeysGetOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, getOperationSpec); } /** * Create or update a subscription-level key used for Real User Metrics collection. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - createOrUpdate(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + options?: TrafficManagerUserMetricsKeysCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { options }, + createOrUpdateOperationSpec + ); } /** * Delete a subscription-level key used for Real User Metrics collection. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - deleteMethod(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - deleteMethodOperationSpec, - callback) as Promise; + delete( + options?: TrafficManagerUserMetricsKeysDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, deleteOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.UserMetricsModel @@ -120,21 +81,15 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 201: { bodyMapper: Mappers.UserMetricsModel @@ -143,21 +98,15 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const deleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.DeleteOperationResult @@ -166,5 +115,8 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/endpoints.ts b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/endpoints.ts new file mode 100644 index 000000000000..c9389cf6c000 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/endpoints.ts @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Endpoint, + EndpointType, + EndpointsUpdateOptionalParams, + EndpointsUpdateResponse, + EndpointsGetOptionalParams, + EndpointsGetResponse, + EndpointsCreateOrUpdateOptionalParams, + EndpointsCreateOrUpdateResponse, + EndpointsDeleteOptionalParams, + EndpointsDeleteResponse +} from "../models"; + +/** Interface representing a Endpoints. */ +export interface Endpoints { + /** + * Update a Traffic Manager endpoint. + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to + * be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + profileName: string, + endpointType: EndpointType, + endpointName: string, + parameters: Endpoint, + options?: EndpointsUpdateOptionalParams + ): Promise; + /** + * Gets a Traffic Manager endpoint. + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + profileName: string, + endpointType: EndpointType, + endpointName: string, + options?: EndpointsGetOptionalParams + ): Promise; + /** + * Create or update a Traffic Manager endpoint. + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to + * be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + profileName: string, + endpointType: EndpointType, + endpointName: string, + parameters: Endpoint, + options?: EndpointsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a Traffic Manager endpoint. + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to + * be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + profileName: string, + endpointType: EndpointType, + endpointName: string, + options?: EndpointsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/geographicHierarchies.ts b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/geographicHierarchies.ts new file mode 100644 index 000000000000..471b4746e32b --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/geographicHierarchies.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + GeographicHierarchiesGetDefaultOptionalParams, + GeographicHierarchiesGetDefaultResponse +} from "../models"; + +/** Interface representing a GeographicHierarchies. */ +export interface GeographicHierarchies { + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * @param options The options parameters. + */ + getDefault( + options?: GeographicHierarchiesGetDefaultOptionalParams + ): Promise; +} diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/heatMap.ts b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/heatMap.ts new file mode 100644 index 000000000000..3f4f17c25db7 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/heatMap.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { HeatMapGetOptionalParams, HeatMapGetResponse } from "../models"; + +/** Interface representing a HeatMap. */ +export interface HeatMap { + /** + * Gets latest heatmap for Traffic Manager profile. + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + profileName: string, + options?: HeatMapGetOptionalParams + ): Promise; +} diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/index.ts b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..905f82d01e88 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./endpoints"; +export * from "./profiles"; +export * from "./geographicHierarchies"; +export * from "./heatMap"; +export * from "./trafficManagerUserMetricsKeys"; diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/profiles.ts b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/profiles.ts new file mode 100644 index 000000000000..2dc5dab5f2b3 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/profiles.ts @@ -0,0 +1,106 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Profile, + ProfilesListByResourceGroupOptionalParams, + ProfilesListBySubscriptionOptionalParams, + CheckTrafficManagerRelativeDnsNameAvailabilityParameters, + ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityOptionalParams, + ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityResponse, + ProfilesGetOptionalParams, + ProfilesGetResponse, + ProfilesCreateOrUpdateOptionalParams, + ProfilesCreateOrUpdateResponse, + ProfilesDeleteOptionalParams, + ProfilesDeleteResponse, + ProfilesUpdateOptionalParams, + ProfilesUpdateResponse +} from "../models"; + +/// +/** Interface representing a Profiles. */ +export interface Profiles { + /** + * Lists all Traffic Manager profiles within a resource group. + * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to + * be listed. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ProfilesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all Traffic Manager profiles within a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: ProfilesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * @param parameters The Traffic Manager name parameters supplied to the + * CheckTrafficManagerNameAvailability operation. + * @param options The options parameters. + */ + checkTrafficManagerRelativeDnsNameAvailability( + parameters: CheckTrafficManagerRelativeDnsNameAvailabilityParameters, + options?: ProfilesCheckTrafficManagerRelativeDnsNameAvailabilityOptionalParams + ): Promise; + /** + * Gets a Traffic Manager profile. + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + profileName: string, + options?: ProfilesGetOptionalParams + ): Promise; + /** + * Create or update a Traffic Manager profile. + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + profileName: string, + parameters: Profile, + options?: ProfilesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a Traffic Manager profile. + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be + * deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + profileName: string, + options?: ProfilesDeleteOptionalParams + ): Promise; + /** + * Update a Traffic Manager profile. + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + profileName: string, + parameters: Profile, + options?: ProfilesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/trafficManagerUserMetricsKeys.ts b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/trafficManagerUserMetricsKeys.ts new file mode 100644 index 000000000000..e72e2265b390 --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/src/operationsInterfaces/trafficManagerUserMetricsKeys.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + TrafficManagerUserMetricsKeysGetOptionalParams, + TrafficManagerUserMetricsKeysGetResponse, + TrafficManagerUserMetricsKeysCreateOrUpdateOptionalParams, + TrafficManagerUserMetricsKeysCreateOrUpdateResponse, + TrafficManagerUserMetricsKeysDeleteOptionalParams, + TrafficManagerUserMetricsKeysDeleteResponse +} from "../models"; + +/** Interface representing a TrafficManagerUserMetricsKeys. */ +export interface TrafficManagerUserMetricsKeys { + /** + * Get the subscription-level key used for Real User Metrics collection. + * @param options The options parameters. + */ + get( + options?: TrafficManagerUserMetricsKeysGetOptionalParams + ): Promise; + /** + * Create or update a subscription-level key used for Real User Metrics collection. + * @param options The options parameters. + */ + createOrUpdate( + options?: TrafficManagerUserMetricsKeysCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete a subscription-level key used for Real User Metrics collection. + * @param options The options parameters. + */ + delete( + options?: TrafficManagerUserMetricsKeysDeleteOptionalParams + ): Promise; +} diff --git a/sdk/trafficmanager/arm-trafficmanager/src/trafficManagerManagementClient.ts b/sdk/trafficmanager/arm-trafficmanager/src/trafficManagerManagementClient.ts index b89b90ca52dd..f42ee318a105 100644 --- a/sdk/trafficmanager/arm-trafficmanager/src/trafficManagerManagementClient.ts +++ b/sdk/trafficmanager/arm-trafficmanager/src/trafficManagerManagementClient.ts @@ -3,54 +3,96 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { TrafficManagerManagementClientContext } from "./trafficManagerManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + EndpointsImpl, + ProfilesImpl, + GeographicHierarchiesImpl, + HeatMapImpl, + TrafficManagerUserMetricsKeysImpl +} from "./operations"; +import { + Endpoints, + Profiles, + GeographicHierarchies, + HeatMap, + TrafficManagerUserMetricsKeys +} from "./operationsInterfaces"; +import { TrafficManagerManagementClientOptionalParams } from "./models"; - -class TrafficManagerManagementClient extends TrafficManagerManagementClientContext { - // Operation groups - endpoints: operations.Endpoints; - profiles: operations.Profiles; - geographicHierarchies: operations.GeographicHierarchies; - heatMap: operations.HeatMap; - trafficManagerUserMetricsKeys: operations.TrafficManagerUserMetricsKeys; +export class TrafficManagerManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the TrafficManagerManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Gets subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param [options] The parameter options + * subscription. The subscription ID forms part of the URI for every service call. + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.TrafficManagerManagementClientOptions) { - super(credentials, subscriptionId, options); - this.endpoints = new operations.Endpoints(this); - this.profiles = new operations.Profiles(this); - this.geographicHierarchies = new operations.GeographicHierarchies(this); - this.heatMap = new operations.HeatMap(this); - this.trafficManagerUserMetricsKeys = new operations.TrafficManagerUserMetricsKeys(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: TrafficManagerManagementClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: TrafficManagerManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-trafficmanager/6.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - TrafficManagerManagementClient, - TrafficManagerManagementClientContext, - Models as TrafficManagerManagementModels, - Mappers as TrafficManagerManagementMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2018-08-01"; + this.endpoints = new EndpointsImpl(this); + this.profiles = new ProfilesImpl(this); + this.geographicHierarchies = new GeographicHierarchiesImpl(this); + this.heatMap = new HeatMapImpl(this); + this.trafficManagerUserMetricsKeys = new TrafficManagerUserMetricsKeysImpl( + this + ); + } + + endpoints: Endpoints; + profiles: Profiles; + geographicHierarchies: GeographicHierarchies; + heatMap: HeatMap; + trafficManagerUserMetricsKeys: TrafficManagerUserMetricsKeys; +} diff --git a/sdk/trafficmanager/arm-trafficmanager/src/trafficManagerManagementClientContext.ts b/sdk/trafficmanager/arm-trafficmanager/src/trafficManagerManagementClientContext.ts deleted file mode 100644 index ae6556c0009a..000000000000 --- a/sdk/trafficmanager/arm-trafficmanager/src/trafficManagerManagementClientContext.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import { TokenCredential } from "@azure/core-auth"; - -const packageName = "@azure/arm-trafficmanager"; -const packageVersion = "5.1.0"; - -export class TrafficManagerManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the TrafficManagerManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId Gets subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.TrafficManagerManagementClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if (!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2018-08-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/trafficmanager/arm-trafficmanager/test/sampleTest.ts b/sdk/trafficmanager/arm-trafficmanager/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/trafficmanager/arm-trafficmanager/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/trafficmanager/arm-trafficmanager/tsconfig.json b/sdk/trafficmanager/arm-trafficmanager/tsconfig.json index 422b584abd5e..9ea7c7414e8f 100644 --- a/sdk/trafficmanager/arm-trafficmanager/tsconfig.json +++ b/sdk/trafficmanager/arm-trafficmanager/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,10 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", - "importHelpers": true + "outDir": "./dist-esm", + "importHelpers": true, + "paths": { "@azure/arm-trafficmanager": ["./src/index"] } }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/trafficmanager/ci.yml b/sdk/trafficmanager/ci.yml new file mode 100644 index 000000000000..d88080ccdef3 --- /dev/null +++ b/sdk/trafficmanager/ci.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/trafficmanager/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/trafficmanager/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: trafficmanager + Artifacts: + - name: azure-arm-trafficmanager + safeName: azurearmtrafficmanager + \ No newline at end of file diff --git a/sdk/visualstudio/arm-visualstudio/CHANGELOG.md b/sdk/visualstudio/arm-visualstudio/CHANGELOG.md new file mode 100644 index 000000000000..30f6651fb683 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 4.0.0-beta.1 (2022-01-21) + +The package of @azure/arm-visualstudio is using our next generation design principles since version 4.0.0-beta.1, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/visualstudio/arm-visualstudio/LICENSE b/sdk/visualstudio/arm-visualstudio/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/visualstudio/arm-visualstudio/README.md b/sdk/visualstudio/arm-visualstudio/README.md index d198fc47b259..2b94e363bf5e 100644 --- a/sdk/visualstudio/arm-visualstudio/README.md +++ b/sdk/visualstudio/arm-visualstudio/README.md @@ -1,99 +1,98 @@ -## Azure VisualStudioResourceProviderClient SDK for JavaScript +# Azure Visual Studio Resource Provider client library for JavaScript -This package contains an isomorphic SDK for VisualStudioResourceProviderClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Visual Studio Resource Provider client. + +Use these APIs to manage Visual Studio Team Services resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://docs.microsoft.com/en-us/rest/api/index. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/visualstudio/arm-visualstudio) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-visualstudio) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-visualstudio?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. -### How to Install +### Prerequisites -``` +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-visualstudio` package + +Install the Azure Visual Studio Resource Provider client library for JavaScript with `npm`: + +```bash npm install @azure/arm-visualstudio ``` -### How to use +### Create and authenticate a `VisualStudioResourceProviderClient` -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure Visual Studio Resource Provider API, you will need the `endpoint` of your Azure Visual Studio Resource Provider resource and a `credential`. The Azure Visual Studio Resource Provider client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Visual Studio Resource Provider resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -``` -npm install @azure/ms-rest-nodeauth -``` +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -##### Sample code - -```ts -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { VisualStudioResourceProviderClient, VisualStudioResourceProviderModels, VisualStudioResourceProviderMappers } from "@azure/arm-visualstudio"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new VisualStudioResourceProviderClient(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +```bash +npm install @azure/identity ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure Visual Studio Resource Provider** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Install @azure/ms-rest-browserauth +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). +```javascript +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new VisualStudioResourceProviderClient(new DefaultAzureCredential(), subscriptionId); ``` -npm install @azure/ms-rest-browserauth -``` -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-visualstudio sample - - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### VisualStudioResourceProviderClient + +`VisualStudioResourceProviderClient` is the primary interface for developers using the Azure Visual Studio Resource Provider client library. Explore the methods on this client object to understand the different features of the Azure Visual Studio Resource Provider service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` -## Related projects +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +## Next steps +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fvisualstudio%2Farm-visualstudio%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/visualstudio/arm-visualstudio/_meta.json b/sdk/visualstudio/arm-visualstudio/_meta.json new file mode 100644 index 000000000000..6bad8d44b1bc --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "readme": "specification/visualstudio/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/visualstudio/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1 --generate-sample=true", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" +} \ No newline at end of file diff --git a/sdk/visualstudio/arm-visualstudio/api-extractor.json b/sdk/visualstudio/arm-visualstudio/api-extractor.json new file mode 100644 index 000000000000..3443fb5fab3a --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-visualstudio.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/visualstudio/arm-visualstudio/package.json b/sdk/visualstudio/arm-visualstudio/package.json index e5a4f09f2f82..d65e6cb2e047 100644 --- a/sdk/visualstudio/arm-visualstudio/package.json +++ b/sdk/visualstudio/arm-visualstudio/package.json @@ -1,56 +1,105 @@ { "name": "@azure/arm-visualstudio", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "VisualStudioResourceProviderClient Library with typescript type definitions for node.js and browser.", - "version": "2.2.0", + "description": "A generated SDK for VisualStudioResourceProviderClient.", + "version": "4.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", - "tslib": "^1.9.3" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-visualstudio.js", - "module": "./esm/visualStudioResourceProviderClient.js", - "types": "./esm/visualStudioResourceProviderClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-visualstudio.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", - "uglify-js": "^3.4.9" + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/main/sdk/visualstudio/arm-visualstudio", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/visualstudio/arm-visualstudio", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" - }, - "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-visualstudio.js.map'\" -o ./dist/arm-visualstudio.min.js ./dist/arm-visualstudio.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, - "autoPublish": true + "//metadata": { + "constantPaths": [ + { + "path": "src/VisualStudioResourceProviderClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "//sampleConfiguration": { + "productName": "", + "productSlugs": ["azure"], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-visualstudio?view=azure-node-preview" + } } diff --git a/sdk/visualstudio/arm-visualstudio/recordings/node/my_test/recording_sample_test.js b/sdk/visualstudio/arm-visualstudio/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/visualstudio/arm-visualstudio/review/arm-visualstudio.api.md b/sdk/visualstudio/arm-visualstudio/review/arm-visualstudio.api.md new file mode 100644 index 000000000000..cb0f53b125ee --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/review/arm-visualstudio.api.md @@ -0,0 +1,314 @@ +## API Report File for "@azure/arm-visualstudio" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type AccountResource = Resource & { + properties?: { + [propertyName: string]: string; + }; +}; + +// @public +export interface AccountResourceListResult { + value?: AccountResource[]; +} + +// @public +export interface AccountResourceRequest { + accountName?: string; + location?: string; + operationType?: AccountResourceRequestOperationType; + properties?: { + [propertyName: string]: string; + }; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type AccountResourceRequestOperationType = "unknown" | "create" | "update" | "link"; + +// @public +export interface Accounts { + checkNameAvailability(body: CheckNameAvailabilityParameter, options?: AccountsCheckNameAvailabilityOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, resourceName: string, body: AccountResourceRequest, options?: AccountsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, options?: AccountsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, options?: AccountsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams): Promise; + update(resourceGroupName: string, resourceName: string, body: AccountTagRequest, options?: AccountsUpdateOptionalParams): Promise; +} + +// @public +export interface AccountsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +// @public +export interface AccountsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsCreateOrUpdateResponse = AccountResource; + +// @public +export interface AccountsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface AccountsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsGetResponse = AccountResource; + +// @public +export interface AccountsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListByResourceGroupResponse = AccountResourceListResult; + +// @public +export interface AccountsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsUpdateResponse = AccountResource; + +// @public +export interface AccountTagRequest { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface CheckNameAvailabilityParameter { + resourceName?: string; + resourceType?: string; +} + +// @public +export interface CheckNameAvailabilityResult { + message?: string; + nameAvailable?: boolean; +} + +// @public +export type ExtensionResource = Resource & { + plan?: ExtensionResourcePlan; + properties?: { + [propertyName: string]: string; + }; +}; + +// @public +export interface ExtensionResourceListResult { + value?: ExtensionResource[]; +} + +// @public +export interface ExtensionResourcePlan { + name?: string; + product?: string; + promotionCode?: string; + publisher?: string; + version?: string; +} + +// @public +export interface ExtensionResourceRequest { + location?: string; + plan?: ExtensionResourcePlan; + properties?: { + [propertyName: string]: string; + }; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface Extensions { + create(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, body: ExtensionResourceRequest, options?: ExtensionsCreateOptionalParams): Promise; + delete(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, options?: ExtensionsDeleteOptionalParams): Promise; + get(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, options?: ExtensionsGetOptionalParams): Promise; + listByAccount(resourceGroupName: string, accountResourceName: string, options?: ExtensionsListByAccountOptionalParams): Promise; + update(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, body: ExtensionResourceRequest, options?: ExtensionsUpdateOptionalParams): Promise; +} + +// @public +export interface ExtensionsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsCreateResponse = ExtensionResource; + +// @public +export interface ExtensionsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ExtensionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsGetResponse = ExtensionResource; + +// @public +export interface ExtensionsListByAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsListByAccountResponse = ExtensionResourceListResult; + +// @public +export interface ExtensionsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsUpdateResponse = ExtensionResource; + +// @public +export interface Operation { + display?: OperationProperties; + name?: string; +} + +// @public +export interface OperationListResult { + value?: Operation[]; +} + +// @public +export interface OperationProperties { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): Promise; +} + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type ProjectResource = Resource & { + properties?: { + [propertyName: string]: string; + }; +}; + +// @public +export interface ProjectResourceListResult { + value?: ProjectResource[]; +} + +// @public +export interface Projects { + beginCreate(resourceGroupName: string, rootResourceName: string, resourceName: string, body: ProjectResource, options?: ProjectsCreateOptionalParams): Promise, ProjectsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, rootResourceName: string, resourceName: string, body: ProjectResource, options?: ProjectsCreateOptionalParams): Promise; + get(resourceGroupName: string, rootResourceName: string, resourceName: string, options?: ProjectsGetOptionalParams): Promise; + getJobStatus(resourceGroupName: string, rootResourceName: string, resourceName: string, subContainerName: string, operation: string, options?: ProjectsGetJobStatusOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, rootResourceName: string, options?: ProjectsListByResourceGroupOptionalParams): Promise; + update(resourceGroupName: string, rootResourceName: string, resourceName: string, body: ProjectResource, options?: ProjectsUpdateOptionalParams): Promise; +} + +// @public +export interface ProjectsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; + validating?: string; +} + +// @public +export type ProjectsCreateResponse = ProjectResource; + +// @public +export interface ProjectsGetJobStatusOptionalParams extends coreClient.OperationOptions { + jobId?: string; +} + +// @public +export type ProjectsGetJobStatusResponse = ProjectResource; + +// @public +export interface ProjectsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProjectsGetResponse = ProjectResource; + +// @public +export interface ProjectsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProjectsListByResourceGroupResponse = ProjectResourceListResult; + +// @public +export interface ProjectsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProjectsUpdateResponse = ProjectResource; + +// @public +export interface Resource { + readonly id?: string; + location?: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public (undocumented) +export class VisualStudioResourceProviderClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: VisualStudioResourceProviderClientOptionalParams); + // (undocumented) + accounts: Accounts; + // (undocumented) + apiVersion: string; + // (undocumented) + extensions: Extensions; + // (undocumented) + operations: Operations; + // (undocumented) + projects: Projects; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface VisualStudioResourceProviderClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/visualstudio/arm-visualstudio/rollup.config.js b/sdk/visualstudio/arm-visualstudio/rollup.config.js index f8a3b90a0bbe..9be1955eb7f1 100644 --- a/sdk/visualstudio/arm-visualstudio/rollup.config.js +++ b/sdk/visualstudio/arm-visualstudio/rollup.config.js @@ -1,31 +1,188 @@ -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + /** - * @type {import('rollup').RollupFileOptions} + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. */ -const config = { - input: './esm/visualStudioResourceProviderClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], - output: { - file: "./dist/arm-visualstudio.js", - format: "umd", - name: "Azure.ArmVisualstudio", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */` - }, - plugins: [ - nodeResolve({ module: true }) - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/visualstudio/arm-visualstudio/sample.env b/sdk/visualstudio/arm-visualstudio/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/checkAvailabilityOfAnAccountName.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/checkAvailabilityOfAnAccountName.ts new file mode 100644 index 000000000000..86d3ba85eb30 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/checkAvailabilityOfAnAccountName.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Checks if the specified Visual Studio Team Services account name is available. Resource name can be either an account name or an account name and PUID. + * + * @summary Checks if the specified Visual Studio Team Services account name is available. Resource name can be either an account name or an account name and PUID. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CheckNameAvailability.json + */ +import { + CheckNameAvailabilityParameter, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function checkAvailabilityOfAnAccountName() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const body: CheckNameAvailabilityParameter = { + resourceName: "ExampleName", + resourceType: "Account" + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.accounts.checkNameAvailability(body); + console.log(result); +} + +checkAvailabilityOfAnAccountName().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/createAProjectResource.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/createAProjectResource.ts new file mode 100644 index 000000000000..163092104149 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/createAProjectResource.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a Team Services project in the collection with the specified name. 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process templates). + * + * @summary Creates a Team Services project in the collection with the specified name. 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process templates). + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CreateProjectResource.json + */ +import { + ProjectResource, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAProjectResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const body: ProjectResource = { + name: "ExampleProject", + type: "Microsoft.VisualStudio/account/project", + id: + "/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/Microsoft.VisualStudio/account/ExampleAccount/project/ExampleProject", + location: "Central US", + properties: { + processTemplateId: "6B724908-EF14-45CF-84F8-768B5384DA45", + versionControlOption: "Git" + }, + tags: {} + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.projects.beginCreateAndWait( + resourceGroupName, + rootResourceName, + resourceName, + body + ); + console.log(result); +} + +createAProjectResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/createAnAccountResource.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/createAnAccountResource.ts new file mode 100644 index 000000000000..9def51f5c57c --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/createAnAccountResource.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates tags for Visual Studio Team Services account resource. + * + * @summary Updates tags for Visual Studio Team Services account resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateTags.json + */ +import { + AccountTagRequest, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAnAccountResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const resourceName = "Example"; + const body: AccountTagRequest = { tags: { tag1: "value1" } }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.accounts.update( + resourceGroupName, + resourceName, + body + ); + console.log(result); +} + +createAnAccountResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/createAnExtensionResource.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/createAnExtensionResource.ts new file mode 100644 index 000000000000..5df2b731f189 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/createAnExtensionResource.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Registers the extension with a Visual Studio Team Services account. + * + * @summary Registers the extension with a Visual Studio Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CreateExtensionResource.json + */ +import { + ExtensionResourceRequest, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const extensionResourceName = "ms.example"; + const body: ExtensionResourceRequest = { + location: "Central US", + plan: { + name: "ExamplePlan", + product: "ExampleExtensionName", + promotionCode: "", + publisher: "ExampleExtensionPublisher", + version: "1.0" + }, + properties: {}, + tags: {} + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.extensions.create( + resourceGroupName, + accountResourceName, + extensionResourceName, + body + ); + console.log(result); +} + +createAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/deleteAnAccountResource.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/deleteAnAccountResource.ts new file mode 100644 index 000000000000..9d0c9486dc5e --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/deleteAnAccountResource.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a Visual Studio Team Services account resource. + * + * @summary Deletes a Visual Studio Team Services account resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/DeleteResource.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deleteAnAccountResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const resourceName = "Example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.accounts.delete(resourceGroupName, resourceName); + console.log(result); +} + +deleteAnAccountResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/deleteAnExtensionResource.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/deleteAnExtensionResource.ts new file mode 100644 index 000000000000..48ebd0528a92 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/deleteAnExtensionResource.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Removes an extension resource registration for a Visual Studio Team Services account. + * + * @summary Removes an extension resource registration for a Visual Studio Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/DeleteExtensionResource.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deleteAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "Example"; + const extensionResourceName = "ms.example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.extensions.delete( + resourceGroupName, + accountResourceName, + extensionResourceName + ); + console.log(result); +} + +deleteAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfAccountResourcesInTheResourceGroup.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfAccountResourcesInTheResourceGroup.ts new file mode 100644 index 000000000000..f3413e721727 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfAccountResourcesInTheResourceGroup.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all Visual Studio Team Services account resources under the resource group linked to the specified Azure subscription. + * + * @summary Gets all Visual Studio Team Services account resources under the resource group linked to the specified Azure subscription. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetResources_List.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAListOfAccountResourcesInTheResourceGroup() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.accounts.listByResourceGroup(resourceGroupName); + console.log(result); +} + +getAListOfAccountResourcesInTheResourceGroup().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfExtensionResourcesWithinTheResourceGroup.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfExtensionResourcesWithinTheResourceGroup.ts new file mode 100644 index 000000000000..405175ca9651 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfExtensionResourcesWithinTheResourceGroup.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of the extension resources created within the resource group. + * + * @summary Gets the details of the extension resources created within the resource group. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetExtensionResources_List.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAListOfExtensionResourcesWithinTheResourceGroup() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.extensions.listByAccount( + resourceGroupName, + accountResourceName + ); + console.log(result); +} + +getAListOfExtensionResourcesWithinTheResourceGroup().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfOperationsForThisResourceProvider.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfOperationsForThisResourceProvider.ts new file mode 100644 index 000000000000..c57f3675b660 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfOperationsForThisResourceProvider.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of all operations possible on the Microsoft.VisualStudio resource provider. + * + * @summary Gets the details of all operations possible on the Microsoft.VisualStudio resource provider. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetOperations.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAListOfOperationsForThisResourceProvider() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.operations.list(); + console.log(result); +} + +getAListOfOperationsForThisResourceProvider().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfProjectResourcesInTheTeamServicesAccount.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfProjectResourcesInTheTeamServicesAccount.ts new file mode 100644 index 000000000000..dd2fe76775a0 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/getAListOfProjectResourcesInTheTeamServicesAccount.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all Visual Studio Team Services project resources created in the specified Team Services account. + * + * @summary Gets all Visual Studio Team Services project resources created in the specified Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectResources_List.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAListOfProjectResourcesInTheTeamServicesAccount() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.projects.listByResourceGroup( + resourceGroupName, + rootResourceName + ); + console.log(result); +} + +getAListOfProjectResourcesInTheTeamServicesAccount().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/getAProjectResource.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/getAProjectResource.ts new file mode 100644 index 000000000000..9393008543c5 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/getAProjectResource.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of a Team Services project resource. + * + * @summary Gets the details of a Team Services project resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectResource.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAProjectResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.projects.get( + resourceGroupName, + rootResourceName, + resourceName + ); + console.log(result); +} + +getAProjectResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/getAnAccountResource.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/getAnAccountResource.ts new file mode 100644 index 000000000000..6d4bd15fb872 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/getAnAccountResource.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the Visual Studio Team Services account resource details. + * + * @summary Gets the Visual Studio Team Services account resource details. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetResource.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAnAccountResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const resourceName = "Example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.accounts.get(resourceGroupName, resourceName); + console.log(result); +} + +getAnAccountResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/getAnExtensionResource.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/getAnExtensionResource.ts new file mode 100644 index 000000000000..a9649c8d47d8 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/getAnExtensionResource.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of an extension associated with a Visual Studio Team Services account resource. + * + * @summary Gets the details of an extension associated with a Visual Studio Team Services account resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetExtensionResource.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const extensionResourceName = "ms.example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.extensions.get( + resourceGroupName, + accountResourceName, + extensionResourceName + ); + console.log(result); +} + +getAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/getTheStatusOfTheProjectCreationJob.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/getTheStatusOfTheProjectCreationJob.ts new file mode 100644 index 000000000000..a30877872e59 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/getTheStatusOfTheProjectCreationJob.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the status of the project resource creation job. + * + * @summary Gets the status of the project resource creation job. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectJobStatus.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getTheStatusOfTheProjectCreationJob() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const subContainerName = "ExampleProject"; + const operation = "put"; + const jobId = "126167d2-d710-4b5d-80a8-a1d58717142d"; + const options = { jobId: jobId }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.projects.getJobStatus( + resourceGroupName, + rootResourceName, + resourceName, + subContainerName, + operation, + options + ); + console.log(result); +} + +getTheStatusOfTheProjectCreationJob().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/updateAProjectResource.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/updateAProjectResource.ts new file mode 100644 index 000000000000..e7872b51953d --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/updateAProjectResource.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the tags of the specified Team Services project. + * + * @summary Updates the tags of the specified Team Services project. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateProjectResource.json + */ +import { + ProjectResource, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateAProjectResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const body: ProjectResource = { + name: "ms.example", + type: "Microsoft.VisualStudio/account/extension", + id: + "/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/microsoft.visualstudio/account/ExampleAccount/project/ExampleProject", + location: "Central US", + properties: {}, + tags: {} + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.projects.update( + resourceGroupName, + rootResourceName, + resourceName, + body + ); + console.log(result); +} + +updateAProjectResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples-dev/updateAnExtensionResource.ts b/sdk/visualstudio/arm-visualstudio/samples-dev/updateAnExtensionResource.ts new file mode 100644 index 000000000000..9036853f135e --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples-dev/updateAnExtensionResource.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates an existing extension registration for the Visual Studio Team Services account. + * + * @summary Updates an existing extension registration for the Visual Studio Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateExtensionResource.json + */ +import { + ExtensionResourceRequest, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const extensionResourceName = "Example"; + const body: ExtensionResourceRequest = { + location: "Central US", + plan: { + name: "ExamplePlan", + product: "ExampleExtensionName", + promotionCode: "", + publisher: "ExampleExtensionPublisher", + version: "1.0" + }, + properties: {}, + tags: {} + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.extensions.update( + resourceGroupName, + accountResourceName, + extensionResourceName, + body + ); + console.log(result); +} + +updateAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/README.md b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/README.md new file mode 100644 index 000000000000..bbbbd0abab9b --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/README.md @@ -0,0 +1,80 @@ +# client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [checkAvailabilityOfAnAccountName.js][checkavailabilityofanaccountname] | Checks if the specified Visual Studio Team Services account name is available. Resource name can be either an account name or an account name and PUID. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CheckNameAvailability.json | +| [createAProjectResource.js][createaprojectresource] | Creates a Team Services project in the collection with the specified name. 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process templates). x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CreateProjectResource.json | +| [createAnAccountResource.js][createanaccountresource] | Updates tags for Visual Studio Team Services account resource. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateTags.json | +| [createAnExtensionResource.js][createanextensionresource] | Registers the extension with a Visual Studio Team Services account. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CreateExtensionResource.json | +| [deleteAnAccountResource.js][deleteanaccountresource] | Deletes a Visual Studio Team Services account resource. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/DeleteResource.json | +| [deleteAnExtensionResource.js][deleteanextensionresource] | Removes an extension resource registration for a Visual Studio Team Services account. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/DeleteExtensionResource.json | +| [getAListOfAccountResourcesInTheResourceGroup.js][getalistofaccountresourcesintheresourcegroup] | Gets all Visual Studio Team Services account resources under the resource group linked to the specified Azure subscription. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetResources_List.json | +| [getAListOfExtensionResourcesWithinTheResourceGroup.js][getalistofextensionresourceswithintheresourcegroup] | Gets the details of the extension resources created within the resource group. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetExtensionResources_List.json | +| [getAListOfOperationsForThisResourceProvider.js][getalistofoperationsforthisresourceprovider] | Gets the details of all operations possible on the Microsoft.VisualStudio resource provider. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetOperations.json | +| [getAListOfProjectResourcesInTheTeamServicesAccount.js][getalistofprojectresourcesintheteamservicesaccount] | Gets all Visual Studio Team Services project resources created in the specified Team Services account. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectResources_List.json | +| [getAProjectResource.js][getaprojectresource] | Gets the details of a Team Services project resource. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectResource.json | +| [getAnAccountResource.js][getanaccountresource] | Gets the Visual Studio Team Services account resource details. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetResource.json | +| [getAnExtensionResource.js][getanextensionresource] | Gets the details of an extension associated with a Visual Studio Team Services account resource. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetExtensionResource.json | +| [getTheStatusOfTheProjectCreationJob.js][getthestatusoftheprojectcreationjob] | Gets the status of the project resource creation job. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectJobStatus.json | +| [updateAProjectResource.js][updateaprojectresource] | Updates the tags of the specified Team Services project. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateProjectResource.json | +| [updateAnExtensionResource.js][updateanextensionresource] | Updates an existing extension registration for the Visual Studio Team Services account. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateExtensionResource.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node checkAvailabilityOfAnAccountName.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node checkAvailabilityOfAnAccountName.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[checkavailabilityofanaccountname]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/checkAvailabilityOfAnAccountName.js +[createaprojectresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAProjectResource.js +[createanaccountresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAnAccountResource.js +[createanextensionresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAnExtensionResource.js +[deleteanaccountresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/deleteAnAccountResource.js +[deleteanextensionresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/deleteAnExtensionResource.js +[getalistofaccountresourcesintheresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfAccountResourcesInTheResourceGroup.js +[getalistofextensionresourceswithintheresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfExtensionResourcesWithinTheResourceGroup.js +[getalistofoperationsforthisresourceprovider]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfOperationsForThisResourceProvider.js +[getalistofprojectresourcesintheteamservicesaccount]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfProjectResourcesInTheTeamServicesAccount.js +[getaprojectresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAProjectResource.js +[getanaccountresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAnAccountResource.js +[getanextensionresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAnExtensionResource.js +[getthestatusoftheprojectcreationjob]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getTheStatusOfTheProjectCreationJob.js +[updateaprojectresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/updateAProjectResource.js +[updateanextensionresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/updateAnExtensionResource.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-visualstudio?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/visualstudio/arm-visualstudio/README.md diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/checkAvailabilityOfAnAccountName.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/checkAvailabilityOfAnAccountName.js new file mode 100644 index 000000000000..5f8cd227c7da --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/checkAvailabilityOfAnAccountName.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Checks if the specified Visual Studio Team Services account name is available. Resource name can be either an account name or an account name and PUID. + * + * @summary Checks if the specified Visual Studio Team Services account name is available. Resource name can be either an account name or an account name and PUID. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CheckNameAvailability.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function checkAvailabilityOfAnAccountName() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const body = { + resourceName: "ExampleName", + resourceType: "Account", + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.accounts.checkNameAvailability(body); + console.log(result); +} + +checkAvailabilityOfAnAccountName().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAProjectResource.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAProjectResource.js new file mode 100644 index 000000000000..3f7882a64f0a --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAProjectResource.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a Team Services project in the collection with the specified name. 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process templates). + * + * @summary Creates a Team Services project in the collection with the specified name. 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process templates). + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CreateProjectResource.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAProjectResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const body = { + name: "ExampleProject", + type: "Microsoft.VisualStudio/account/project", + id: "/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/Microsoft.VisualStudio/account/ExampleAccount/project/ExampleProject", + location: "Central US", + properties: { + processTemplateId: "6B724908-EF14-45CF-84F8-768B5384DA45", + versionControlOption: "Git", + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.projects.beginCreateAndWait( + resourceGroupName, + rootResourceName, + resourceName, + body + ); + console.log(result); +} + +createAProjectResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAnAccountResource.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAnAccountResource.js new file mode 100644 index 000000000000..34c6a156f45e --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAnAccountResource.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates tags for Visual Studio Team Services account resource. + * + * @summary Updates tags for Visual Studio Team Services account resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateTags.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAnAccountResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const resourceName = "Example"; + const body = { tags: { tag1: "value1" } }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.accounts.update(resourceGroupName, resourceName, body); + console.log(result); +} + +createAnAccountResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAnExtensionResource.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAnExtensionResource.js new file mode 100644 index 000000000000..d6aeab28a81b --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/createAnExtensionResource.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Registers the extension with a Visual Studio Team Services account. + * + * @summary Registers the extension with a Visual Studio Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CreateExtensionResource.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const extensionResourceName = "ms.example"; + const body = { + location: "Central US", + plan: { + name: "ExamplePlan", + product: "ExampleExtensionName", + promotionCode: "", + publisher: "ExampleExtensionPublisher", + version: "1.0", + }, + properties: {}, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.extensions.create( + resourceGroupName, + accountResourceName, + extensionResourceName, + body + ); + console.log(result); +} + +createAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/deleteAnAccountResource.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/deleteAnAccountResource.js new file mode 100644 index 000000000000..2ee7f3c601c5 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/deleteAnAccountResource.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a Visual Studio Team Services account resource. + * + * @summary Deletes a Visual Studio Team Services account resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/DeleteResource.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deleteAnAccountResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const resourceName = "Example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.accounts.delete(resourceGroupName, resourceName); + console.log(result); +} + +deleteAnAccountResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/deleteAnExtensionResource.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/deleteAnExtensionResource.js new file mode 100644 index 000000000000..d18b1002682f --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/deleteAnExtensionResource.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Removes an extension resource registration for a Visual Studio Team Services account. + * + * @summary Removes an extension resource registration for a Visual Studio Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/DeleteExtensionResource.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deleteAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "Example"; + const extensionResourceName = "ms.example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.extensions.delete( + resourceGroupName, + accountResourceName, + extensionResourceName + ); + console.log(result); +} + +deleteAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfAccountResourcesInTheResourceGroup.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfAccountResourcesInTheResourceGroup.js new file mode 100644 index 000000000000..072c4dcaadfb --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfAccountResourcesInTheResourceGroup.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all Visual Studio Team Services account resources under the resource group linked to the specified Azure subscription. + * + * @summary Gets all Visual Studio Team Services account resources under the resource group linked to the specified Azure subscription. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetResources_List.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getAListOfAccountResourcesInTheResourceGroup() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.accounts.listByResourceGroup(resourceGroupName); + console.log(result); +} + +getAListOfAccountResourcesInTheResourceGroup().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfExtensionResourcesWithinTheResourceGroup.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfExtensionResourcesWithinTheResourceGroup.js new file mode 100644 index 000000000000..8194459c368c --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfExtensionResourcesWithinTheResourceGroup.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of the extension resources created within the resource group. + * + * @summary Gets the details of the extension resources created within the resource group. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetExtensionResources_List.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getAListOfExtensionResourcesWithinTheResourceGroup() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.extensions.listByAccount(resourceGroupName, accountResourceName); + console.log(result); +} + +getAListOfExtensionResourcesWithinTheResourceGroup().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfOperationsForThisResourceProvider.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfOperationsForThisResourceProvider.js new file mode 100644 index 000000000000..bb86367418b8 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfOperationsForThisResourceProvider.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of all operations possible on the Microsoft.VisualStudio resource provider. + * + * @summary Gets the details of all operations possible on the Microsoft.VisualStudio resource provider. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetOperations.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getAListOfOperationsForThisResourceProvider() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.operations.list(); + console.log(result); +} + +getAListOfOperationsForThisResourceProvider().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfProjectResourcesInTheTeamServicesAccount.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfProjectResourcesInTheTeamServicesAccount.js new file mode 100644 index 000000000000..ba37088b390a --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAListOfProjectResourcesInTheTeamServicesAccount.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all Visual Studio Team Services project resources created in the specified Team Services account. + * + * @summary Gets all Visual Studio Team Services project resources created in the specified Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectResources_List.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getAListOfProjectResourcesInTheTeamServicesAccount() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.projects.listByResourceGroup(resourceGroupName, rootResourceName); + console.log(result); +} + +getAListOfProjectResourcesInTheTeamServicesAccount().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAProjectResource.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAProjectResource.js new file mode 100644 index 000000000000..8cba6bf0309c --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAProjectResource.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of a Team Services project resource. + * + * @summary Gets the details of a Team Services project resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectResource.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getAProjectResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.projects.get(resourceGroupName, rootResourceName, resourceName); + console.log(result); +} + +getAProjectResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAnAccountResource.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAnAccountResource.js new file mode 100644 index 000000000000..b97ad1578833 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAnAccountResource.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the Visual Studio Team Services account resource details. + * + * @summary Gets the Visual Studio Team Services account resource details. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetResource.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getAnAccountResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const resourceName = "Example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.accounts.get(resourceGroupName, resourceName); + console.log(result); +} + +getAnAccountResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAnExtensionResource.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAnExtensionResource.js new file mode 100644 index 000000000000..8b156ed6f0ee --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getAnExtensionResource.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of an extension associated with a Visual Studio Team Services account resource. + * + * @summary Gets the details of an extension associated with a Visual Studio Team Services account resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetExtensionResource.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const extensionResourceName = "ms.example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.extensions.get( + resourceGroupName, + accountResourceName, + extensionResourceName + ); + console.log(result); +} + +getAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getTheStatusOfTheProjectCreationJob.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getTheStatusOfTheProjectCreationJob.js new file mode 100644 index 000000000000..487590253048 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/getTheStatusOfTheProjectCreationJob.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the status of the project resource creation job. + * + * @summary Gets the status of the project resource creation job. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectJobStatus.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getTheStatusOfTheProjectCreationJob() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const subContainerName = "ExampleProject"; + const operation = "put"; + const jobId = "126167d2-d710-4b5d-80a8-a1d58717142d"; + const options = { jobId: jobId }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.projects.getJobStatus( + resourceGroupName, + rootResourceName, + resourceName, + subContainerName, + operation, + options + ); + console.log(result); +} + +getTheStatusOfTheProjectCreationJob().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/package.json b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/package.json new file mode 100644 index 000000000000..6be57e7b710d --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "azure-arm-visualstudio-samples-js-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/visualstudio/arm-visualstudio" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/visualstudio/arm-visualstudio", + "dependencies": { + "@azure/arm-visualstudio": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/sample.env b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/updateAProjectResource.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/updateAProjectResource.js new file mode 100644 index 000000000000..3d9018548681 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/updateAProjectResource.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the tags of the specified Team Services project. + * + * @summary Updates the tags of the specified Team Services project. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateProjectResource.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function updateAProjectResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const body = { + name: "ms.example", + type: "Microsoft.VisualStudio/account/extension", + id: "/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/microsoft.visualstudio/account/ExampleAccount/project/ExampleProject", + location: "Central US", + properties: {}, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.projects.update( + resourceGroupName, + rootResourceName, + resourceName, + body + ); + console.log(result); +} + +updateAProjectResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/updateAnExtensionResource.js b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/updateAnExtensionResource.js new file mode 100644 index 000000000000..9c78b1e16644 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/javascript/updateAnExtensionResource.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates an existing extension registration for the Visual Studio Team Services account. + * + * @summary Updates an existing extension registration for the Visual Studio Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateExtensionResource.json + */ +const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function updateAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const extensionResourceName = "Example"; + const body = { + location: "Central US", + plan: { + name: "ExamplePlan", + product: "ExampleExtensionName", + promotionCode: "", + publisher: "ExampleExtensionPublisher", + version: "1.0", + }, + properties: {}, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient(credential, subscriptionId); + const result = await client.extensions.update( + resourceGroupName, + accountResourceName, + extensionResourceName, + body + ); + console.log(result); +} + +updateAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/README.md b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/README.md new file mode 100644 index 000000000000..b3da1e717d84 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/README.md @@ -0,0 +1,93 @@ +# client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [checkAvailabilityOfAnAccountName.ts][checkavailabilityofanaccountname] | Checks if the specified Visual Studio Team Services account name is available. Resource name can be either an account name or an account name and PUID. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CheckNameAvailability.json | +| [createAProjectResource.ts][createaprojectresource] | Creates a Team Services project in the collection with the specified name. 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process templates). x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CreateProjectResource.json | +| [createAnAccountResource.ts][createanaccountresource] | Updates tags for Visual Studio Team Services account resource. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateTags.json | +| [createAnExtensionResource.ts][createanextensionresource] | Registers the extension with a Visual Studio Team Services account. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CreateExtensionResource.json | +| [deleteAnAccountResource.ts][deleteanaccountresource] | Deletes a Visual Studio Team Services account resource. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/DeleteResource.json | +| [deleteAnExtensionResource.ts][deleteanextensionresource] | Removes an extension resource registration for a Visual Studio Team Services account. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/DeleteExtensionResource.json | +| [getAListOfAccountResourcesInTheResourceGroup.ts][getalistofaccountresourcesintheresourcegroup] | Gets all Visual Studio Team Services account resources under the resource group linked to the specified Azure subscription. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetResources_List.json | +| [getAListOfExtensionResourcesWithinTheResourceGroup.ts][getalistofextensionresourceswithintheresourcegroup] | Gets the details of the extension resources created within the resource group. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetExtensionResources_List.json | +| [getAListOfOperationsForThisResourceProvider.ts][getalistofoperationsforthisresourceprovider] | Gets the details of all operations possible on the Microsoft.VisualStudio resource provider. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetOperations.json | +| [getAListOfProjectResourcesInTheTeamServicesAccount.ts][getalistofprojectresourcesintheteamservicesaccount] | Gets all Visual Studio Team Services project resources created in the specified Team Services account. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectResources_List.json | +| [getAProjectResource.ts][getaprojectresource] | Gets the details of a Team Services project resource. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectResource.json | +| [getAnAccountResource.ts][getanaccountresource] | Gets the Visual Studio Team Services account resource details. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetResource.json | +| [getAnExtensionResource.ts][getanextensionresource] | Gets the details of an extension associated with a Visual Studio Team Services account resource. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetExtensionResource.json | +| [getTheStatusOfTheProjectCreationJob.ts][getthestatusoftheprojectcreationjob] | Gets the status of the project resource creation job. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectJobStatus.json | +| [updateAProjectResource.ts][updateaprojectresource] | Updates the tags of the specified Team Services project. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateProjectResource.json | +| [updateAnExtensionResource.ts][updateanextensionresource] | Updates an existing extension registration for the Visual Studio Team Services account. x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateExtensionResource.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/checkAvailabilityOfAnAccountName.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/checkAvailabilityOfAnAccountName.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[checkavailabilityofanaccountname]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/checkAvailabilityOfAnAccountName.ts +[createaprojectresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAProjectResource.ts +[createanaccountresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAnAccountResource.ts +[createanextensionresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAnExtensionResource.ts +[deleteanaccountresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/deleteAnAccountResource.ts +[deleteanextensionresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/deleteAnExtensionResource.ts +[getalistofaccountresourcesintheresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfAccountResourcesInTheResourceGroup.ts +[getalistofextensionresourceswithintheresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfExtensionResourcesWithinTheResourceGroup.ts +[getalistofoperationsforthisresourceprovider]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfOperationsForThisResourceProvider.ts +[getalistofprojectresourcesintheteamservicesaccount]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfProjectResourcesInTheTeamServicesAccount.ts +[getaprojectresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAProjectResource.ts +[getanaccountresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAnAccountResource.ts +[getanextensionresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAnExtensionResource.ts +[getthestatusoftheprojectcreationjob]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getTheStatusOfTheProjectCreationJob.ts +[updateaprojectresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/updateAProjectResource.ts +[updateanextensionresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/updateAnExtensionResource.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-visualstudio?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/visualstudio/arm-visualstudio/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/package.json b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/package.json new file mode 100644 index 000000000000..241dcaf26d29 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "azure-arm-visualstudio-samples-ts-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/visualstudio/arm-visualstudio" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/visualstudio/arm-visualstudio", + "dependencies": { + "@azure/arm-visualstudio": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.4.0", + "rimraf": "latest" + } +} diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/sample.env b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/checkAvailabilityOfAnAccountName.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/checkAvailabilityOfAnAccountName.ts new file mode 100644 index 000000000000..86d3ba85eb30 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/checkAvailabilityOfAnAccountName.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Checks if the specified Visual Studio Team Services account name is available. Resource name can be either an account name or an account name and PUID. + * + * @summary Checks if the specified Visual Studio Team Services account name is available. Resource name can be either an account name or an account name and PUID. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CheckNameAvailability.json + */ +import { + CheckNameAvailabilityParameter, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function checkAvailabilityOfAnAccountName() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const body: CheckNameAvailabilityParameter = { + resourceName: "ExampleName", + resourceType: "Account" + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.accounts.checkNameAvailability(body); + console.log(result); +} + +checkAvailabilityOfAnAccountName().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAProjectResource.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAProjectResource.ts new file mode 100644 index 000000000000..163092104149 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAProjectResource.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates a Team Services project in the collection with the specified name. 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process templates). + * + * @summary Creates a Team Services project in the collection with the specified name. 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process templates). + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CreateProjectResource.json + */ +import { + ProjectResource, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAProjectResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const body: ProjectResource = { + name: "ExampleProject", + type: "Microsoft.VisualStudio/account/project", + id: + "/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/Microsoft.VisualStudio/account/ExampleAccount/project/ExampleProject", + location: "Central US", + properties: { + processTemplateId: "6B724908-EF14-45CF-84F8-768B5384DA45", + versionControlOption: "Git" + }, + tags: {} + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.projects.beginCreateAndWait( + resourceGroupName, + rootResourceName, + resourceName, + body + ); + console.log(result); +} + +createAProjectResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAnAccountResource.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAnAccountResource.ts new file mode 100644 index 000000000000..9def51f5c57c --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAnAccountResource.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates tags for Visual Studio Team Services account resource. + * + * @summary Updates tags for Visual Studio Team Services account resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateTags.json + */ +import { + AccountTagRequest, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAnAccountResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const resourceName = "Example"; + const body: AccountTagRequest = { tags: { tag1: "value1" } }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.accounts.update( + resourceGroupName, + resourceName, + body + ); + console.log(result); +} + +createAnAccountResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAnExtensionResource.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAnExtensionResource.ts new file mode 100644 index 000000000000..5df2b731f189 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/createAnExtensionResource.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Registers the extension with a Visual Studio Team Services account. + * + * @summary Registers the extension with a Visual Studio Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/CreateExtensionResource.json + */ +import { + ExtensionResourceRequest, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const extensionResourceName = "ms.example"; + const body: ExtensionResourceRequest = { + location: "Central US", + plan: { + name: "ExamplePlan", + product: "ExampleExtensionName", + promotionCode: "", + publisher: "ExampleExtensionPublisher", + version: "1.0" + }, + properties: {}, + tags: {} + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.extensions.create( + resourceGroupName, + accountResourceName, + extensionResourceName, + body + ); + console.log(result); +} + +createAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/deleteAnAccountResource.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/deleteAnAccountResource.ts new file mode 100644 index 000000000000..9d0c9486dc5e --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/deleteAnAccountResource.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a Visual Studio Team Services account resource. + * + * @summary Deletes a Visual Studio Team Services account resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/DeleteResource.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deleteAnAccountResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const resourceName = "Example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.accounts.delete(resourceGroupName, resourceName); + console.log(result); +} + +deleteAnAccountResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/deleteAnExtensionResource.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/deleteAnExtensionResource.ts new file mode 100644 index 000000000000..48ebd0528a92 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/deleteAnExtensionResource.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Removes an extension resource registration for a Visual Studio Team Services account. + * + * @summary Removes an extension resource registration for a Visual Studio Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/DeleteExtensionResource.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deleteAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "Example"; + const extensionResourceName = "ms.example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.extensions.delete( + resourceGroupName, + accountResourceName, + extensionResourceName + ); + console.log(result); +} + +deleteAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfAccountResourcesInTheResourceGroup.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfAccountResourcesInTheResourceGroup.ts new file mode 100644 index 000000000000..f3413e721727 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfAccountResourcesInTheResourceGroup.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all Visual Studio Team Services account resources under the resource group linked to the specified Azure subscription. + * + * @summary Gets all Visual Studio Team Services account resources under the resource group linked to the specified Azure subscription. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetResources_List.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAListOfAccountResourcesInTheResourceGroup() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.accounts.listByResourceGroup(resourceGroupName); + console.log(result); +} + +getAListOfAccountResourcesInTheResourceGroup().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfExtensionResourcesWithinTheResourceGroup.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfExtensionResourcesWithinTheResourceGroup.ts new file mode 100644 index 000000000000..405175ca9651 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfExtensionResourcesWithinTheResourceGroup.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of the extension resources created within the resource group. + * + * @summary Gets the details of the extension resources created within the resource group. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetExtensionResources_List.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAListOfExtensionResourcesWithinTheResourceGroup() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.extensions.listByAccount( + resourceGroupName, + accountResourceName + ); + console.log(result); +} + +getAListOfExtensionResourcesWithinTheResourceGroup().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfOperationsForThisResourceProvider.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfOperationsForThisResourceProvider.ts new file mode 100644 index 000000000000..c57f3675b660 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfOperationsForThisResourceProvider.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of all operations possible on the Microsoft.VisualStudio resource provider. + * + * @summary Gets the details of all operations possible on the Microsoft.VisualStudio resource provider. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetOperations.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAListOfOperationsForThisResourceProvider() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.operations.list(); + console.log(result); +} + +getAListOfOperationsForThisResourceProvider().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfProjectResourcesInTheTeamServicesAccount.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfProjectResourcesInTheTeamServicesAccount.ts new file mode 100644 index 000000000000..dd2fe76775a0 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAListOfProjectResourcesInTheTeamServicesAccount.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets all Visual Studio Team Services project resources created in the specified Team Services account. + * + * @summary Gets all Visual Studio Team Services project resources created in the specified Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectResources_List.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAListOfProjectResourcesInTheTeamServicesAccount() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.projects.listByResourceGroup( + resourceGroupName, + rootResourceName + ); + console.log(result); +} + +getAListOfProjectResourcesInTheTeamServicesAccount().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAProjectResource.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAProjectResource.ts new file mode 100644 index 000000000000..9393008543c5 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAProjectResource.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of a Team Services project resource. + * + * @summary Gets the details of a Team Services project resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectResource.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAProjectResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.projects.get( + resourceGroupName, + rootResourceName, + resourceName + ); + console.log(result); +} + +getAProjectResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAnAccountResource.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAnAccountResource.ts new file mode 100644 index 000000000000..6d4bd15fb872 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAnAccountResource.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the Visual Studio Team Services account resource details. + * + * @summary Gets the Visual Studio Team Services account resource details. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetResource.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAnAccountResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const resourceName = "Example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.accounts.get(resourceGroupName, resourceName); + console.log(result); +} + +getAnAccountResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAnExtensionResource.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAnExtensionResource.ts new file mode 100644 index 000000000000..a9649c8d47d8 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getAnExtensionResource.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the details of an extension associated with a Visual Studio Team Services account resource. + * + * @summary Gets the details of an extension associated with a Visual Studio Team Services account resource. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetExtensionResource.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const extensionResourceName = "ms.example"; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.extensions.get( + resourceGroupName, + accountResourceName, + extensionResourceName + ); + console.log(result); +} + +getAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getTheStatusOfTheProjectCreationJob.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getTheStatusOfTheProjectCreationJob.ts new file mode 100644 index 000000000000..a30877872e59 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/getTheStatusOfTheProjectCreationJob.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the status of the project resource creation job. + * + * @summary Gets the status of the project resource creation job. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/GetProjectJobStatus.json + */ +import { VisualStudioResourceProviderClient } from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getTheStatusOfTheProjectCreationJob() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const subContainerName = "ExampleProject"; + const operation = "put"; + const jobId = "126167d2-d710-4b5d-80a8-a1d58717142d"; + const options = { jobId: jobId }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.projects.getJobStatus( + resourceGroupName, + rootResourceName, + resourceName, + subContainerName, + operation, + options + ); + console.log(result); +} + +getTheStatusOfTheProjectCreationJob().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/updateAProjectResource.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/updateAProjectResource.ts new file mode 100644 index 000000000000..e7872b51953d --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/updateAProjectResource.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates the tags of the specified Team Services project. + * + * @summary Updates the tags of the specified Team Services project. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateProjectResource.json + */ +import { + ProjectResource, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateAProjectResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const rootResourceName = "ExampleAccount"; + const resourceName = "ExampleProject"; + const body: ProjectResource = { + name: "ms.example", + type: "Microsoft.VisualStudio/account/extension", + id: + "/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/microsoft.visualstudio/account/ExampleAccount/project/ExampleProject", + location: "Central US", + properties: {}, + tags: {} + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.projects.update( + resourceGroupName, + rootResourceName, + resourceName, + body + ); + console.log(result); +} + +updateAProjectResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/updateAnExtensionResource.ts b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/updateAnExtensionResource.ts new file mode 100644 index 000000000000..9036853f135e --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/src/updateAnExtensionResource.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates an existing extension registration for the Visual Studio Team Services account. + * + * @summary Updates an existing extension registration for the Visual Studio Team Services account. + * x-ms-original-file: specification/visualstudio/resource-manager/Microsoft.VisualStudio/preview/2014-04-01-preview/examples/UpdateExtensionResource.json + */ +import { + ExtensionResourceRequest, + VisualStudioResourceProviderClient +} from "@azure/arm-visualstudio"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateAnExtensionResource() { + const subscriptionId = "0de7f055-dbea-498d-8e9e-da287eedca90"; + const resourceGroupName = "VS-Example-Group"; + const accountResourceName = "ExampleAccount"; + const extensionResourceName = "Example"; + const body: ExtensionResourceRequest = { + location: "Central US", + plan: { + name: "ExamplePlan", + product: "ExampleExtensionName", + promotionCode: "", + publisher: "ExampleExtensionPublisher", + version: "1.0" + }, + properties: {}, + tags: {} + }; + const credential = new DefaultAzureCredential(); + const client = new VisualStudioResourceProviderClient( + credential, + subscriptionId + ); + const result = await client.extensions.update( + resourceGroupName, + accountResourceName, + extensionResourceName, + body + ); + console.log(result); +} + +updateAnExtensionResource().catch(console.error); diff --git a/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/tsconfig.json b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/samples/v4-beta/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/visualstudio/arm-visualstudio/src/index.ts b/sdk/visualstudio/arm-visualstudio/src/index.ts new file mode 100644 index 000000000000..bc9fe58f56b3 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/src/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./models"; +export { VisualStudioResourceProviderClient } from "./visualStudioResourceProviderClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/visualstudio/arm-visualstudio/src/lroImpl.ts b/sdk/visualstudio/arm-visualstudio/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/visualstudio/arm-visualstudio/src/models/accountsMappers.ts b/sdk/visualstudio/arm-visualstudio/src/models/accountsMappers.ts deleted file mode 100644 index 5393c150241e..000000000000 --- a/sdk/visualstudio/arm-visualstudio/src/models/accountsMappers.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - CheckNameAvailabilityParameter, - CheckNameAvailabilityResult, - CloudError, - AccountResourceListResult, - AccountResource, - Resource, - BaseResource, - AccountResourceRequest, - AccountTagRequest, - ExtensionResource, - ExtensionResourcePlan, - ProjectResource -} from "../models/mappers"; - diff --git a/sdk/visualstudio/arm-visualstudio/src/models/extensionsMappers.ts b/sdk/visualstudio/arm-visualstudio/src/models/extensionsMappers.ts deleted file mode 100644 index beb9357b265e..000000000000 --- a/sdk/visualstudio/arm-visualstudio/src/models/extensionsMappers.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - ExtensionResourceListResult, - ExtensionResource, - Resource, - BaseResource, - ExtensionResourcePlan, - CloudError, - ExtensionResourceRequest, - AccountResource, - ProjectResource -} from "../models/mappers"; - diff --git a/sdk/visualstudio/arm-visualstudio/src/models/index.ts b/sdk/visualstudio/arm-visualstudio/src/models/index.ts index 2764474b175e..db5ef7209d98 100644 --- a/sdk/visualstudio/arm-visualstudio/src/models/index.ts +++ b/sdk/visualstudio/arm-visualstudio/src/models/index.ts @@ -1,701 +1,298 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +/** Container for a list of operations supported by a resource provider. */ +export interface OperationListResult { + /** A list of operations supported by a resource provider. */ + value?: Operation[]; +} +/** Properties of an operation supported by the resource provider. */ +export interface Operation { + /** The properties of the resource operation. */ + display?: OperationProperties; + /** The name of the resource operation. */ + name?: string; +} -/** - * @interface - * An interface representing Resource. - * A generic Azure Resource Manager resource. - * - * @extends BaseResource - */ -export interface Resource extends BaseResource { - /** - * @member {string} [id] Unique identifier of the resource. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly id?: string; - /** - * @member {string} [location] Resource location. - */ - location?: string; - /** - * @member {string} [name] Resource name. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly name?: string; - /** - * @member {{ [propertyName: string]: string }} [tags] Resource tags. - */ - tags?: { [propertyName: string]: string }; - /** - * @member {string} [type] Resource type. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly type?: string; +/** Properties of an operation supported by the resource provider. */ +export interface OperationProperties { + /** The description of the resource operation. */ + description?: string; + /** The operation name. */ + operation?: string; + /** The provider name. */ + provider?: string; + /** The resource name. */ + resource?: string; } -/** - * @interface - * An interface representing AccountResource. - * The response to an account resource GET request. - * - * @extends Resource - */ -export interface AccountResource extends Resource { - /** - * @member {{ [propertyName: string]: string }} [properties] Resource - * properties. - */ - properties?: { [propertyName: string]: string }; +/** The body of a POST request to check name availability. */ +export interface CheckNameAvailabilityParameter { + /** The name of the resource to check availability for. */ + resourceName?: string; + /** The type of resource to check availability for. */ + resourceType?: string; } -/** - * @interface - * An interface representing AccountResourceListResult. - * The response to an account resource list GET request. - * - */ -export interface AccountResourceListResult { - /** - * @member {AccountResource[]} [value] Array of resource details. - */ - value?: AccountResource[]; +/** The response to a name availability request. */ +export interface CheckNameAvailabilityResult { + /** The message describing the detailed reason. */ + message?: string; + /** The value which indicates whether the provided name is available. */ + nameAvailable?: boolean; } -/** - * @interface - * An interface representing AccountTagRequest. - * The body of a Patch request to add tags to a Visual Studio account resource. - * - */ -export interface AccountTagRequest { - /** - * @member {{ [propertyName: string]: string }} [tags] The custom tags of the - * resource. - */ - tags?: { [propertyName: string]: string }; +/** The response to an account resource list GET request. */ +export interface AccountResourceListResult { + /** Array of resource details. */ + value?: AccountResource[]; } -/** - * @interface - * An interface representing AccountResourceRequest. - * The body of a PUT request to modify a Visual Studio account resource. - * - */ -export interface AccountResourceRequest { +/** A generic Azure Resource Manager resource. */ +export interface Resource { /** - * @member {string} [accountName] The account name. - */ - accountName?: string; - /** - * @member {string} [location] The Azure instance location. + * Unique identifier of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly id?: string; + /** Resource location. */ location?: string; /** - * @member {any} [operationType] The type of the operation. - */ - operationType?: any; - /** - * @member {{ [propertyName: string]: string }} [properties] The custom - * properties of the resource. - */ - properties?: { [propertyName: string]: string }; - /** - * @member {{ [propertyName: string]: string }} [tags] The custom tags of the - * resource. + * Resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly name?: string; + /** Resource tags. */ tags?: { [propertyName: string]: string }; -} - -/** - * @interface - * An interface representing CheckNameAvailabilityParameter. - * The body of a POST request to check name availability. - * - */ -export interface CheckNameAvailabilityParameter { /** - * @member {string} [resourceName] The name of the resource to check - * availability for. + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceName?: string; - /** - * @member {string} [resourceType] The type of resource to check availability - * for. - */ - resourceType?: string; + readonly type?: string; } -/** - * @interface - * An interface representing CheckNameAvailabilityResult. - * The response to a name availability request. - * - */ -export interface CheckNameAvailabilityResult { - /** - * @member {string} [message] The message describing the detailed reason. - */ - message?: string; - /** - * @member {boolean} [nameAvailable] The value which indicates whether the - * provided name is available. - */ - nameAvailable?: boolean; +/** The response to an extension resource list GET request. */ +export interface ExtensionResourceListResult { + /** Array of extension resource details. */ + value?: ExtensionResource[]; } -/** - * @interface - * An interface representing ExtensionResourcePlan. - * Plan data for an extension resource. - * - */ +/** Plan data for an extension resource. */ export interface ExtensionResourcePlan { - /** - * @member {string} [name] Name of the plan. - */ + /** Name of the plan. */ name?: string; - /** - * @member {string} [product] Product name. - */ + /** Product name. */ product?: string; - /** - * @member {string} [promotionCode] Optional: the promotion code associated - * with the plan. - */ + /** Optional: the promotion code associated with the plan. */ promotionCode?: string; - /** - * @member {string} [publisher] Name of the extension publisher. - */ + /** Name of the extension publisher. */ publisher?: string; - /** - * @member {string} [version] A string that uniquely identifies the plan - * version. - */ + /** A string that uniquely identifies the plan version. */ version?: string; } -/** - * @interface - * An interface representing ExtensionResource. - * The response to an extension resource GET request. - * - * @extends Resource - */ -export interface ExtensionResource extends Resource { - /** - * @member {ExtensionResourcePlan} [plan] The extension plan that was - * purchased. - */ +/** The body of an extension resource PUT request. */ +export interface ExtensionResourceRequest { + /** The Azure region of the Visual Studio account associated with this request (i.e 'southcentralus'.) */ + location?: string; + /** Extended information about the plan being purchased for this extension resource. */ plan?: ExtensionResourcePlan; - /** - * @member {{ [propertyName: string]: string }} [properties] Resource - * properties. - */ + /** A dictionary of extended properties. This property is currently unused. */ properties?: { [propertyName: string]: string }; + /** A dictionary of user-defined tags to be stored with the extension resource. */ + tags?: { [propertyName: string]: string }; } -/** - * @interface - * An interface representing ExtensionResourceListResult. - * The response to an extension resource list GET request. - * - */ -export interface ExtensionResourceListResult { - /** - * @member {ExtensionResource[]} [value] Array of extension resource details. - */ - value?: ExtensionResource[]; -} - -/** - * @interface - * An interface representing ExtensionResourceRequest. - * The body of an extension resource PUT request. - * - */ -export interface ExtensionResourceRequest { - /** - * @member {string} [location] The Azure region of the Visual Studio account - * associated with this request (i.e 'southcentralus'.) - */ +/** The body of a PUT request to modify a Visual Studio account resource. */ +export interface AccountResourceRequest { + /** The account name. */ + accountName?: string; + /** The Azure instance location. */ location?: string; - /** - * @member {ExtensionResourcePlan} [plan] Extended information about the plan - * being purchased for this extension resource. - */ - plan?: ExtensionResourcePlan; - /** - * @member {{ [propertyName: string]: string }} [properties] A dictionary of - * extended properties. This property is currently unused. - */ + /** The type of the operation. */ + operationType?: AccountResourceRequestOperationType; + /** The custom properties of the resource. */ properties?: { [propertyName: string]: string }; - /** - * @member {{ [propertyName: string]: string }} [tags] A dictionary of - * user-defined tags to be stored with the extension resource. - */ + /** The custom tags of the resource. */ tags?: { [propertyName: string]: string }; } -/** - * @interface - * An interface representing OperationProperties. - * Properties of an operation supported by the resource provider. - * - */ -export interface OperationProperties { - /** - * @member {string} [description] The description of the resource operation. - */ - description?: string; - /** - * @member {string} [operation] The operation name. - */ - operation?: string; - /** - * @member {string} [provider] The provider name. - */ - provider?: string; - /** - * @member {string} [resource] The resource name. - */ - resource?: string; +/** The body of a Patch request to add tags to a Visual Studio account resource. */ +export interface AccountTagRequest { + /** The custom tags of the resource. */ + tags?: { [propertyName: string]: string }; } -/** - * @interface - * An interface representing Operation. - * Properties of an operation supported by the resource provider. - * - */ -export interface Operation { - /** - * @member {OperationProperties} [display] The properties of the resource - * operation. - */ - display?: OperationProperties; - /** - * @member {string} [name] The name of the resource operation. - */ - name?: string; +/** The response to a request to list Team Services project resources in a resource group/account. */ +export interface ProjectResourceListResult { + /** List of project resource details. */ + value?: ProjectResource[]; } -/** - * @interface - * An interface representing OperationListResult. - * Container for a list of operations supported by a resource provider. - * - */ -export interface OperationListResult { - /** - * @member {Operation[]} [value] A list of operations supported by a resource - * provider. - */ - value?: Operation[]; -} +/** The response to an account resource GET request. */ +export type AccountResource = Resource & { + /** Resource properties. */ + properties?: { [propertyName: string]: string }; +}; -/** - * @interface - * An interface representing ProjectResource. - * A Visual Studio Team Services project resource. - * - * @extends Resource - */ -export interface ProjectResource extends Resource { - /** - * @member {{ [propertyName: string]: string }} [properties] Key/value pair - * of resource properties. - */ +/** The response to an extension resource GET request. */ +export type ExtensionResource = Resource & { + /** The extension plan that was purchased. */ + plan?: ExtensionResourcePlan; + /** Resource properties. */ properties?: { [propertyName: string]: string }; -} +}; -/** - * @interface - * An interface representing ProjectResourceListResult. - * The response to a request to list Team Services project resources in a - * resource group/account. - * - */ -export interface ProjectResourceListResult { - /** - * @member {ProjectResource[]} [value] List of project resource details. - */ - value?: ProjectResource[]; -} +/** A Visual Studio Team Services project resource. */ +export type ProjectResource = Resource & { + /** Key/value pair of resource properties. */ + properties?: { [propertyName: string]: string }; +}; +/** Defines values for AccountResourceRequestOperationType. */ +export type AccountResourceRequestOperationType = + | "unknown" + | "create" + | "update" + | "link"; -/** - * @interface - * An interface representing ProjectsCreateOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface ProjectsCreateOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [validating] This parameter is ignored and should be set - * to an empty string. - */ - validating?: string; -} +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing ProjectsGetJobStatusOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface ProjectsGetJobStatusOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [jobId] The job identifier. - */ - jobId?: string; -} +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; -/** - * @interface - * An interface representing ProjectsBeginCreateOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase - */ -export interface ProjectsBeginCreateOptionalParams extends msRest.RequestOptionsBase { - /** - * @member {string} [validating] This parameter is ignored and should be set - * to an empty string. - */ - validating?: string; -} +/** Optional parameters. */ +export interface AccountsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing VisualStudioResourceProviderClientOptions. - * @extends AzureServiceClientOptions - */ -export interface VisualStudioResourceProviderClientOptions extends AzureServiceClientOptions { - /** - * @member {string} [baseUri] - */ - baseUri?: string; -} +/** Contains response data for the checkNameAvailability operation. */ +export type AccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResult; +/** Optional parameters. */ +export interface AccountsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type AccountsListByResourceGroupResponse = AccountResourceListResult; -/** - * Contains response data for the checkNameAvailability operation. - */ -export type AccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CheckNameAvailabilityResult; - }; -}; +/** Optional parameters. */ +export interface AccountsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type AccountsListByResourceGroupResponse = AccountResourceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccountResourceListResult; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type AccountsCreateOrUpdateResponse = AccountResource; -/** - * Contains response data for the createOrUpdate operation. - */ -export type AccountsCreateOrUpdateResponse = AccountResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccountResource; - }; -}; +/** Optional parameters. */ +export interface AccountsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type AccountsGetResponse = AccountResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccountResource; - }; -}; +/** Optional parameters. */ +export interface AccountsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type AccountsUpdateResponse = AccountResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccountResource; - }; -}; +/** Contains response data for the get operation. */ +export type AccountsGetResponse = AccountResource; -/** - * Contains response data for the listByAccount operation. - */ -export type ExtensionsListByAccountResponse = ExtensionResourceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ExtensionResourceListResult; - }; -}; +/** Optional parameters. */ +export interface AccountsUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the create operation. - */ -export type ExtensionsCreateResponse = ExtensionResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ExtensionResource; - }; -}; +/** Contains response data for the update operation. */ +export type AccountsUpdateResponse = AccountResource; -/** - * Contains response data for the get operation. - */ -export type ExtensionsGetResponse = ExtensionResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ExtensionResource; - }; -}; +/** Optional parameters. */ +export interface ExtensionsListByAccountOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type ExtensionsUpdateResponse = ExtensionResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ExtensionResource; - }; -}; +/** Contains response data for the listByAccount operation. */ +export type ExtensionsListByAccountResponse = ExtensionResourceListResult; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ProjectsListByResourceGroupResponse = ProjectResourceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProjectResourceListResult; - }; -}; +/** Optional parameters. */ +export interface ExtensionsCreateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the create operation. - */ -export type ProjectsCreateResponse = ProjectResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProjectResource; - }; -}; +/** Contains response data for the create operation. */ +export type ExtensionsCreateResponse = ExtensionResource; -/** - * Contains response data for the get operation. - */ -export type ProjectsGetResponse = ProjectResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProjectResource; - }; -}; +/** Optional parameters. */ +export interface ExtensionsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type ProjectsUpdateResponse = ProjectResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProjectResource; - }; -}; +/** Optional parameters. */ +export interface ExtensionsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getJobStatus operation. - */ -export type ProjectsGetJobStatusResponse = ProjectResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProjectResource; - }; -}; +/** Contains response data for the get operation. */ +export type ExtensionsGetResponse = ExtensionResource; -/** - * Contains response data for the beginCreate operation. - */ -export type ProjectsBeginCreateResponse = ProjectResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProjectResource; - }; -}; +/** Optional parameters. */ +export interface ExtensionsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ExtensionsUpdateResponse = ExtensionResource; + +/** Optional parameters. */ +export interface ProjectsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ProjectsListByResourceGroupResponse = ProjectResourceListResult; + +/** Optional parameters. */ +export interface ProjectsCreateOptionalParams + extends coreClient.OperationOptions { + /** This parameter is ignored and should be set to an empty string. */ + validating?: string; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type ProjectsCreateResponse = ProjectResource; + +/** Optional parameters. */ +export interface ProjectsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ProjectsGetResponse = ProjectResource; + +/** Optional parameters. */ +export interface ProjectsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ProjectsUpdateResponse = ProjectResource; + +/** Optional parameters. */ +export interface ProjectsGetJobStatusOptionalParams + extends coreClient.OperationOptions { + /** The job identifier. */ + jobId?: string; +} + +/** Contains response data for the getJobStatus operation. */ +export type ProjectsGetJobStatusResponse = ProjectResource; + +/** Optional parameters. */ +export interface VisualStudioResourceProviderClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/visualstudio/arm-visualstudio/src/models/mappers.ts b/sdk/visualstudio/arm-visualstudio/src/models/mappers.ts index 53bdfc0a1f0c..95b51874d78a 100644 --- a/sdk/visualstudio/arm-visualstudio/src/models/mappers.ts +++ b/sdk/visualstudio/arm-visualstudio/src/models/mappers.ts @@ -1,94 +1,17 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } - } - } - } -}; - -export const AccountResource: msRest.CompositeMapper = { - serializedName: "AccountResource", - type: { - name: "Composite", - className: "AccountResource", - modelProperties: { - ...Resource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const AccountResourceListResult: msRest.CompositeMapper = { - serializedName: "AccountResourceListResult", - type: { - name: "Composite", - className: "AccountResourceListResult", + className: "OperationListResult", modelProperties: { value: { serializedName: "value", @@ -97,7 +20,7 @@ export const AccountResourceListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "AccountResource" + className: "Operation" } } } @@ -106,79 +29,62 @@ export const AccountResourceListResult: msRest.CompositeMapper = { } }; -export const AccountTagRequest: msRest.CompositeMapper = { - serializedName: "AccountTagRequest", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccountTagRequest", + className: "Operation", modelProperties: { - tags: { - serializedName: "tags", + display: { + serializedName: "display", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Composite", + className: "OperationProperties" + } + }, + name: { + serializedName: "name", + type: { + name: "String" } } } } }; -export const AccountResourceRequest: msRest.CompositeMapper = { - serializedName: "AccountResourceRequest", +export const OperationProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccountResourceRequest", + className: "OperationProperties", modelProperties: { - accountName: { - serializedName: "accountName", + description: { + serializedName: "description", type: { name: "String" } }, - location: { - serializedName: "location", + operation: { + serializedName: "operation", type: { name: "String" } }, - operationType: { - serializedName: "operationType", - type: { - name: "Object" - } - }, - properties: { - serializedName: "properties", + provider: { + serializedName: "provider", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } }, - tags: { - serializedName: "tags", + resource: { + serializedName: "resource", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } } } } }; -export const CheckNameAvailabilityParameter: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityParameter", +export const CheckNameAvailabilityParameter: coreClient.CompositeMapper = { type: { name: "Composite", className: "CheckNameAvailabilityParameter", @@ -199,8 +105,7 @@ export const CheckNameAvailabilityParameter: msRest.CompositeMapper = { } }; -export const CheckNameAvailabilityResult: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityResult", +export const CheckNameAvailabilityResult: coreClient.CompositeMapper = { type: { name: "Composite", className: "CheckNameAvailabilityResult", @@ -221,38 +126,62 @@ export const CheckNameAvailabilityResult: msRest.CompositeMapper = { } }; -export const ExtensionResourcePlan: msRest.CompositeMapper = { - serializedName: "ExtensionResourcePlan", +export const AccountResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExtensionResourcePlan", + className: "AccountResourceListResult", modelProperties: { - name: { - serializedName: "name", + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccountResource" + } + } + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - product: { - serializedName: "product", + location: { + serializedName: "location", type: { name: "String" } }, - promotionCode: { - serializedName: "promotionCode", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - publisher: { - serializedName: "publisher", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - version: { - serializedName: "version", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } @@ -261,27 +190,19 @@ export const ExtensionResourcePlan: msRest.CompositeMapper = { } }; -export const ExtensionResource: msRest.CompositeMapper = { - serializedName: "ExtensionResource", +export const ExtensionResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExtensionResource", + className: "ExtensionResourceListResult", modelProperties: { - ...Resource.type.modelProperties, - plan: { - serializedName: "plan", - type: { - name: "Composite", - className: "ExtensionResourcePlan" - } - }, - properties: { - serializedName: "properties", + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "ExtensionResource" } } } @@ -290,30 +211,46 @@ export const ExtensionResource: msRest.CompositeMapper = { } }; -export const ExtensionResourceListResult: msRest.CompositeMapper = { - serializedName: "ExtensionResourceListResult", +export const ExtensionResourcePlan: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExtensionResourceListResult", + className: "ExtensionResourcePlan", modelProperties: { - value: { - serializedName: "value", + name: { + serializedName: "name", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ExtensionResource" - } - } + name: "String" + } + }, + product: { + serializedName: "product", + type: { + name: "String" + } + }, + promotionCode: { + serializedName: "promotionCode", + type: { + name: "String" + } + }, + publisher: { + serializedName: "publisher", + type: { + name: "String" + } + }, + version: { + serializedName: "version", + type: { + name: "String" } } } } }; -export const ExtensionResourceRequest: msRest.CompositeMapper = { - serializedName: "ExtensionResourceRequest", +export const ExtensionResourceRequest: coreClient.CompositeMapper = { type: { name: "Composite", className: "ExtensionResourceRequest", @@ -335,90 +272,82 @@ export const ExtensionResourceRequest: msRest.CompositeMapper = { serializedName: "properties", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } } } } }; -export const OperationProperties: msRest.CompositeMapper = { - serializedName: "OperationProperties", +export const AccountResourceRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationProperties", + className: "AccountResourceRequest", modelProperties: { - description: { - serializedName: "description", + accountName: { + serializedName: "accountName", type: { name: "String" } }, - operation: { - serializedName: "operation", + location: { + serializedName: "location", type: { name: "String" } }, - provider: { - serializedName: "provider", + operationType: { + serializedName: "operationType", type: { - name: "String" + name: "Enum", + allowedValues: ["unknown", "create", "update", "link"] } }, - resource: { - serializedName: "resource", + properties: { + serializedName: "properties", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const AccountTagRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "AccountTagRequest", modelProperties: { - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationProperties" - } - }, - name: { - serializedName: "name", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const ProjectResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "ProjectResourceListResult", modelProperties: { value: { serializedName: "value", @@ -427,7 +356,7 @@ export const OperationListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" + className: "ProjectResource" } } } @@ -436,44 +365,58 @@ export const OperationListResult: msRest.CompositeMapper = { } }; -export const ProjectResource: msRest.CompositeMapper = { - serializedName: "ProjectResource", +export const AccountResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProjectResource", + className: "AccountResource", modelProperties: { ...Resource.type.modelProperties, properties: { serializedName: "properties", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } } } } }; -export const ProjectResourceListResult: msRest.CompositeMapper = { - serializedName: "ProjectResourceListResult", +export const ExtensionResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProjectResourceListResult", + className: "ExtensionResource", modelProperties: { - value: { - serializedName: "value", + ...Resource.type.modelProperties, + plan: { + serializedName: "plan", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProjectResource" - } - } + name: "Composite", + className: "ExtensionResourcePlan" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ProjectResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectResource", + modelProperties: { + ...Resource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" } } } } } diff --git a/sdk/visualstudio/arm-visualstudio/src/models/operationsMappers.ts b/sdk/visualstudio/arm-visualstudio/src/models/operationsMappers.ts deleted file mode 100644 index 57d796e7cf0d..000000000000 --- a/sdk/visualstudio/arm-visualstudio/src/models/operationsMappers.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - OperationListResult, - Operation, - OperationProperties, - CloudError -} from "../models/mappers"; - diff --git a/sdk/visualstudio/arm-visualstudio/src/models/parameters.ts b/sdk/visualstudio/arm-visualstudio/src/models/parameters.ts index e21d28a76bc9..6f53a7516488 100644 --- a/sdk/visualstudio/arm-visualstudio/src/models/parameters.ts +++ b/sdk/visualstudio/arm-visualstudio/src/models/parameters.ts @@ -1,136 +1,201 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + CheckNameAvailabilityParameter as CheckNameAvailabilityParameterMapper, + AccountResourceRequest as AccountResourceRequestMapper, + AccountTagRequest as AccountTagRequestMapper, + ExtensionResourceRequest as ExtensionResourceRequestMapper, + ProjectResource as ProjectResourceMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const accountResourceName: msRest.OperationURLParameter = { - parameterPath: "accountResourceName", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "accountResourceName", + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const body: OperationParameter = { + parameterPath: "body", + mapper: CheckNameAvailabilityParameterMapper +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "api-version", type: { name: "String" } } }; -export const extensionResourceName: msRest.OperationURLParameter = { - parameterPath: "extensionResourceName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "extensionResourceName", + defaultValue: "2014-04-01-preview", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const jobId: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "jobId" - ], + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { - serializedName: "jobId", + serializedName: "resourceGroupName", + required: true, type: { - name: "Uuid" + name: "String" } } }; -export const operation: msRest.OperationQueryParameter = { - parameterPath: "operation", + +export const body1: OperationParameter = { + parameterPath: "body", + mapper: AccountResourceRequestMapper +}; + +export const resourceName: OperationURLParameter = { + parameterPath: "resourceName", mapper: { + serializedName: "resourceName", required: true, - serializedName: "operation", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const body2: OperationParameter = { + parameterPath: "body", + mapper: AccountTagRequestMapper +}; + +export const accountResourceName: OperationURLParameter = { + parameterPath: "accountResourceName", mapper: { + serializedName: "accountResourceName", required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const resourceName: msRest.OperationURLParameter = { - parameterPath: "resourceName", + +export const body3: OperationParameter = { + parameterPath: "body", + mapper: ExtensionResourceRequestMapper +}; + +export const extensionResourceName: OperationURLParameter = { + parameterPath: "extensionResourceName", mapper: { + serializedName: "extensionResourceName", required: true, - serializedName: "resourceName", type: { name: "String" } } }; -export const rootResourceName: msRest.OperationURLParameter = { + +export const rootResourceName: OperationURLParameter = { parameterPath: "rootResourceName", mapper: { - required: true, serializedName: "rootResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const body4: OperationParameter = { + parameterPath: "body", + mapper: ProjectResourceMapper +}; + +export const validating: OperationQueryParameter = { + parameterPath: ["options", "validating"], + mapper: { + serializedName: "validating", type: { name: "String" } } }; -export const subContainerName: msRest.OperationURLParameter = { + +export const subContainerName: OperationURLParameter = { parameterPath: "subContainerName", mapper: { - required: true, serializedName: "subContainerName", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const operation: OperationQueryParameter = { + parameterPath: "operation", mapper: { + serializedName: "operation", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; -export const validating: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "validating" - ], + +export const jobId: OperationQueryParameter = { + parameterPath: ["options", "jobId"], mapper: { - serializedName: "validating", + serializedName: "jobId", type: { - name: "String" + name: "Uuid" } } }; diff --git a/sdk/visualstudio/arm-visualstudio/src/models/projectsMappers.ts b/sdk/visualstudio/arm-visualstudio/src/models/projectsMappers.ts deleted file mode 100644 index 1db89b6e585d..000000000000 --- a/sdk/visualstudio/arm-visualstudio/src/models/projectsMappers.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - ProjectResourceListResult, - ProjectResource, - Resource, - BaseResource, - CloudError, - AccountResource, - ExtensionResource, - ExtensionResourcePlan -} from "../models/mappers"; - diff --git a/sdk/visualstudio/arm-visualstudio/src/operations/accounts.ts b/sdk/visualstudio/arm-visualstudio/src/operations/accounts.ts index 7525f3339b0b..a7b99d830288 100644 --- a/sdk/visualstudio/arm-visualstudio/src/operations/accounts.ts +++ b/sdk/visualstudio/arm-visualstudio/src/operations/accounts.ts @@ -1,399 +1,261 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/accountsMappers"; +import { Accounts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VisualStudioResourceProviderClientContext } from "../visualStudioResourceProviderClientContext"; +import { VisualStudioResourceProviderClient } from "../visualStudioResourceProviderClient"; +import { + CheckNameAvailabilityParameter, + AccountsCheckNameAvailabilityOptionalParams, + AccountsCheckNameAvailabilityResponse, + AccountsListByResourceGroupOptionalParams, + AccountsListByResourceGroupResponse, + AccountResourceRequest, + AccountsCreateOrUpdateOptionalParams, + AccountsCreateOrUpdateResponse, + AccountsDeleteOptionalParams, + AccountsGetOptionalParams, + AccountsGetResponse, + AccountTagRequest, + AccountsUpdateOptionalParams, + AccountsUpdateResponse +} from "../models"; -/** Class representing a Accounts. */ -export class Accounts { - private readonly client: VisualStudioResourceProviderClientContext; +/** Class containing Accounts operations. */ +export class AccountsImpl implements Accounts { + private readonly client: VisualStudioResourceProviderClient; /** - * Create a Accounts. - * @param {VisualStudioResourceProviderClientContext} client Reference to the service client. + * Initialize a new instance of the class Accounts class. + * @param client Reference to the service client */ - constructor(client: VisualStudioResourceProviderClientContext) { + constructor(client: VisualStudioResourceProviderClient) { this.client = client; } /** - * Checks if the specified Visual Studio Team Services account name is available. Resource name can - * be either an account name or an account name and PUID. - * @summary Accounts_CheckNameAvailability + * Checks if the specified Visual Studio Team Services account name is available. Resource name can be + * either an account name or an account name and PUID. * @param body Parameters describing the name to check availability for. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - checkNameAvailability(body: Models.CheckNameAvailabilityParameter, options?: msRest.RequestOptionsBase): Promise; - /** - * @param body Parameters describing the name to check availability for. - * @param callback The callback - */ - checkNameAvailability(body: Models.CheckNameAvailabilityParameter, callback: msRest.ServiceCallback): void; - /** - * @param body Parameters describing the name to check availability for. - * @param options The optional parameters - * @param callback The callback - */ - checkNameAvailability(body: Models.CheckNameAvailabilityParameter, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(body: Models.CheckNameAvailabilityParameter, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + checkNameAvailability( + body: CheckNameAvailabilityParameter, + options?: AccountsCheckNameAvailabilityOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - body, - options - }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + { body, options }, + checkNameAvailabilityOperationSpec + ); } /** * Gets all Visual Studio Team Services account resources under the resource group linked to the * specified Azure subscription. - * @summary Accounts_ListByResourceGroup * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByResourceGroup( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** * Creates or updates a Visual Studio Team Services account resource. - * @summary Accounts_CreateOrUpdate - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param body The request data. - * @param resourceName Name of the resource. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, body: Models.AccountResourceRequest, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param body The request data. * @param resourceName Name of the resource. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, body: Models.AccountResourceRequest, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. * @param body The request data. - * @param resourceName Name of the resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, body: Models.AccountResourceRequest, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, body: Models.AccountResourceRequest, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + resourceName: string, + body: AccountResourceRequest, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - body, - resourceName, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, body, options }, + createOrUpdateOperationSpec + ); } /** * Deletes a Visual Studio Team Services account resource. - * @summary Accounts_Delete - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param resourceName Name of the resource. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param resourceName Name of the resource. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** * @param resourceGroupName Name of the resource group within the Azure subscription. * @param resourceName Name of the resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + resourceName: string, + options?: AccountsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, resourceName, options }, + deleteOperationSpec + ); } /** * Gets the Visual Studio Team Services account resource details. - * @summary Accounts_Get * @param resourceGroupName Name of the resource group within the Azure subscription. * @param resourceName Name of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param resourceName Name of the resource. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param resourceName Name of the resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + options?: AccountsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + getOperationSpec + ); } /** * Updates tags for Visual Studio Team Services account resource. - * @summary Accounts_Update * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param body The request data. * @param resourceName Name of the resource. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, body: Models.AccountTagRequest, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param body The request data. - * @param resourceName Name of the resource. - * @param callback The callback - */ - update(resourceGroupName: string, body: Models.AccountTagRequest, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. * @param body The request data. - * @param resourceName Name of the resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, body: Models.AccountTagRequest, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, body: Models.AccountTagRequest, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + resourceName: string, + body: AccountTagRequest, + options?: AccountsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - body, - resourceName, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, body, options }, + updateOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/microsoft.visualstudio/checkNameAvailability", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/microsoft.visualstudio/checkNameAvailability", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "body", - mapper: { - ...Mappers.CheckNameAvailabilityParameter, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CheckNameAvailabilityResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AccountResourceListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{resourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], - requestBody: { - parameterPath: "body", - mapper: { - ...Mappers.AccountResourceRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{resourceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.AccountResource }, - 404: {}, - default: { - bodyMapper: Mappers.CloudError - } + 404: {} }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{resourceName}", + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{resourceName}", +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{resourceName}", + httpMethod: "DELETE", + responses: { 200: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{resourceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AccountResource }, - 404: {}, - default: { - bodyMapper: Mappers.CloudError - } + 404: {} }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{resourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "body", - mapper: { - ...Mappers.AccountTagRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{resourceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.AccountResource }, - 404: {}, - default: { - bodyMapper: Mappers.CloudError - } + 404: {} }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/visualstudio/arm-visualstudio/src/operations/extensions.ts b/sdk/visualstudio/arm-visualstudio/src/operations/extensions.ts index 2c77db197caa..4ce89d48ba36 100644 --- a/sdk/visualstudio/arm-visualstudio/src/operations/extensions.ts +++ b/sdk/visualstudio/arm-visualstudio/src/operations/extensions.ts @@ -1,131 +1,98 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/extensionsMappers"; +import { Extensions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VisualStudioResourceProviderClientContext } from "../visualStudioResourceProviderClientContext"; +import { VisualStudioResourceProviderClient } from "../visualStudioResourceProviderClient"; +import { + ExtensionsListByAccountOptionalParams, + ExtensionsListByAccountResponse, + ExtensionResourceRequest, + ExtensionsCreateOptionalParams, + ExtensionsCreateResponse, + ExtensionsDeleteOptionalParams, + ExtensionsGetOptionalParams, + ExtensionsGetResponse, + ExtensionsUpdateOptionalParams, + ExtensionsUpdateResponse +} from "../models"; -/** Class representing a Extensions. */ -export class Extensions { - private readonly client: VisualStudioResourceProviderClientContext; +/** Class containing Extensions operations. */ +export class ExtensionsImpl implements Extensions { + private readonly client: VisualStudioResourceProviderClient; /** - * Create a Extensions. - * @param {VisualStudioResourceProviderClientContext} client Reference to the service client. + * Initialize a new instance of the class Extensions class. + * @param client Reference to the service client */ - constructor(client: VisualStudioResourceProviderClientContext) { + constructor(client: VisualStudioResourceProviderClient) { this.client = client; } /** * Gets the details of the extension resources created within the resource group. - * @summary Extensions_ListByAccount * @param resourceGroupName Name of the resource group within the Azure subscription. * @param accountResourceName The name of the Visual Studio Team Services account resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByAccount(resourceGroupName: string, accountResourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param accountResourceName The name of the Visual Studio Team Services account resource. - * @param callback The callback - */ - listByAccount(resourceGroupName: string, accountResourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param accountResourceName The name of the Visual Studio Team Services account resource. - * @param options The optional parameters - * @param callback The callback - */ - listByAccount(resourceGroupName: string, accountResourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByAccount(resourceGroupName: string, accountResourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByAccount( + resourceGroupName: string, + accountResourceName: string, + options?: ExtensionsListByAccountOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - accountResourceName, - options - }, - listByAccountOperationSpec, - callback) as Promise; + { resourceGroupName, accountResourceName, options }, + listByAccountOperationSpec + ); } /** * Registers the extension with a Visual Studio Team Services account. - * @summary Extensions_Create * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param body An object containing additional information related to the extension request. * @param accountResourceName The name of the Visual Studio Team Services account resource. * @param extensionResourceName The name of the extension. - * @param [options] The optional parameters - * @returns Promise - */ - create(resourceGroupName: string, body: Models.ExtensionResourceRequest, accountResourceName: string, extensionResourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. * @param body An object containing additional information related to the extension request. - * @param accountResourceName The name of the Visual Studio Team Services account resource. - * @param extensionResourceName The name of the extension. - * @param callback The callback - */ - create(resourceGroupName: string, body: Models.ExtensionResourceRequest, accountResourceName: string, extensionResourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param body An object containing additional information related to the extension request. - * @param accountResourceName The name of the Visual Studio Team Services account resource. - * @param extensionResourceName The name of the extension. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - create(resourceGroupName: string, body: Models.ExtensionResourceRequest, accountResourceName: string, extensionResourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - create(resourceGroupName: string, body: Models.ExtensionResourceRequest, accountResourceName: string, extensionResourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + create( + resourceGroupName: string, + accountResourceName: string, + extensionResourceName: string, + body: ExtensionResourceRequest, + options?: ExtensionsCreateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, - body, accountResourceName, extensionResourceName, + body, options }, - createOperationSpec, - callback) as Promise; + createOperationSpec + ); } /** * Removes an extension resource registration for a Visual Studio Team Services account. - * @summary Extensions_Delete - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param accountResourceName The name of the Visual Studio Team Services account resource. - * @param extensionResourceName The name of the extension. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** * @param resourceGroupName Name of the resource group within the Azure subscription. * @param accountResourceName The name of the Visual Studio Team Services account resource. * @param extensionResourceName The name of the extension. - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param accountResourceName The name of the Visual Studio Team Services account resource. - * @param extensionResourceName The name of the extension. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + accountResourceName: string, + extensionResourceName: string, + options?: ExtensionsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -133,36 +100,23 @@ export class Extensions { extensionResourceName, options }, - deleteMethodOperationSpec, - callback); + deleteOperationSpec + ); } /** * Gets the details of an extension associated with a Visual Studio Team Services account resource. - * @summary Extensions_Get - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param accountResourceName The name of the Visual Studio Team Services account resource. - * @param extensionResourceName The name of the extension. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param accountResourceName The name of the Visual Studio Team Services account resource. - * @param extensionResourceName The name of the extension. - * @param callback The callback - */ - get(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, callback: msRest.ServiceCallback): void; - /** * @param resourceGroupName Name of the resource group within the Azure subscription. * @param accountResourceName The name of the Visual Studio Team Services account resource. * @param extensionResourceName The name of the extension. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, accountResourceName: string, extensionResourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + accountResourceName: string, + extensionResourceName: string, + options?: ExtensionsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -170,192 +124,136 @@ export class Extensions { extensionResourceName, options }, - getOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** * Updates an existing extension registration for the Visual Studio Team Services account. - * @summary Extensions_Update - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param body An object containing additional information related to the extension request. - * @param accountResourceName The name of the Visual Studio Team Services account resource. - * @param extensionResourceName The name of the extension. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, body: Models.ExtensionResourceRequest, accountResourceName: string, extensionResourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param body An object containing additional information related to the extension request. * @param accountResourceName The name of the Visual Studio Team Services account resource. * @param extensionResourceName The name of the extension. - * @param callback The callback - */ - update(resourceGroupName: string, body: Models.ExtensionResourceRequest, accountResourceName: string, extensionResourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. * @param body An object containing additional information related to the extension request. - * @param accountResourceName The name of the Visual Studio Team Services account resource. - * @param extensionResourceName The name of the extension. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, body: Models.ExtensionResourceRequest, accountResourceName: string, extensionResourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, body: Models.ExtensionResourceRequest, accountResourceName: string, extensionResourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + accountResourceName: string, + extensionResourceName: string, + body: ExtensionResourceRequest, + options?: ExtensionsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, - body, accountResourceName, extensionResourceName, + body, options }, - updateOperationSpec, - callback) as Promise; + updateOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByAccountOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByAccountOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{accountResourceName}/extension", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{accountResourceName}/extension", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountResourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ExtensionResourceListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{accountResourceName}/extension/{extensionResourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, - Parameters.accountResourceName, - Parameters.extensionResourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.accountResourceName ], - requestBody: { - parameterPath: "body", - mapper: { - ...Mappers.ExtensionResourceRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{accountResourceName}/extension/{extensionResourceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ExtensionResource - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{accountResourceName}/extension/{extensionResourceName}", + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.accountResourceName, Parameters.extensionResourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{accountResourceName}/extension/{extensionResourceName}", +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{accountResourceName}/extension/{extensionResourceName}", + httpMethod: "DELETE", + responses: { 200: {} }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.accountResourceName, Parameters.extensionResourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{accountResourceName}/extension/{extensionResourceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ExtensionResource }, - 404: {}, - default: { - bodyMapper: Mappers.CloudError - } + 404: {} }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{accountResourceName}/extension/{extensionResourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.accountResourceName, Parameters.extensionResourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "body", - mapper: { - ...Mappers.ExtensionResourceRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{accountResourceName}/extension/{extensionResourceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.ExtensionResource - }, - default: { - bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountResourceName, + Parameters.extensionResourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/visualstudio/arm-visualstudio/src/operations/index.ts b/sdk/visualstudio/arm-visualstudio/src/operations/index.ts index 22da898839e4..e023a3ba5c51 100644 --- a/sdk/visualstudio/arm-visualstudio/src/operations/index.ts +++ b/sdk/visualstudio/arm-visualstudio/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./operations"; diff --git a/sdk/visualstudio/arm-visualstudio/src/operations/operations.ts b/sdk/visualstudio/arm-visualstudio/src/operations/operations.ts index d84657394e57..35e9e2125ac2 100644 --- a/sdk/visualstudio/arm-visualstudio/src/operations/operations.ts +++ b/sdk/visualstudio/arm-visualstudio/src/operations/operations.ts @@ -1,72 +1,55 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VisualStudioResourceProviderClientContext } from "../visualStudioResourceProviderClientContext"; +import { VisualStudioResourceProviderClient } from "../visualStudioResourceProviderClient"; +import { + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: VisualStudioResourceProviderClientContext; +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: VisualStudioResourceProviderClient; /** - * Create a Operations. - * @param {VisualStudioResourceProviderClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: VisualStudioResourceProviderClientContext) { + constructor(client: VisualStudioResourceProviderClient) { this.client = client; } /** * Gets the details of all operations possible on the Microsoft.VisualStudio resource provider. - * @summary Operations_List - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/microsoft.visualstudio/operations", httpMethod: "GET", - path: "providers/microsoft.visualstudio/operations", - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/visualstudio/arm-visualstudio/src/operations/projects.ts b/sdk/visualstudio/arm-visualstudio/src/operations/projects.ts index 47eff4220f89..ed5d435854ae 100644 --- a/sdk/visualstudio/arm-visualstudio/src/operations/projects.ts +++ b/sdk/visualstudio/arm-visualstudio/src/operations/projects.ts @@ -1,196 +1,224 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/projectsMappers"; +import { Projects } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VisualStudioResourceProviderClientContext } from "../visualStudioResourceProviderClientContext"; +import { VisualStudioResourceProviderClient } from "../visualStudioResourceProviderClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ProjectsListByResourceGroupOptionalParams, + ProjectsListByResourceGroupResponse, + ProjectResource, + ProjectsCreateOptionalParams, + ProjectsCreateResponse, + ProjectsGetOptionalParams, + ProjectsGetResponse, + ProjectsUpdateOptionalParams, + ProjectsUpdateResponse, + ProjectsGetJobStatusOptionalParams, + ProjectsGetJobStatusResponse +} from "../models"; -/** Class representing a Projects. */ -export class Projects { - private readonly client: VisualStudioResourceProviderClientContext; +/** Class containing Projects operations. */ +export class ProjectsImpl implements Projects { + private readonly client: VisualStudioResourceProviderClient; /** - * Create a Projects. - * @param {VisualStudioResourceProviderClientContext} client Reference to the service client. + * Initialize a new instance of the class Projects class. + * @param client Reference to the service client */ - constructor(client: VisualStudioResourceProviderClientContext) { + constructor(client: VisualStudioResourceProviderClient) { this.client = client; } /** * Gets all Visual Studio Team Services project resources created in the specified Team Services * account. - * @summary Projects_ListByResourceGroup * @param resourceGroupName Name of the resource group within the Azure subscription. * @param rootResourceName Name of the Team Services account. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, rootResourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param rootResourceName Name of the Team Services account. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, rootResourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param rootResourceName Name of the Team Services account. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, rootResourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, rootResourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByResourceGroup( + resourceGroupName: string, + rootResourceName: string, + options?: ProjectsListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - rootResourceName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, rootResourceName, options }, + listByResourceGroupOperationSpec + ); } /** - * Creates a Team Services project in the collection with the specified name. - * 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. - * Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: + * Creates a Team Services project in the collection with the specified name. 'VersionControlOption' + * and 'ProcessTemplateId' must be specified in the resource properties. Valid values for + * VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: * 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, * 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process * templates). - * @summary Projects_Create - * @param body The request data. * @param resourceGroupName Name of the resource group within the Azure subscription. * @param rootResourceName Name of the Team Services account. * @param resourceName Name of the Team Services project. - * @param [options] The optional parameters - * @returns Promise + * @param body The request data. + * @param options The options parameters. */ - create(body: Models.ProjectResource, resourceGroupName: string, rootResourceName: string, resourceName: string, options?: Models.ProjectsCreateOptionalParams): Promise { - return this.beginCreate(body,resourceGroupName,rootResourceName,resourceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreate( + resourceGroupName: string, + rootResourceName: string, + resourceName: string, + body: ProjectResource, + options?: ProjectsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProjectsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, rootResourceName, resourceName, body, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Gets the details of a Team Services project resource. - * @summary Projects_Get - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param rootResourceName Name of the Team Services account. - * @param resourceName Name of the Team Services project. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, rootResourceName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Creates a Team Services project in the collection with the specified name. 'VersionControlOption' + * and 'ProcessTemplateId' must be specified in the resource properties. Valid values for + * VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: + * 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, + * 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process + * templates). * @param resourceGroupName Name of the resource group within the Azure subscription. * @param rootResourceName Name of the Team Services account. * @param resourceName Name of the Team Services project. - * @param callback The callback + * @param body The request data. + * @param options The options parameters. */ - get(resourceGroupName: string, rootResourceName: string, resourceName: string, callback: msRest.ServiceCallback): void; + async beginCreateAndWait( + resourceGroupName: string, + rootResourceName: string, + resourceName: string, + body: ProjectResource, + options?: ProjectsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + rootResourceName, + resourceName, + body, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets the details of a Team Services project resource. * @param resourceGroupName Name of the resource group within the Azure subscription. * @param rootResourceName Name of the Team Services account. * @param resourceName Name of the Team Services project. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, rootResourceName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, rootResourceName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + rootResourceName: string, + resourceName: string, + options?: ProjectsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - rootResourceName, - resourceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, rootResourceName, resourceName, options }, + getOperationSpec + ); } /** * Updates the tags of the specified Team Services project. - * @summary Projects_Update * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param body The request data. * @param rootResourceName Name of the Team Services account. * @param resourceName Name of the Team Services project. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, body: Models.ProjectResource, rootResourceName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. * @param body The request data. - * @param rootResourceName Name of the Team Services account. - * @param resourceName Name of the Team Services project. - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, body: Models.ProjectResource, rootResourceName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param body The request data. - * @param rootResourceName Name of the Team Services account. - * @param resourceName Name of the Team Services project. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, body: Models.ProjectResource, rootResourceName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, body: Models.ProjectResource, rootResourceName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + rootResourceName: string, + resourceName: string, + body: ProjectResource, + options?: ProjectsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - body, - rootResourceName, - resourceName, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, rootResourceName, resourceName, body, options }, + updateOperationSpec + ); } /** * Gets the status of the project resource creation job. - * @summary Projects_GetJobStatus * @param resourceGroupName Name of the resource group within the Azure subscription. * @param rootResourceName Name of the Team Services account. * @param resourceName Name of the Team Services project. * @param subContainerName This parameter should be set to the resourceName. * @param operation The operation type. The only supported value is 'put'. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getJobStatus(resourceGroupName: string, rootResourceName: string, resourceName: string, subContainerName: string, operation: string, options?: Models.ProjectsGetJobStatusOptionalParams): Promise; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param rootResourceName Name of the Team Services account. - * @param resourceName Name of the Team Services project. - * @param subContainerName This parameter should be set to the resourceName. - * @param operation The operation type. The only supported value is 'put'. - * @param callback The callback - */ - getJobStatus(resourceGroupName: string, rootResourceName: string, resourceName: string, subContainerName: string, operation: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param rootResourceName Name of the Team Services account. - * @param resourceName Name of the Team Services project. - * @param subContainerName This parameter should be set to the resourceName. - * @param operation The operation type. The only supported value is 'put'. - * @param options The optional parameters - * @param callback The callback - */ - getJobStatus(resourceGroupName: string, rootResourceName: string, resourceName: string, subContainerName: string, operation: string, options: Models.ProjectsGetJobStatusOptionalParams, callback: msRest.ServiceCallback): void; - getJobStatus(resourceGroupName: string, rootResourceName: string, resourceName: string, subContainerName: string, operation: string, options?: Models.ProjectsGetJobStatusOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getJobStatus( + resourceGroupName: string, + rootResourceName: string, + resourceName: string, + subContainerName: string, + operation: string, + options?: ProjectsGetJobStatusOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -200,187 +228,129 @@ export class Projects { operation, options }, - getJobStatusOperationSpec, - callback) as Promise; - } - - /** - * Creates a Team Services project in the collection with the specified name. - * 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. - * Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: - * 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, - * 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process - * templates). - * @summary Projects_Create - * @param body The request data. - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param rootResourceName Name of the Team Services account. - * @param resourceName Name of the Team Services project. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreate(body: Models.ProjectResource, resourceGroupName: string, rootResourceName: string, resourceName: string, options?: Models.ProjectsBeginCreateOptionalParams): Promise { - return this.client.sendLRORequest( - { - body, - resourceGroupName, - rootResourceName, - resourceName, - options - }, - beginCreateOperationSpec, - options); + getJobStatusOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.rootResourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ProjectResourceListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project/{resourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, - Parameters.rootResourceName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.rootResourceName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project/{resourceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ProjectResource }, - 404: {}, - default: { - bodyMapper: Mappers.CloudError + 201: { + bodyMapper: Mappers.ProjectResource + }, + 202: { + bodyMapper: Mappers.ProjectResource + }, + 204: { + bodyMapper: Mappers.ProjectResource } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project/{resourceName}", + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion, Parameters.validating], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, - Parameters.rootResourceName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.rootResourceName ], - requestBody: { - parameterPath: "body", - mapper: { - ...Mappers.ProjectResource, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project/{resourceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ProjectResource }, - default: { - bodyMapper: Mappers.CloudError - } + 404: {} }, - serializer -}; - -const getJobStatusOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project/{resourceName}/subContainers/{subContainerName}/status", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, - Parameters.rootResourceName, + Parameters.resourceGroupName, Parameters.resourceName, - Parameters.subContainerName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.operation, - Parameters.jobId - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.rootResourceName ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project/{resourceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.ProjectResource - }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project/{resourceName}", + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.subscriptionId, - Parameters.rootResourceName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.validating - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.rootResourceName ], - requestBody: { - parameterPath: "body", - mapper: { - ...Mappers.ProjectResource, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getJobStatusOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project/{resourceName}/subContainers/{subContainerName}/status", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ProjectResource }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } + 202: {} }, + queryParameters: [ + Parameters.apiVersion, + Parameters.operation, + Parameters.jobId + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.rootResourceName, + Parameters.subContainerName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/accounts.ts b/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/accounts.ts new file mode 100644 index 000000000000..eb4a8133070d --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/accounts.ts @@ -0,0 +1,96 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + CheckNameAvailabilityParameter, + AccountsCheckNameAvailabilityOptionalParams, + AccountsCheckNameAvailabilityResponse, + AccountsListByResourceGroupOptionalParams, + AccountsListByResourceGroupResponse, + AccountResourceRequest, + AccountsCreateOrUpdateOptionalParams, + AccountsCreateOrUpdateResponse, + AccountsDeleteOptionalParams, + AccountsGetOptionalParams, + AccountsGetResponse, + AccountTagRequest, + AccountsUpdateOptionalParams, + AccountsUpdateResponse +} from "../models"; + +/** Interface representing a Accounts. */ +export interface Accounts { + /** + * Checks if the specified Visual Studio Team Services account name is available. Resource name can be + * either an account name or an account name and PUID. + * @param body Parameters describing the name to check availability for. + * @param options The options parameters. + */ + checkNameAvailability( + body: CheckNameAvailabilityParameter, + options?: AccountsCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Gets all Visual Studio Team Services account resources under the resource group linked to the + * specified Azure subscription. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): Promise; + /** + * Creates or updates a Visual Studio Team Services account resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceName Name of the resource. + * @param body The request data. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + resourceName: string, + body: AccountResourceRequest, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a Visual Studio Team Services account resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceName Name of the resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + options?: AccountsDeleteOptionalParams + ): Promise; + /** + * Gets the Visual Studio Team Services account resource details. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceName Name of the resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: AccountsGetOptionalParams + ): Promise; + /** + * Updates tags for Visual Studio Team Services account resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceName Name of the resource. + * @param body The request data. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + body: AccountTagRequest, + options?: AccountsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/extensions.ts b/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/extensions.ts new file mode 100644 index 000000000000..950272d74dc0 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/extensions.ts @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + ExtensionsListByAccountOptionalParams, + ExtensionsListByAccountResponse, + ExtensionResourceRequest, + ExtensionsCreateOptionalParams, + ExtensionsCreateResponse, + ExtensionsDeleteOptionalParams, + ExtensionsGetOptionalParams, + ExtensionsGetResponse, + ExtensionsUpdateOptionalParams, + ExtensionsUpdateResponse +} from "../models"; + +/** Interface representing a Extensions. */ +export interface Extensions { + /** + * Gets the details of the extension resources created within the resource group. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param accountResourceName The name of the Visual Studio Team Services account resource. + * @param options The options parameters. + */ + listByAccount( + resourceGroupName: string, + accountResourceName: string, + options?: ExtensionsListByAccountOptionalParams + ): Promise; + /** + * Registers the extension with a Visual Studio Team Services account. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param accountResourceName The name of the Visual Studio Team Services account resource. + * @param extensionResourceName The name of the extension. + * @param body An object containing additional information related to the extension request. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + accountResourceName: string, + extensionResourceName: string, + body: ExtensionResourceRequest, + options?: ExtensionsCreateOptionalParams + ): Promise; + /** + * Removes an extension resource registration for a Visual Studio Team Services account. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param accountResourceName The name of the Visual Studio Team Services account resource. + * @param extensionResourceName The name of the extension. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + accountResourceName: string, + extensionResourceName: string, + options?: ExtensionsDeleteOptionalParams + ): Promise; + /** + * Gets the details of an extension associated with a Visual Studio Team Services account resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param accountResourceName The name of the Visual Studio Team Services account resource. + * @param extensionResourceName The name of the extension. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountResourceName: string, + extensionResourceName: string, + options?: ExtensionsGetOptionalParams + ): Promise; + /** + * Updates an existing extension registration for the Visual Studio Team Services account. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param accountResourceName The name of the Visual Studio Team Services account resource. + * @param extensionResourceName The name of the extension. + * @param body An object containing additional information related to the extension request. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + accountResourceName: string, + extensionResourceName: string, + body: ExtensionResourceRequest, + options?: ExtensionsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/index.ts b/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..e023a3ba5c51 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./accounts"; +export * from "./extensions"; +export * from "./projects"; diff --git a/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/operations.ts b/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..6ad60f932cce --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/operations.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; + +/** Interface representing a Operations. */ +export interface Operations { + /** + * Gets the details of all operations possible on the Microsoft.VisualStudio resource provider. + * @param options The options parameters. + */ + list(options?: OperationsListOptionalParams): Promise; +} diff --git a/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/projects.ts b/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/projects.ts new file mode 100644 index 000000000000..91179218e126 --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/src/operationsInterfaces/projects.ts @@ -0,0 +1,128 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ProjectsListByResourceGroupOptionalParams, + ProjectsListByResourceGroupResponse, + ProjectResource, + ProjectsCreateOptionalParams, + ProjectsCreateResponse, + ProjectsGetOptionalParams, + ProjectsGetResponse, + ProjectsUpdateOptionalParams, + ProjectsUpdateResponse, + ProjectsGetJobStatusOptionalParams, + ProjectsGetJobStatusResponse +} from "../models"; + +/** Interface representing a Projects. */ +export interface Projects { + /** + * Gets all Visual Studio Team Services project resources created in the specified Team Services + * account. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param rootResourceName Name of the Team Services account. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + rootResourceName: string, + options?: ProjectsListByResourceGroupOptionalParams + ): Promise; + /** + * Creates a Team Services project in the collection with the specified name. 'VersionControlOption' + * and 'ProcessTemplateId' must be specified in the resource properties. Valid values for + * VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: + * 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, + * 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process + * templates). + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param rootResourceName Name of the Team Services account. + * @param resourceName Name of the Team Services project. + * @param body The request data. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + rootResourceName: string, + resourceName: string, + body: ProjectResource, + options?: ProjectsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProjectsCreateResponse + > + >; + /** + * Creates a Team Services project in the collection with the specified name. 'VersionControlOption' + * and 'ProcessTemplateId' must be specified in the resource properties. Valid values for + * VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: + * 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, + * 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process + * templates). + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param rootResourceName Name of the Team Services account. + * @param resourceName Name of the Team Services project. + * @param body The request data. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + rootResourceName: string, + resourceName: string, + body: ProjectResource, + options?: ProjectsCreateOptionalParams + ): Promise; + /** + * Gets the details of a Team Services project resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param rootResourceName Name of the Team Services account. + * @param resourceName Name of the Team Services project. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + rootResourceName: string, + resourceName: string, + options?: ProjectsGetOptionalParams + ): Promise; + /** + * Updates the tags of the specified Team Services project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param rootResourceName Name of the Team Services account. + * @param resourceName Name of the Team Services project. + * @param body The request data. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + rootResourceName: string, + resourceName: string, + body: ProjectResource, + options?: ProjectsUpdateOptionalParams + ): Promise; + /** + * Gets the status of the project resource creation job. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param rootResourceName Name of the Team Services account. + * @param resourceName Name of the Team Services project. + * @param subContainerName This parameter should be set to the resourceName. + * @param operation The operation type. The only supported value is 'put'. + * @param options The options parameters. + */ + getJobStatus( + resourceGroupName: string, + rootResourceName: string, + resourceName: string, + subContainerName: string, + operation: string, + options?: ProjectsGetJobStatusOptionalParams + ): Promise; +} diff --git a/sdk/visualstudio/arm-visualstudio/src/visualStudioResourceProviderClient.ts b/sdk/visualstudio/arm-visualstudio/src/visualStudioResourceProviderClient.ts index f96554b8c9e7..311e6343f94b 100644 --- a/sdk/visualstudio/arm-visualstudio/src/visualStudioResourceProviderClient.ts +++ b/sdk/visualstudio/arm-visualstudio/src/visualStudioResourceProviderClient.ts @@ -1,48 +1,91 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { VisualStudioResourceProviderClientContext } from "./visualStudioResourceProviderClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + AccountsImpl, + ExtensionsImpl, + ProjectsImpl +} from "./operations"; +import { + Operations, + Accounts, + Extensions, + Projects +} from "./operationsInterfaces"; +import { VisualStudioResourceProviderClientOptionalParams } from "./models"; - -class VisualStudioResourceProviderClient extends VisualStudioResourceProviderClientContext { - // Operation groups - operations: operations.Operations; - accounts: operations.Accounts; - extensions: operations.Extensions; - projects: operations.Projects; +export class VisualStudioResourceProviderClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; /** * Initializes a new instance of the VisualStudioResourceProviderClient class. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId The Azure subscription identifier. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.VisualStudioResourceProviderClientOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.accounts = new operations.Accounts(this); - this.extensions = new operations.Extensions(this); - this.projects = new operations.Projects(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: VisualStudioResourceProviderClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: VisualStudioResourceProviderClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-visualstudio/4.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - VisualStudioResourceProviderClient, - VisualStudioResourceProviderClientContext, - Models as VisualStudioResourceProviderModels, - Mappers as VisualStudioResourceProviderMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2014-04-01-preview"; + this.operations = new OperationsImpl(this); + this.accounts = new AccountsImpl(this); + this.extensions = new ExtensionsImpl(this); + this.projects = new ProjectsImpl(this); + } + + operations: Operations; + accounts: Accounts; + extensions: Extensions; + projects: Projects; +} diff --git a/sdk/visualstudio/arm-visualstudio/src/visualStudioResourceProviderClientContext.ts b/sdk/visualstudio/arm-visualstudio/src/visualStudioResourceProviderClientContext.ts deleted file mode 100644 index 92491e79696f..000000000000 --- a/sdk/visualstudio/arm-visualstudio/src/visualStudioResourceProviderClientContext.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-visualstudio"; -const packageVersion = "0.1.0"; - -export class VisualStudioResourceProviderClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the VisualStudioResourceProviderClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The Azure subscription identifier. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.VisualStudioResourceProviderClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2014-04-01-preview'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/visualstudio/arm-visualstudio/test/sampleTest.ts b/sdk/visualstudio/arm-visualstudio/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/visualstudio/arm-visualstudio/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/visualstudio/arm-visualstudio/tsconfig.json b/sdk/visualstudio/arm-visualstudio/tsconfig.json index 87bbf5b5fa49..090fcd0758aa 100644 --- a/sdk/visualstudio/arm-visualstudio/tsconfig.json +++ b/sdk/visualstudio/arm-visualstudio/tsconfig.json @@ -3,17 +3,18 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", - "importHelpers": true + "outDir": "./dist-esm", + "importHelpers": true, + "paths": { "@azure/arm-visualstudio": ["./src/index"] } }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/visualstudio/ci.yml b/sdk/visualstudio/ci.yml new file mode 100644 index 000000000000..e1d0f18aefa0 --- /dev/null +++ b/sdk/visualstudio/ci.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/visualstudio/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/visualstudio/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: visualstudio + Artifacts: + - name: azure-arm-visualstudio + safeName: azurearmvisualstudio + \ No newline at end of file diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/CHANGELOG.md b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/CHANGELOG.md new file mode 100644 index 000000000000..209425c8c227 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-01-21) + +The package of @azure/arm-vmwarecloudsimple is using our next generation design principles since version 2.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/LICENSE b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/README.md b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/README.md index c3b3bd2fe941..923a38078bf3 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/README.md +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/README.md @@ -1,99 +1,98 @@ -## Azure VMwareCloudSimpleClient SDK for JavaScript +# Azure Service client library for JavaScript -This package contains an isomorphic SDK for VMwareCloudSimpleClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +Description of the new service + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-vmwarecloudsimple) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-vmwarecloudsimple) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-vmwarecloudsimple` package -### How to Install +Install the Azure Service client library for JavaScript with `npm`: ```bash npm install @azure/arm-vmwarecloudsimple ``` -### How to use +### Create and authenticate a `VMwareCloudSimple` -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" +npm install @azure/identity ``` -##### Sample code - -```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { VMwareCloudSimpleClient, VMwareCloudSimpleModels, VMwareCloudSimpleMappers } from "@azure/arm-vmwarecloudsimple"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new VMwareCloudSimpleClient(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new VMwareCloudSimple(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). -```bash -npm install @azure/ms-rest-browserauth -``` +## Key concepts -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-vmwarecloudsimple sample - - - - - - - - +### VMwareCloudSimple + +`VMwareCloudSimple` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fvmwarecloudsimple%2Farm-vmwarecloudsimple%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/_meta.json b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/_meta.json new file mode 100644 index 000000000000..279f3a1bf603 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "readme": "specification/vmwarecloudsimple/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/vmwarecloudsimple/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" +} \ No newline at end of file diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/api-extractor.json b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/api-extractor.json new file mode 100644 index 000000000000..90591a433115 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-vmwarecloudsimple.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/package.json b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/package.json index 2c614357cfc1..2f5904021e13 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/package.json +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/package.json @@ -1,58 +1,97 @@ { "name": "@azure/arm-vmwarecloudsimple", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "VMwareCloudSimpleClient Library with typescript type definitions for node.js and browser.", - "version": "1.0.0", + "description": "A generated SDK for VMwareCloudSimple.", + "version": "2.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-vmwarecloudsimple.js", - "module": "./esm/vMwareCloudSimpleClient.js", - "types": "./esm/vMwareCloudSimpleClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-vmwarecloudsimple.d.ts", "devDependencies": { - "typescript": "^3.5.3", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-vmwarecloudsimple.js.map'\" -o ./dist/arm-vmwarecloudsimple.min.js ./dist/arm-vmwarecloudsimple.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, + "//metadata": { + "constantPaths": [ + { "path": "src/VMwareCloudSimple.ts", "prefix": "packageDetails" } + ] + }, "autoPublish": true } diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/recordings/node/my_test/recording_sample_test.js b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/review/arm-vmwarecloudsimple.api.md b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/review/arm-vmwarecloudsimple.api.md new file mode 100644 index 000000000000..5dfe2912be47 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/review/arm-vmwarecloudsimple.api.md @@ -0,0 +1,1140 @@ +## API Report File for "@azure/arm-vmwarecloudsimple" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type AggregationType = "Average" | "Total"; + +// @public +export interface AvailableOperation { + display?: AvailableOperationDisplay; + isDataAction?: boolean; + name?: string; + origin?: OperationOrigin; + serviceSpecification?: AvailableOperationDisplayPropertyServiceSpecificationMetricsList; +} + +// @public +export interface AvailableOperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface AvailableOperationDisplayPropertyServiceSpecificationMetricsItem { + aggregationType: AggregationType; + displayDescription: string; + displayName: string; + name: string; + unit: string; +} + +// @public +export interface AvailableOperationDisplayPropertyServiceSpecificationMetricsList { + metricSpecifications?: AvailableOperationDisplayPropertyServiceSpecificationMetricsItem[]; +} + +// @public +export interface AvailableOperationsListResponse { + nextLink?: string; + value?: AvailableOperation[]; +} + +// @public +export interface CsrpError { + error?: CsrpErrorBody; +} + +// @public +export interface CsrpErrorBody { + readonly code?: string; + readonly details?: CsrpErrorBody[]; + readonly message?: string; + target?: string; +} + +// @public +export interface CustomizationHostName { + name?: string; + type?: CustomizationHostNameType; +} + +// @public +export type CustomizationHostNameType = string; + +// @public (undocumented) +export interface CustomizationIdentity { + data?: string; + hostName?: CustomizationHostName; + type?: CustomizationIdentityType; + userData?: CustomizationIdentityUserData; +} + +// @public +export type CustomizationIdentityType = string; + +// @public +export interface CustomizationIdentityUserData { + isPasswordPredefined?: boolean; +} + +// @public (undocumented) +export interface CustomizationIPAddress { + argument?: string; + ipAddress?: string; + type?: CustomizationIPAddressType; +} + +// @public +export type CustomizationIPAddressType = string; + +// @public (undocumented) +export interface CustomizationIPSettings { + gateway?: string[]; + ip?: CustomizationIPAddress; + subnetMask?: string; +} + +// @public (undocumented) +export interface CustomizationNicSetting { + adapter?: CustomizationIPSettings; + macAddress?: string; +} + +// @public +export interface CustomizationPolicies { + get(regionId: string, pcName: string, customizationPolicyName: string, options?: CustomizationPoliciesGetOptionalParams): Promise; + list(regionId: string, pcName: string, options?: CustomizationPoliciesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CustomizationPoliciesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomizationPoliciesGetResponse = CustomizationPolicy; + +// @public +export interface CustomizationPoliciesListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type CustomizationPoliciesListNextResponse = CustomizationPoliciesListResponse; + +// @public +export type CustomizationPoliciesListOperationResponse = CustomizationPoliciesListResponse; + +// @public +export interface CustomizationPoliciesListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export interface CustomizationPoliciesListResponse { + nextLink?: string; + value?: CustomizationPolicy[]; +} + +// @public +export interface CustomizationPolicy { + description?: string; + id?: string; + location?: string; + readonly name?: string; + privateCloudId?: string; + specification?: CustomizationSpecification; + readonly type?: string; + typePropertiesType?: CustomizationPolicyPropertiesType; + version?: string; +} + +// @public +export type CustomizationPolicyPropertiesType = string; + +// @public +export interface CustomizationSpecification { + identity?: CustomizationIdentity; + nicSettings?: CustomizationNicSetting[]; +} + +// @public +export interface DedicatedCloudNode { + availabilityZoneId?: string; + readonly availabilityZoneName?: string; + readonly cloudRackName?: string; + readonly created?: Date; + readonly id?: string; + idPropertiesSkuDescriptionId?: string; + location: string; + readonly name?: string; + namePropertiesSkuDescriptionName?: string; + nodesCount?: number; + placementGroupId?: string; + readonly placementGroupName?: string; + readonly privateCloudId?: string; + readonly privateCloudName?: string; + readonly provisioningState?: string; + purchaseId?: string; + sku?: Sku; + readonly status?: NodeStatus; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; + readonly vmwareClusterName?: string; +} + +// @public +export interface DedicatedCloudNodeListResponse { + nextLink?: string; + value?: DedicatedCloudNode[]; +} + +// @public +export interface DedicatedCloudNodes { + beginCreateOrUpdate(resourceGroupName: string, dedicatedCloudNodeName: string, dedicatedCloudNodeRequest: DedicatedCloudNode, options?: DedicatedCloudNodesCreateOrUpdateOptionalParams): Promise, DedicatedCloudNodesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, dedicatedCloudNodeName: string, dedicatedCloudNodeRequest: DedicatedCloudNode, options?: DedicatedCloudNodesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, dedicatedCloudNodeName: string, options?: DedicatedCloudNodesDeleteOptionalParams): Promise; + get(resourceGroupName: string, dedicatedCloudNodeName: string, options?: DedicatedCloudNodesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: DedicatedCloudNodesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: DedicatedCloudNodesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, dedicatedCloudNodeName: string, dedicatedCloudNodeRequest: PatchPayload, options?: DedicatedCloudNodesUpdateOptionalParams): Promise; +} + +// @public +export interface DedicatedCloudNodesCreateOrUpdateHeaders { + // (undocumented) + azureAsyncOperation?: string; + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface DedicatedCloudNodesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DedicatedCloudNodesCreateOrUpdateResponse = DedicatedCloudNodesCreateOrUpdateHeaders & DedicatedCloudNode; + +// @public +export interface DedicatedCloudNodesDeleteExceptionHeaders { + // (undocumented) + contentType?: string; +} + +// @public +export interface DedicatedCloudNodesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DedicatedCloudNodesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DedicatedCloudNodesGetResponse = DedicatedCloudNode; + +// @public +export interface DedicatedCloudNodesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type DedicatedCloudNodesListByResourceGroupNextResponse = DedicatedCloudNodeListResponse; + +// @public +export interface DedicatedCloudNodesListByResourceGroupOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type DedicatedCloudNodesListByResourceGroupResponse = DedicatedCloudNodeListResponse; + +// @public +export interface DedicatedCloudNodesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type DedicatedCloudNodesListBySubscriptionNextResponse = DedicatedCloudNodeListResponse; + +// @public +export interface DedicatedCloudNodesListBySubscriptionOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type DedicatedCloudNodesListBySubscriptionResponse = DedicatedCloudNodeListResponse; + +// @public +export interface DedicatedCloudNodesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DedicatedCloudNodesUpdateResponse = DedicatedCloudNode; + +// @public +export interface DedicatedCloudService { + gatewaySubnet?: string; + readonly id?: string; + readonly isAccountOnboarded?: OnboardingStatus; + location: string; + readonly name?: string; + readonly nodes?: number; + readonly serviceURL?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface DedicatedCloudServiceListResponse { + nextLink?: string; + value?: DedicatedCloudService[]; +} + +// @public +export interface DedicatedCloudServices { + beginDelete(resourceGroupName: string, dedicatedCloudServiceName: string, options?: DedicatedCloudServicesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, dedicatedCloudServiceName: string, options?: DedicatedCloudServicesDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, dedicatedCloudServiceName: string, dedicatedCloudServiceRequest: DedicatedCloudService, options?: DedicatedCloudServicesCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, dedicatedCloudServiceName: string, options?: DedicatedCloudServicesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: DedicatedCloudServicesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: DedicatedCloudServicesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, dedicatedCloudServiceName: string, dedicatedCloudServiceRequest: PatchPayload, options?: DedicatedCloudServicesUpdateOptionalParams): Promise; +} + +// @public +export interface DedicatedCloudServicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DedicatedCloudServicesCreateOrUpdateResponse = DedicatedCloudService; + +// @public +export interface DedicatedCloudServicesDeleteExceptionHeaders { + // (undocumented) + contentType?: string; +} + +// @public +export interface DedicatedCloudServicesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DedicatedCloudServicesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DedicatedCloudServicesGetResponse = DedicatedCloudService; + +// @public +export interface DedicatedCloudServicesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type DedicatedCloudServicesListByResourceGroupNextResponse = DedicatedCloudServiceListResponse; + +// @public +export interface DedicatedCloudServicesListByResourceGroupOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type DedicatedCloudServicesListByResourceGroupResponse = DedicatedCloudServiceListResponse; + +// @public +export interface DedicatedCloudServicesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type DedicatedCloudServicesListBySubscriptionNextResponse = DedicatedCloudServiceListResponse; + +// @public +export interface DedicatedCloudServicesListBySubscriptionOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type DedicatedCloudServicesListBySubscriptionResponse = DedicatedCloudServiceListResponse; + +// @public +export interface DedicatedCloudServicesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DedicatedCloudServicesUpdateResponse = DedicatedCloudService; + +// @public +export type DiskIndependenceMode = "persistent" | "independent_persistent" | "independent_nonpersistent"; + +// @public +export interface GuestOSCustomization { + dnsServers?: string[]; + hostName?: string; + password?: string; + policyId?: string; + username?: string; +} + +// @public +export interface GuestOsnicCustomization { + allocation?: GuestOsnicCustomizationAllocation; + dnsServers?: string[]; + gateway?: string[]; + ipAddress?: string; + mask?: string; + primaryWinsServer?: string; + secondaryWinsServer?: string; +} + +// @public +export type GuestOsnicCustomizationAllocation = string; + +// @public +export type GuestOSType = "linux" | "windows" | "other"; + +// @public +export enum KnownCustomizationHostNameType { + // (undocumented) + CustomName = "CUSTOM_NAME", + // (undocumented) + Fixed = "FIXED", + // (undocumented) + PrefixBased = "PREFIX_BASED", + // (undocumented) + UserDefined = "USER_DEFINED", + // (undocumented) + VirtualMachineName = "VIRTUAL_MACHINE_NAME" +} + +// @public +export enum KnownCustomizationIdentityType { + // (undocumented) + Linux = "LINUX", + // (undocumented) + Windows = "WINDOWS", + // (undocumented) + WindowsText = "WINDOWS_TEXT" +} + +// @public +export enum KnownCustomizationIPAddressType { + // (undocumented) + Custom = "CUSTOM", + // (undocumented) + DhcpIP = "DHCP_IP", + // (undocumented) + FixedIP = "FIXED_IP", + // (undocumented) + UserDefined = "USER_DEFINED" +} + +// @public +export enum KnownCustomizationPolicyPropertiesType { + // (undocumented) + Linux = "LINUX", + // (undocumented) + Windows = "WINDOWS" +} + +// @public +export enum KnownGuestOsnicCustomizationAllocation { + // (undocumented) + Dynamic = "dynamic", + // (undocumented) + Static = "static" +} + +// @public +export type NICType = "E1000" | "E1000E" | "PCNET32" | "VMXNET" | "VMXNET2" | "VMXNET3"; + +// @public +export type NodeStatus = "unused" | "used"; + +// @public +export type OnboardingStatus = "notOnBoarded" | "onBoarded" | "onBoardingFailed" | "onBoarding"; + +// @public +export interface OperationError { + code?: string; + message?: string; +} + +// @public +export type OperationOrigin = "user" | "system" | "user,system"; + +// @public +export interface OperationResource { + readonly endTime?: Date; + error?: OperationError; + readonly id?: string; + readonly name?: string; + readonly startTime?: Date; + readonly status?: string; +} + +// @public +export interface Operations { + get(regionId: string, operationId: string, options?: OperationsGetOptionalParams): Promise; + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsGetExceptionHeaders { + // (undocumented) + contentType?: string; +} + +// @public +export interface OperationsGetHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface OperationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsGetResponse = OperationResource; + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = AvailableOperationsListResponse; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = AvailableOperationsListResponse; + +// @public +export interface PatchPayload { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface PrivateCloud { + availabilityZoneId?: string; + availabilityZoneName?: string; + clustersNumber?: number; + createdBy?: string; + createdOn?: Date; + dnsServers?: string[]; + expires?: string; + id?: string; + location?: string; + name?: string; + nsxType?: string; + placementGroupId?: string; + placementGroupName?: string; + privateCloudId?: string; + resourcePools?: ResourcePool[]; + state?: string; + totalCpuCores?: number; + totalNodes?: number; + totalRam?: number; + totalStorage?: number; + type?: "Microsoft.VMwareCloudSimple/privateClouds"; + typePropertiesType?: string; + vcenterFqdn?: string; + vcenterRefid?: string; + virtualMachineTemplates?: VirtualMachineTemplate[]; + virtualNetworks?: VirtualNetwork[]; + vrOpsEnabled?: boolean; + vSphereVersion?: string; +} + +// @public +export interface PrivateCloudList { + nextLink?: string; + value?: PrivateCloud[]; +} + +// @public +export interface PrivateClouds { + get(pcName: string, regionId: string, options?: PrivateCloudsGetOptionalParams): Promise; + list(regionId: string, options?: PrivateCloudsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateCloudsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateCloudsGetResponse = PrivateCloud; + +// @public +export interface PrivateCloudsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateCloudsListNextResponse = PrivateCloudList; + +// @public +export interface PrivateCloudsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateCloudsListResponse = PrivateCloudList; + +// @public +export interface ResourcePool { + readonly fullName?: string; + id: string; + readonly location?: string; + readonly name?: string; + readonly privateCloudId?: string; + readonly type?: string; +} + +// @public +export interface ResourcePools { + get(regionId: string, pcName: string, resourcePoolName: string, options?: ResourcePoolsGetOptionalParams): Promise; + list(regionId: string, pcName: string, options?: ResourcePoolsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ResourcePoolsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcePoolsGetResponse = ResourcePool; + +// @public +export interface ResourcePoolsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcePoolsListNextResponse = ResourcePoolsListResponse; + +// @public +export type ResourcePoolsListOperationResponse = ResourcePoolsListResponse; + +// @public +export interface ResourcePoolsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ResourcePoolsListResponse { + nextLink?: string; + value?: ResourcePool[]; +} + +// @public +export interface Sku { + capacity?: string; + description?: string; + family?: string; + name: string; + tier?: string; +} + +// @public +export interface SkuAvailability { + dedicatedAvailabilityZoneId?: string; + dedicatedAvailabilityZoneName?: string; + dedicatedPlacementGroupId?: string; + dedicatedPlacementGroupName?: string; + limit: number; + resourceType?: string; + skuId?: string; + skuName?: string; +} + +// @public +export interface SkuAvailabilityListResponse { + nextLink?: string; + value?: SkuAvailability[]; +} + +// @public +export interface SkusAvailability { + list(regionId: string, options?: SkusAvailabilityListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SkusAvailabilityListNextOptionalParams extends coreClient.OperationOptions { + skuId?: string; +} + +// @public +export type SkusAvailabilityListNextResponse = SkuAvailabilityListResponse; + +// @public +export interface SkusAvailabilityListOptionalParams extends coreClient.OperationOptions { + skuId?: string; +} + +// @public +export type SkusAvailabilityListResponse = SkuAvailabilityListResponse; + +// @public +export type StopMode = "reboot" | "suspend" | "shutdown" | "poweroff"; + +// @public +export interface Usage { + currentValue: number; + limit: number; + name?: UsageName; + unit?: UsageCount; +} + +// @public +export type UsageCount = "Count" | "Bytes" | "Seconds" | "Percent" | "CountPerSecond" | "BytesPerSecond"; + +// @public +export interface UsageListResponse { + nextLink?: string; + readonly value?: Usage[]; +} + +// @public +export interface UsageName { + localizedValue?: string; + value?: string; +} + +// @public +export interface Usages { + list(regionId: string, options?: UsagesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface UsagesListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type UsagesListNextResponse = UsageListResponse; + +// @public +export interface UsagesListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type UsagesListResponse = UsageListResponse; + +// @public +export interface VirtualDisk { + controllerId: string; + independenceMode: DiskIndependenceMode; + totalSize: number; + virtualDiskId?: string; + readonly virtualDiskName?: string; +} + +// @public +export interface VirtualDiskController { + readonly id?: string; + readonly name?: string; + readonly subType?: string; + readonly type?: string; +} + +// @public +export interface VirtualMachine { + amountOfRam?: number; + readonly controllers?: VirtualDiskController[]; + customization?: GuestOSCustomization; + disks?: VirtualDisk[]; + readonly dnsname?: string; + exposeToGuestVM?: boolean; + readonly folder?: string; + readonly guestOS?: string; + readonly guestOSType?: GuestOSType; + readonly id?: string; + location: string; + readonly name?: string; + nics?: VirtualNic[]; + numberOfCores?: number; + password?: string; + privateCloudId?: string; + readonly provisioningState?: string; + readonly publicIP?: string; + resourcePool?: ResourcePool; + readonly status?: VirtualMachineStatus; + tags?: { + [propertyName: string]: string; + }; + templateId?: string; + readonly type?: string; + username?: string; + readonly vmId?: string; + readonly vmwaretools?: string; + vSphereNetworks?: string[]; +} + +// @public +export interface VirtualMachineListResponse { + nextLink?: string; + value?: VirtualMachine[]; +} + +// @public +export interface VirtualMachines { + beginCreateOrUpdate(resourceGroupName: string, virtualMachineName: string, virtualMachineRequest: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams): Promise, VirtualMachinesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, virtualMachineName: string, virtualMachineRequest: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesDeleteOptionalParams): Promise, VirtualMachinesDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesDeleteOptionalParams): Promise; + beginStart(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise, void>>; + beginStartAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise; + beginStop(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise, void>>; + beginStopAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise; + beginUpdate(resourceGroupName: string, virtualMachineName: string, virtualMachineRequest: PatchPayload, options?: VirtualMachinesUpdateOptionalParams): Promise, VirtualMachinesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, virtualMachineName: string, virtualMachineRequest: PatchPayload, options?: VirtualMachinesUpdateOptionalParams): Promise; + get(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: VirtualMachinesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: VirtualMachinesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VirtualMachinesCreateOrUpdateHeaders { + // (undocumented) + azureAsyncOperation?: string; +} + +// @public +export interface VirtualMachinesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesCreateOrUpdateResponse = VirtualMachinesCreateOrUpdateHeaders & VirtualMachine; + +// @public +export interface VirtualMachinesDeleteExceptionHeaders { + // (undocumented) + contentType?: string; +} + +// @public +export interface VirtualMachinesDeleteHeaders { + // (undocumented) + azureAsyncOperation?: string; + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface VirtualMachinesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesDeleteResponse = VirtualMachinesDeleteHeaders; + +// @public +export interface VirtualMachinesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesGetResponse = VirtualMachine; + +// @public +export interface VirtualMachinesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type VirtualMachinesListByResourceGroupNextResponse = VirtualMachineListResponse; + +// @public +export interface VirtualMachinesListByResourceGroupOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type VirtualMachinesListByResourceGroupResponse = VirtualMachineListResponse; + +// @public +export interface VirtualMachinesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type VirtualMachinesListBySubscriptionNextResponse = VirtualMachineListResponse; + +// @public +export interface VirtualMachinesListBySubscriptionOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export type VirtualMachinesListBySubscriptionResponse = VirtualMachineListResponse; + +// @public +export interface VirtualMachinesStartExceptionHeaders { + // (undocumented) + contentType?: string; +} + +// @public +export interface VirtualMachinesStartHeaders { + // (undocumented) + azureAsyncOperation?: string; + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface VirtualMachinesStartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachinesStopExceptionHeaders { + // (undocumented) + contentType?: string; +} + +// @public +export interface VirtualMachinesStopHeaders { + // (undocumented) + azureAsyncOperation?: string; + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface VirtualMachinesStopOptionalParams extends coreClient.OperationOptions { + m?: VirtualMachineStopMode; + mode?: StopMode; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachineStatus = "running" | "suspended" | "poweredoff" | "updating" | "deallocating" | "deleting"; + +// @public +export interface VirtualMachineStopMode { + mode?: StopMode; +} + +// @public +export interface VirtualMachinesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesUpdateResponse = VirtualMachine; + +// @public +export interface VirtualMachineTemplate { + amountOfRam?: number; + controllers?: VirtualDiskController[]; + description?: string; + disks?: VirtualDisk[]; + exposeToGuestVM?: boolean; + readonly guestOS?: string; + readonly guestOSType?: string; + readonly id?: string; + location?: string; + readonly name?: string; + nics?: VirtualNic[]; + numberOfCores?: number; + path?: string; + privateCloudId?: string; + readonly type?: string; + readonly vmwaretools?: string; + vSphereNetworks?: string[]; + vSphereTags?: string[]; +} + +// @public +export interface VirtualMachineTemplateListResponse { + nextLink?: string; + value?: VirtualMachineTemplate[]; +} + +// @public +export interface VirtualMachineTemplates { + get(regionId: string, pcName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesGetOptionalParams): Promise; + list(pcName: string, regionId: string, resourcePoolName: string, options?: VirtualMachineTemplatesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VirtualMachineTemplatesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachineTemplatesGetResponse = VirtualMachineTemplate; + +// @public +export interface VirtualMachineTemplatesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachineTemplatesListNextResponse = VirtualMachineTemplateListResponse; + +// @public +export interface VirtualMachineTemplatesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachineTemplatesListResponse = VirtualMachineTemplateListResponse; + +// @public +export interface VirtualNetwork { + readonly assignable?: boolean; + id: string; + readonly location?: string; + readonly name?: string; + readonly privateCloudId?: string; + readonly type?: string; +} + +// @public +export interface VirtualNetworkListResponse { + nextLink?: string; + value?: VirtualNetwork[]; +} + +// @public +export interface VirtualNetworks { + get(regionId: string, pcName: string, virtualNetworkName: string, options?: VirtualNetworksGetOptionalParams): Promise; + list(regionId: string, pcName: string, resourcePoolName: string, options?: VirtualNetworksListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VirtualNetworksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksGetResponse = VirtualNetwork; + +// @public +export interface VirtualNetworksListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksListNextResponse = VirtualNetworkListResponse; + +// @public +export interface VirtualNetworksListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksListResponse = VirtualNetworkListResponse; + +// @public +export interface VirtualNic { + customization?: GuestOsnicCustomization; + ipAddresses?: string[]; + macAddress?: string; + network: VirtualNetwork; + nicType: NICType; + powerOnBoot?: boolean; + virtualNicId?: string; + readonly virtualNicName?: string; +} + +// @public (undocumented) +export class VMwareCloudSimple extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, referer: string, options?: VMwareCloudSimpleOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + customizationPolicies: CustomizationPolicies; + // (undocumented) + dedicatedCloudNodes: DedicatedCloudNodes; + // (undocumented) + dedicatedCloudServices: DedicatedCloudServices; + // (undocumented) + operations: Operations; + // (undocumented) + privateClouds: PrivateClouds; + // (undocumented) + referer: string; + // (undocumented) + resourcePools: ResourcePools; + // (undocumented) + skusAvailability: SkusAvailability; + // (undocumented) + subscriptionId: string; + // (undocumented) + usages: Usages; + // (undocumented) + virtualMachines: VirtualMachines; + // (undocumented) + virtualMachineTemplates: VirtualMachineTemplates; + // (undocumented) + virtualNetworks: VirtualNetworks; +} + +// @public +export interface VMwareCloudSimpleOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/rollup.config.js b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/rollup.config.js index 99e7f4d17e13..9be1955eb7f1 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/rollup.config.js +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/vMwareCloudSimpleClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-vmwarecloudsimple.js", - format: "umd", - name: "Azure.ArmVmwarecloudsimple", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/index.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/index.ts new file mode 100644 index 000000000000..9017b8a4725c --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { VMwareCloudSimple } from "./vMwareCloudSimple"; +export * from "./operationsInterfaces"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/lroImpl.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/dedicatedCloudNodesMappers.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/dedicatedCloudNodesMappers.ts deleted file mode 100644 index 8b005aeb58c3..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/dedicatedCloudNodesMappers.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CSRPError, - CSRPErrorBody, - DedicatedCloudNode, - DedicatedCloudNodeListResponse, - DedicatedCloudNodesCreateOrUpdateHeaders, - DedicatedCloudNodesDeleteHeaders, - DedicatedCloudService, - PatchPayload, - ResourcePool, - Sku, - VirtualDisk, - VirtualDiskController, - VirtualMachine, - VirtualNetwork, - VirtualNic -} from "../models/mappers"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/dedicatedCloudServicesMappers.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/dedicatedCloudServicesMappers.ts deleted file mode 100644 index 6d74b8b49d43..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/dedicatedCloudServicesMappers.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CSRPError, - CSRPErrorBody, - DedicatedCloudNode, - DedicatedCloudService, - DedicatedCloudServiceListResponse, - DedicatedCloudServicesDeleteHeaders, - PatchPayload, - ResourcePool, - Sku, - VirtualDisk, - VirtualDiskController, - VirtualMachine, - VirtualNetwork, - VirtualNic -} from "../models/mappers"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/index.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/index.ts index 04eef82dbff0..5ce3c6e5c343 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/index.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/index.ts @@ -1,2340 +1,1539 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +/** List of available operations */ +export interface AvailableOperationsListResponse { + /** Link for next list of available operations */ + nextLink?: string; + /** Returns a list of available operations */ + value?: AvailableOperation[]; +} -/** - * Resource provider available operation display model - */ +/** Resource provider available operation model */ +export interface AvailableOperation { + /** The list of operations */ + display?: AvailableOperationDisplay; + /** Indicating whether the operation is a data action or not */ + isDataAction?: boolean; + /** {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} */ + name?: string; + /** The origin of operation */ + origin?: OperationOrigin; + /** The list of specification's service metrics */ + serviceSpecification?: AvailableOperationDisplayPropertyServiceSpecificationMetricsList; +} + +/** Resource provider available operation display model */ export interface AvailableOperationDisplay { - /** - * Description of the operation for display purposes - */ + /** Description of the operation for display purposes */ description?: string; - /** - * Name of the operation for display purposes - */ + /** Name of the operation for display purposes */ operation?: string; - /** - * Name of the provider for display purposes - */ + /** Name of the provider for display purposes */ provider?: string; - /** - * Name of the resource type for display purposes - */ + /** Name of the resource type for display purposes */ resource?: string; } -/** - * Available operation display property service specification metrics item - */ +/** List of available operation display property service specification metrics */ +export interface AvailableOperationDisplayPropertyServiceSpecificationMetricsList { + /** Metric specifications of operation */ + metricSpecifications?: AvailableOperationDisplayPropertyServiceSpecificationMetricsItem[]; +} + +/** Available operation display property service specification metrics item */ export interface AvailableOperationDisplayPropertyServiceSpecificationMetricsItem { - /** - * Metric's aggregation type for e.g. (Average, Total). Possible values include: 'Average', - * 'Total' - */ + /** Metric's aggregation type for e.g. (Average, Total) */ aggregationType: AggregationType; - /** - * Metric's description - */ + /** Metric's description */ displayDescription: string; - /** - * Human readable metric's name - */ + /** Human readable metric's name */ displayName: string; - /** - * Metric's name/id - */ + /** Metric's name/id */ name: string; - /** - * Metric's unit - */ + /** Metric's unit */ unit: string; } -/** - * List of available operation display property service specification metrics - */ -export interface AvailableOperationDisplayPropertyServiceSpecificationMetricsList { - /** - * Metric specifications of operation - */ - metricSpecifications?: AvailableOperationDisplayPropertyServiceSpecificationMetricsItem[]; -} - -/** - * Resource provider available operation model - */ -export interface AvailableOperation { - /** - * The list of operations - */ - display?: AvailableOperationDisplay; - /** - * Indicating whether the operation is a data action or not. Default value: false. - */ - isDataAction?: boolean; - /** - * {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} - */ - name?: string; - /** - * The origin of operation. Possible values include: 'user', 'system', 'user,system' - */ - origin?: OperationOrigin; - /** - * The list of specification's service metrics - */ - serviceSpecification?: AvailableOperationDisplayPropertyServiceSpecificationMetricsList; +/** General error model */ +export interface CsrpError { + /** Error's body */ + error?: CsrpErrorBody; } -/** - * Error properties - */ -export interface CSRPErrorBody { +/** Error properties */ +export interface CsrpErrorBody { /** * Error's code - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly code?: string; /** * Error's details - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: CSRPErrorBody[]; + readonly details?: CsrpErrorBody[]; /** * Error's message - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly message?: string; - /** - * Error's target - */ + /** Error's target */ target?: string; } -/** - * General error model - */ -export interface CSRPError { - /** - * Error's body - */ - error?: CSRPErrorBody; -} - -/** - * The purchase SKU for CloudSimple paid resources - */ -export interface Sku { - /** - * The capacity of the SKU - */ - capacity?: string; - /** - * dedicatedCloudNode example: 8 x Ten-Core Intel® Xeon® Processor E5-2640 v4 2.40GHz 25MB Cache - * (90W); 12 x 64GB PC4-19200 2400MHz DDR4 ECC Registered DIMM, ... - */ - description?: string; - /** - * If the service has different generations of hardware, for the same SKU, then that can be - * captured here - */ - family?: string; - /** - * The name of the SKU for VMWare CloudSimple Node - */ - name: string; - /** - * The tier of the SKU - */ - tier?: string; +/** List of dedicated nodes response model */ +export interface DedicatedCloudNodeListResponse { + /** Link for next list of DedicatedCloudNode */ + nextLink?: string; + /** Results of the DedicatedCloudNode list */ + value?: DedicatedCloudNode[]; } -/** - * Dedicated cloud node model - */ -export interface DedicatedCloudNode extends BaseResource { +/** Dedicated cloud node model */ +export interface DedicatedCloudNode { /** * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/dedicatedCloudNodes/{dedicatedCloudNodeName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; - /** - * Azure region - */ + /** Azure region */ location: string; /** * {dedicatedCloudNodeName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; + /** Dedicated Cloud Nodes SKU */ + sku?: Sku; + /** Dedicated Cloud Nodes tags */ + tags?: { [propertyName: string]: string }; /** - * Availability Zone id, e.g. "az1" + * {resourceProviderNamespace}/{resourceType} + * NOTE: This property will not be serialized. It can only be populated by the server. */ - availabilityZoneId: string; + readonly type?: string; + /** Availability Zone id, e.g. "az1" */ + availabilityZoneId?: string; /** * Availability Zone name, e.g. "Availability Zone 1" - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly availabilityZoneName?: string; /** * VMWare Cloud Rack Name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly cloudRackName?: string; /** * date time the resource was created - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly created?: any; - /** - * count of nodes to create - */ - nodesCount: number; - /** - * Placement Group id, e.g. "n1" + * NOTE: This property will not be serialized. It can only be populated by the server. */ - placementGroupId: string; + readonly created?: Date; + /** count of nodes to create */ + nodesCount?: number; + /** Placement Group id, e.g. "n1" */ + placementGroupId?: string; /** * Placement Name, e.g. "Placement Group 1" - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly placementGroupName?: string; /** * Private Cloud Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly privateCloudId?: string; /** * Resource Pool Name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly privateCloudName?: string; /** * The provisioning status of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; + /** purchase id */ + purchaseId?: string; /** - * purchase id - */ - purchaseId: string; - /** - * SKU's id - */ - id1: string; - /** - * SKU's name - */ - name1: string; - /** - * Node status, indicates is private cloud set up on this node or not. Possible values include: - * 'unused', 'used' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Node status, indicates is private cloud set up on this node or not + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly status?: NodeStatus; /** * VMWare Cluster Name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly vmwareClusterName?: string; - /** - * Dedicated Cloud Nodes SKU - */ - sku?: Sku; - /** - * Dedicated Cloud Nodes tags - */ - tags?: { [propertyName: string]: string }; - /** - * {resourceProviderNamespace}/{resourceType} - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; + /** SKU's id */ + idPropertiesSkuDescriptionId?: string; + /** SKU's name */ + namePropertiesSkuDescriptionName?: string; } -/** - * Dedicated cloud service model - */ -export interface DedicatedCloudService extends BaseResource { +/** The purchase SKU for CloudSimple paid resources */ +export interface Sku { + /** The capacity of the SKU */ + capacity?: string; + /** dedicatedCloudNode example: 8 x Ten-Core Intel® Xeon® Processor E5-2640 v4 2.40GHz 25MB Cache (90W); 12 x 64GB PC4-19200 2400MHz DDR4 ECC Registered DIMM, ... */ + description?: string; + /** If the service has different generations of hardware, for the same SKU, then that can be captured here */ + family?: string; + /** The name of the SKU for VMWare CloudSimple Node */ + name: string; + /** The tier of the SKU */ + tier?: string; +} + +/** List of dedicated cloud services */ +export interface DedicatedCloudServiceListResponse { + /** Link for next list of DedicatedCloudNode */ + nextLink?: string; + /** Results of the DedicatedCloudService list */ + value?: DedicatedCloudService[]; +} + +/** Dedicated cloud service model */ +export interface DedicatedCloudService { /** * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/dedicatedCloudServices/{dedicatedCloudServiceName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; - /** - * Azure region - */ + /** Azure region */ location: string; /** * {dedicatedCloudServiceName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; + /** The list of tags */ + tags?: { [propertyName: string]: string }; /** - * gateway Subnet for the account. It will collect the subnet address and always treat it as /28 + * {resourceProviderNamespace}/{resourceType} + * NOTE: This property will not be serialized. It can only be populated by the server. */ - gatewaySubnet: string; + readonly type?: string; + /** gateway Subnet for the account. It will collect the subnet address and always treat it as /28 */ + gatewaySubnet?: string; /** - * indicates whether account onboarded or not in a given region. Possible values include: - * 'notOnBoarded', 'onBoarded', 'onBoardingFailed', 'onBoarding' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * indicates whether account onboarded or not in a given region + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isAccountOnboarded?: OnboardingStatus; /** * total nodes purchased + * NOTE: This property will not be serialized. It can only be populated by the server. */ - nodes?: number; + readonly nodes?: number; /** * link to a service management web portal + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serviceURL?: string; - /** - * The list of tags - */ - tags?: { [propertyName: string]: string }; - /** - * {resourceProviderNamespace}/{resourceType} - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; + readonly serviceURL?: string; } -/** - * Operation error model - */ -export interface OperationError { - /** - * Error's code - */ - code?: string; - /** - * Error's message - */ - message?: string; +/** List of SKU availabilities */ +export interface SkuAvailabilityListResponse { + /** Link for next list of DedicatedCloudNode */ + nextLink?: string; + /** Results of the DedicatedPlacementGroupSkuAvailability list */ + value?: SkuAvailability[]; } -/** - * Operation status response - */ +/** SKU availability model */ +export interface SkuAvailability { + /** CloudSimple Availability Zone id */ + dedicatedAvailabilityZoneId?: string; + /** CloudSimple Availability Zone Name */ + dedicatedAvailabilityZoneName?: string; + /** CloudSimple Placement Group Id */ + dedicatedPlacementGroupId?: string; + /** CloudSimple Placement Group name */ + dedicatedPlacementGroupName?: string; + /** indicates how many resources of a given SKU is available in a AZ->PG */ + limit: number; + /** resource type e.g. DedicatedCloudNodes */ + resourceType?: string; + /** sku id */ + skuId?: string; + /** sku name */ + skuName?: string; +} + +/** Operation status response */ export interface OperationResource { /** * End time of the operation - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly endTime?: Date; - /** - * Error Message if operation failed - */ + /** Error Message if operation failed */ error?: OperationError; /** * Operation Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * Operation ID - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * Start time of the operation - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly startTime?: Date; /** * Operation status - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly status?: string; } -/** - * General patch payload modal - */ -export interface PatchPayload { - /** - * The tags key:value pairs - */ - tags?: { [propertyName: string]: string }; +/** Operation error model */ +export interface OperationError { + /** Error's code */ + code?: string; + /** Error's message */ + message?: string; } -/** - * Resource pool model - */ +/** List of private clouds */ +export interface PrivateCloudList { + /** Link for next list of Private Clouds */ + nextLink?: string; + /** the list of private clouds */ + value?: PrivateCloud[]; +} + +/** Private cloud model */ +export interface PrivateCloud { + /** Azure Id, e.g. "/subscriptions/4da99247-a172-4ed6-8ae9-ebed2d12f839/providers/Microsoft.VMwareCloudSimple/privateClouds/cloud123" */ + id?: string; + /** Location where private cloud created, e.g "westus" */ + location?: string; + /** Private cloud name */ + name?: string; + /** Azure Resource type */ + type?: "Microsoft.VMwareCloudSimple/privateClouds"; + /** Availability Zone id, e.g. "az1" */ + availabilityZoneId?: string; + /** Availability Zone name, e.g. "Availability Zone 1" */ + availabilityZoneName?: string; + /** Number of clusters */ + clustersNumber?: number; + /** User's emails who created cloud */ + createdBy?: string; + /** When private cloud was created */ + createdOn?: Date; + /** Array of DNS servers */ + dnsServers?: string[]; + /** Expiration date of PC */ + expires?: string; + /** Nsx Type, e.g. "Advanced" */ + nsxType?: string; + /** Placement Group id, e.g. "n1" */ + placementGroupId?: string; + /** Placement Group name */ + placementGroupName?: string; + /** Id of a private cloud */ + privateCloudId?: string; + /** The list of Resource Pools */ + resourcePools?: ResourcePool[]; + /** Private Cloud state, e.g. "operational" */ + state?: string; + /** Number of cores */ + totalCpuCores?: number; + /** Number of nodes */ + totalNodes?: number; + /** Memory size */ + totalRam?: number; + /** Disk space in TB */ + totalStorage?: number; + /** Virtualization type e.g. "vSphere" */ + typePropertiesType?: string; + /** e.g. "6.5u2" */ + vSphereVersion?: string; + /** FQDN for vcenter access */ + vcenterFqdn?: string; + /** Vcenter ip address */ + vcenterRefid?: string; + /** The list of Virtual Machine Templates */ + virtualMachineTemplates?: VirtualMachineTemplate[]; + /** The list of Virtual Networks */ + virtualNetworks?: VirtualNetwork[]; + /** Is Vrops enabled/disabled */ + vrOpsEnabled?: boolean; +} + +/** Resource pool model */ export interface ResourcePool { - /** - * resource pool id (privateCloudId:vsphereId) - */ + /** resource pool id (privateCloudId:vsphereId) */ id: string; /** * Azure region - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly location?: string; /** * {ResourcePoolName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * The Private Cloud Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly privateCloudId?: string; - /** - * Hierarchical resource pool name - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly fullName?: string; /** * {resourceProviderNamespace}/{resourceType} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; + /** + * Hierarchical resource pool name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly fullName?: string; } -/** - * Virtual disk controller model - */ -export interface VirtualDiskController { +/** Virtual machine template model */ +export interface VirtualMachineTemplate { /** - * Controller's id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * virtual machine template id (privateCloudId:vsphereId) + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; + /** Azure region */ + location?: string; /** - * The display name of Controller - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * {virtualMachineTemplateName} + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * dik controller subtype (VMWARE_PARAVIRTUAL, BUS_PARALLEL, LSI_PARALLEL, LSI_SAS) - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly subType?: string; - /** - * disk controller type (SCSI) - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * {resourceProviderNamespace}/{resourceType} + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; -} - -/** - * Virtual disk model - */ -export interface VirtualDisk { + /** The amount of memory */ + amountOfRam?: number; + /** The list of Virtual Disk Controllers */ + controllers?: VirtualDiskController[]; + /** The description of Virtual Machine Template */ + description?: string; + /** The list of Virtual Disks */ + disks?: VirtualDisk[]; + /** Expose Guest OS or not */ + exposeToGuestVM?: boolean; /** - * Disk's Controller id + * The Guest OS + * NOTE: This property will not be serialized. It can only be populated by the server. */ - controllerId: string; + readonly guestOS?: string; /** - * Disk's independence mode type. Possible values include: 'persistent', - * 'independent_persistent', 'independent_nonpersistent' - */ - independenceMode: DiskIndependenceMode; - /** - * Disk's total size - */ - totalSize: number; - /** - * Disk's id + * The Guest OS types + * NOTE: This property will not be serialized. It can only be populated by the server. */ - virtualDiskId?: string; + readonly guestOSType?: string; + /** The list of Virtual NICs */ + nics?: VirtualNic[]; + /** The number of CPU cores */ + numberOfCores?: number; + /** path to folder */ + path?: string; + /** The Private Cloud Id */ + privateCloudId?: string; + /** The list of VSphere networks */ + vSphereNetworks?: string[]; + /** The tags from VSphere */ + vSphereTags?: string[]; /** - * Disk's display name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The VMware tools version + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly virtualDiskName?: string; + readonly vmwaretools?: string; } -/** - * Virtual network model - */ -export interface VirtualNetwork { - /** - * can be used in vm creation/deletion - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly assignable?: boolean; - /** - * virtual network id (privateCloudId:vsphereId) - */ - id: string; +/** Virtual disk controller model */ +export interface VirtualDiskController { /** - * Azure region - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Controller's id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly location?: string; + readonly id?: string; /** - * {VirtualNetworkName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The display name of Controller + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The Private Cloud id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * dik controller subtype (VMWARE_PARAVIRTUAL, BUS_PARALLEL, LSI_PARALLEL, LSI_SAS) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly privateCloudId?: string; + readonly subType?: string; /** - * {resourceProviderNamespace}/{resourceType} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * disk controller type (SCSI) + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; } -/** - * Virtual NIC model - */ -export interface VirtualNic { +/** Virtual disk model */ +export interface VirtualDisk { + /** Disk's Controller id */ + controllerId: string; + /** Disk's independence mode type */ + independenceMode: DiskIndependenceMode; + /** Disk's total size */ + totalSize: number; + /** Disk's id */ + virtualDiskId?: string; /** - * NIC ip address + * Disk's display name + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly virtualDiskName?: string; +} + +/** Virtual NIC model */ +export interface VirtualNic { + /** guest OS customization for nic */ + customization?: GuestOsnicCustomization; + /** NIC ip address */ ipAddresses?: string[]; - /** - * NIC MAC address - */ + /** NIC MAC address */ macAddress?: string; - /** - * Virtual Network - */ + /** Virtual Network */ network: VirtualNetwork; - /** - * NIC type. Possible values include: 'E1000', 'E1000E', 'PCNET32', 'VMXNET', 'VMXNET2', - * 'VMXNET3' - */ + /** NIC type */ nicType: NICType; - /** - * Is NIC powered on/off on boot - */ + /** Is NIC powered on/off on boot */ powerOnBoot?: boolean; - /** - * NIC id - */ + /** NIC id */ virtualNicId?: string; /** * NIC name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly virtualNicName?: string; } -/** - * Virtual machine template model - */ -export interface VirtualMachineTemplate { +/** Guest OS nic customization */ +export interface GuestOsnicCustomization { + /** IP address allocation method */ + allocation?: GuestOsnicCustomizationAllocation; + /** List of dns servers to use */ + dnsServers?: string[]; + /** Gateway addresses assigned to nic */ + gateway?: string[]; + /** Static ip address for nic */ + ipAddress?: string; + /** Network mask for nic */ + mask?: string; + /** primary WINS server for Windows */ + primaryWinsServer?: string; + /** secondary WINS server for Windows */ + secondaryWinsServer?: string; +} + +/** Virtual network model */ +export interface VirtualNetwork { /** - * virtual machine template id (privateCloudId:vsphereId) - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * can be used in vm creation/deletion + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly assignable?: boolean; + /** virtual network id (privateCloudId:vsphereId) */ + id: string; /** * Azure region + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location?: string; + readonly location?: string; /** - * {virtualMachineTemplateName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * {VirtualNetworkName} + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; - /** - * The amount of memory - */ - amountOfRam?: number; - /** - * The list of Virtual Disk Controllers - */ - controllers?: VirtualDiskController[]; - /** - * The description of Virtual Machine Template - */ - description?: string; - /** - * The list of Virtual Disks - */ - disks?: VirtualDisk[]; - /** - * Expose Guest OS or not - */ - exposeToGuestVM?: boolean; - /** - * The Guest OS - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly guestOS?: string; - /** - * The Guest OS types - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly guestOSType?: string; - /** - * The list of Virtual NICs - */ - nics?: VirtualNic[]; - /** - * The number of CPU cores - */ - numberOfCores?: number; - /** - * path to folder - */ - path?: string; - /** - * The Private Cloud Id - */ - privateCloudId: string; - /** - * The list of VSphere networks - */ - vSphereNetworks?: string[]; - /** - * The tags from VSphere - */ - vSphereTags?: string[]; - /** - * The VMware tools version - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly vmwaretools?: string; /** * {resourceProviderNamespace}/{resourceType} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; -} - -/** - * Private cloud model - */ -export interface PrivateCloud { /** - * Azure Id, e.g. - * "/subscriptions/4da99247-a172-4ed6-8ae9-ebed2d12f839/providers/Microsoft.VMwareCloudSimple/privateClouds/cloud123" + * The Private Cloud id + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly privateCloudId?: string; +} + +/** List of customization polices response model */ +export interface CustomizationPoliciesListResponse { + /** Link for next list of the Customization policy */ + nextLink?: string; + /** List of the customization policies */ + value?: CustomizationPolicy[]; +} + +/** The virtual machine customization policy */ +export interface CustomizationPolicy { + /** Customization policy azure id */ id?: string; - /** - * Location where private cloud created, e.g "westus" - */ + /** Azure region */ location?: string; /** - * Private cloud name + * Customization policy name + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly name?: string; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly type?: string; + /** Policy description */ + description?: string; + /** The Private cloud id */ + privateCloudId?: string; + /** Detailed customization policy specification */ + specification?: CustomizationSpecification; + /** The type of customization (Linux or Windows) */ + typePropertiesType?: CustomizationPolicyPropertiesType; + /** Policy version */ + version?: string; +} + +/** The specification for Customization Policy */ +export interface CustomizationSpecification { + /** Customization Identity. It contains data about user and hostname */ + identity?: CustomizationIdentity; + /** Network interface settings */ + nicSettings?: CustomizationNicSetting[]; +} + +export interface CustomizationIdentity { + /** Windows Text Identity. Prepared data */ + data?: string; + /** Virtual machine host name settings */ + hostName?: CustomizationHostName; + /** Identity type */ + type?: CustomizationIdentityType; + /** Windows Identity. User data customization */ + userData?: CustomizationIdentityUserData; +} + +/** Host name model */ +export interface CustomizationHostName { + /** Hostname */ name?: string; + /** Type of host name */ + type?: CustomizationHostNameType; +} + +/** Windows Identity. User data customization */ +export interface CustomizationIdentityUserData { + /** Is password predefined in customization policy */ + isPasswordPredefined?: boolean; +} + +export interface CustomizationNicSetting { + /** The list of adapters' settings */ + adapter?: CustomizationIPSettings; + /** NIC mac address */ + macAddress?: string; +} + +export interface CustomizationIPSettings { + /** The list of gateways */ + gateway?: string[]; + /** Ip address customization settings */ + ip?: CustomizationIPAddress; + /** Adapter subnet mask */ + subnetMask?: string; +} + +export interface CustomizationIPAddress { + /** Argument when Custom ip type is selected */ + argument?: string; + /** Defined Ip Address when Fixed ip type is selected */ + ipAddress?: string; + /** Customization Specification ip type */ + type?: CustomizationIPAddressType; +} + +/** List of resource pools response model */ +export interface ResourcePoolsListResponse { + /** Link for next list of ResourcePoolsList */ + nextLink?: string; + /** Results of the Resource pools list */ + value?: ResourcePool[]; +} + +/** List of virtual machine templates */ +export interface VirtualMachineTemplateListResponse { + /** Link for next list of VirtualMachineTemplate */ + nextLink?: string; + /** Results of the VM template list */ + value?: VirtualMachineTemplate[]; +} + +/** List of virtual networks */ +export interface VirtualNetworkListResponse { + /** Link for next list of VirtualNetwork */ + nextLink?: string; + /** Results of the VirtualNetwork list */ + value?: VirtualNetwork[]; +} + +/** List of usages */ +export interface UsageListResponse { + /** Link for next list of DedicatedCloudNode */ + nextLink?: string; /** - * Availability Zone id, e.g. "az1" - */ - availabilityZoneId?: string; - /** - * Availability Zone name, e.g. "Availability Zone 1" - */ - availabilityZoneName?: string; - /** - * Number of clusters + * The list of usages + * NOTE: This property will not be serialized. It can only be populated by the server. */ - clustersNumber?: number; + readonly value?: Usage[]; +} + +/** Usage model */ +export interface Usage { + /** The current usage value */ + currentValue: number; + /** limit of a given sku in a region for a subscription. The maximum permitted value for the usage quota. If there is no limit, this value will be -1 */ + limit: number; + /** Usage name value and localized name */ + name?: UsageName; + /** The usages' unit */ + unit?: UsageCount; +} + +/** User name model */ +export interface UsageName { + /** e.g. "Virtual Machines" */ + localizedValue?: string; + /** resource type or resource type sku name, e.g. virtualMachines */ + value?: string; +} + +/** List of virtual machines */ +export interface VirtualMachineListResponse { + /** Link for next list of VirtualMachines */ + nextLink?: string; + /** Results of the VirtualMachine list */ + value?: VirtualMachine[]; +} + +/** Virtual machine model */ +export interface VirtualMachine { /** - * User's emails who created cloud + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/virtualMachines/{virtualMachineName} + * NOTE: This property will not be serialized. It can only be populated by the server. */ - createdBy?: string; + readonly id?: string; + /** Azure region */ + location: string; /** - * When private cloud was created + * {virtualMachineName} + * NOTE: This property will not be serialized. It can only be populated by the server. */ - createdOn?: Date; + readonly name?: string; + /** The list of tags */ + tags?: { [propertyName: string]: string }; /** - * Array of DNS servers + * {resourceProviderNamespace}/{resourceType} + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dnsServers?: string[]; + readonly type?: string; + /** The amount of memory */ + amountOfRam?: number; /** - * Expiration date of PC + * The list of Virtual Disks' Controllers + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expires?: string; + readonly controllers?: VirtualDiskController[]; + /** Virtual machine properties */ + customization?: GuestOSCustomization; + /** The list of Virtual Disks */ + disks?: VirtualDisk[]; /** - * Nsx Type, e.g. "Advanced" + * The DNS name of Virtual Machine in VCenter + * NOTE: This property will not be serialized. It can only be populated by the server. */ - nsxType?: string; + readonly dnsname?: string; + /** Expose Guest OS or not */ + exposeToGuestVM?: boolean; /** - * Placement Group id, e.g. "n1" + * The path to virtual machine folder in VCenter + * NOTE: This property will not be serialized. It can only be populated by the server. */ - placementGroupId?: string; + readonly folder?: string; /** - * Placement Group name + * The name of Guest OS + * NOTE: This property will not be serialized. It can only be populated by the server. */ - placementGroupName?: string; + readonly guestOS?: string; /** - * Id of a private cloud + * The Guest OS type + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly guestOSType?: GuestOSType; + /** The list of Virtual NICs */ + nics?: VirtualNic[]; + /** The number of CPU cores */ + numberOfCores?: number; + /** Password for login. Deprecated - use customization property */ + password?: string; + /** Private Cloud Id */ privateCloudId?: string; /** - * The list of Resource Pools - */ - resourcePools?: ResourcePool[]; - /** - * Private Cloud state, e.g. "operational" - */ - state?: string; - /** - * Number of cores - */ - totalCpuCores?: number; - /** - * Number of nodes - */ - totalNodes?: number; - /** - * Memory size - */ - totalRam?: number; - /** - * Disk space in TB + * The provisioning status of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - totalStorage?: number; + readonly provisioningState?: string; /** - * Virtualization type e.g. "vSphere" + * The public ip of Virtual Machine + * NOTE: This property will not be serialized. It can only be populated by the server. */ - privateCloudPropertiesType?: string; + readonly publicIP?: string; + /** Virtual Machines Resource Pool */ + resourcePool?: ResourcePool; /** - * e.g. "6.5u2" + * The status of Virtual machine + * NOTE: This property will not be serialized. It can only be populated by the server. */ - vSphereVersion?: string; + readonly status?: VirtualMachineStatus; + /** Virtual Machine Template Id */ + templateId?: string; + /** Username for login. Deprecated - use customization property */ + username?: string; + /** The list of Virtual VSphere Networks */ + vSphereNetworks?: string[]; /** - * FQDN for vcenter access + * The internal id of Virtual Machine in VCenter + * NOTE: This property will not be serialized. It can only be populated by the server. */ - vcenterFqdn?: string; + readonly vmId?: string; /** - * Vcenter ip address + * VMware tools version + * NOTE: This property will not be serialized. It can only be populated by the server. */ - vcenterRefid?: string; - /** - * The list of Virtual Machine Templates - */ - virtualMachineTemplates?: VirtualMachineTemplate[]; - /** - * The list of Virtual Networks - */ - virtualNetworks?: VirtualNetwork[]; - /** - * Is Vrops enabled/disabled - */ - vrOpsEnabled?: boolean; - /** - * Azure Resource type. Possible values include: 'Microsoft.VMwareCloudSimple/privateClouds' - */ - type?: PrivateCloudResourceType; -} - -/** - * SKU availability model - */ -export interface SkuAvailability { - /** - * CloudSimple Availability Zone id - */ - dedicatedAvailabilityZoneId?: string; - /** - * CloudSimple Availability Zone Name - */ - dedicatedAvailabilityZoneName?: string; - /** - * CloudSimple Placement Group Id - */ - dedicatedPlacementGroupId?: string; - /** - * CloudSimple Placement Group name - */ - dedicatedPlacementGroupName?: string; - /** - * indicates how many resources of a given SKU is available in a AZ->PG - */ - limit: number; - /** - * resource type e.g. DedicatedCloudNodes - */ - resourceType?: string; - /** - * sku id - */ - skuId?: string; - /** - * sku name - */ - skuName?: string; -} - -/** - * User name model - */ -export interface UsageName { - /** - * e.g. "Virtual Machines" - */ - localizedValue?: string; - /** - * resource type or resource type sku name, e.g. virtualMachines - */ - value?: string; -} - -/** - * Usage model - */ -export interface Usage { - /** - * The current usage value. Default value: 0. - */ - currentValue: number; - /** - * limit of a given sku in a region for a subscription. The maximum permitted value for the usage - * quota. If there is no limit, this value will be -1. Default value: 0. - */ - limit: number; - /** - * Usage name value and localized name - */ - name?: UsageName; - /** - * The usages' unit. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', - * 'CountPerSecond', 'BytesPerSecond' - */ - unit?: UsageCount; + readonly vmwaretools?: string; } -/** - * Virtual machine model - */ -export interface VirtualMachine extends BaseResource { - /** - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/virtualMachines/{virtualMachineName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Azure region - */ - location: string; - /** - * {virtualMachineName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The amount of memory - */ - amountOfRam: number; - /** - * The list of Virtual Disks' Controllers - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly controllers?: VirtualDiskController[]; - /** - * The list of Virtual Disks - */ - disks?: VirtualDisk[]; - /** - * The DNS name of Virtual Machine in VCenter - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly dnsname?: string; - /** - * Expose Guest OS or not - */ - exposeToGuestVM?: boolean; - /** - * The path to virtual machine folder in VCenter - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly folder?: string; - /** - * The name of Guest OS - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly guestOS?: string; - /** - * The Guest OS type. Possible values include: 'linux', 'windows', 'other' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly guestOSType?: GuestOSType; - /** - * The list of Virtual NICs - */ - nics?: VirtualNic[]; - /** - * The number of CPU cores - */ - numberOfCores: number; - /** - * Password for login - */ +/** Guest OS Customization properties */ +export interface GuestOSCustomization { + /** List of dns servers to use */ + dnsServers?: string[]; + /** Virtual Machine hostname */ + hostName?: string; + /** Password for login */ password?: string; - /** - * Private Cloud Id - */ - privateCloudId: string; - /** - * The provisioning status of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: string; - /** - * The public ip of Virtual Machine - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly publicIP?: string; - /** - * Virtual Machines Resource Pool - */ - resourcePool?: ResourcePool; - /** - * The status of Virtual machine. Possible values include: 'running', 'suspended', 'poweredoff', - * 'updating', 'deallocating', 'deleting' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: VirtualMachineStatus; - /** - * Virtual Machine Template Id - */ - templateId?: string; - /** - * Username for login - */ + /** id of customization policy */ + policyId?: string; + /** Username for login */ username?: string; - /** - * The list of Virtual VSphere Networks - */ - vSphereNetworks?: string[]; - /** - * The internal id of Virtual Machine in VCenter - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly vmId?: string; - /** - * VMware tools version - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly vmwaretools?: string; - /** - * The list of tags - */ +} + +/** General patch payload modal */ +export interface PatchPayload { + /** The tags key:value pairs */ tags?: { [propertyName: string]: string }; - /** - * {resourceProviderNamespace}/{resourceType} - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; } -/** - * List of virtual machine stop modes - */ +/** List of virtual machine stop modes */ export interface VirtualMachineStopMode { - /** - * mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible - * values include: 'reboot', 'suspend', 'shutdown', 'poweroff' - */ + /** mode indicates a type of stop operation - reboot, suspend, shutdown or power-off */ mode?: StopMode; } -/** - * Optional Parameters. - */ -export interface DedicatedCloudNodesListBySubscriptionOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the list operation - */ - filter?: string; - /** - * The maximum number of record sets to return - */ - top?: number; - /** - * to be used by nextLink implementation - */ - skipToken?: string; +/** Defines headers for Operations_get operation. */ +export interface OperationsGetHeaders { + location?: string; + retryAfter?: number; } -/** - * Optional Parameters. - */ -export interface DedicatedCloudNodesListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the list operation - */ - filter?: string; - /** - * The maximum number of record sets to return - */ - top?: number; - /** - * to be used by nextLink implementation - */ - skipToken?: string; +/** Defines headers for Operations_get operation. */ +export interface OperationsGetExceptionHeaders { + contentType?: string; } -/** - * Optional Parameters. - */ -export interface DedicatedCloudNodesUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * The tags key:value pairs - */ - tags?: { [propertyName: string]: string }; +/** Defines headers for DedicatedCloudNodes_createOrUpdate operation. */ +export interface DedicatedCloudNodesCreateOrUpdateHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: number; } -/** - * Optional Parameters. - */ -export interface DedicatedCloudServicesListBySubscriptionOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the list operation - */ - filter?: string; - /** - * The maximum number of record sets to return - */ - top?: number; - /** - * to be used by nextLink implementation - */ - skipToken?: string; +/** Defines headers for DedicatedCloudNodes_delete operation. */ +export interface DedicatedCloudNodesDeleteExceptionHeaders { + contentType?: string; } -/** - * Optional Parameters. - */ -export interface DedicatedCloudServicesListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the list operation - */ - filter?: string; - /** - * The maximum number of record sets to return - */ - top?: number; - /** - * to be used by nextLink implementation - */ - skipToken?: string; +/** Defines headers for DedicatedCloudServices_delete operation. */ +export interface DedicatedCloudServicesDeleteExceptionHeaders { + contentType?: string; } -/** - * Optional Parameters. - */ -export interface DedicatedCloudServicesUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * The tags key:value pairs - */ - tags?: { [propertyName: string]: string }; +/** Defines headers for VirtualMachines_createOrUpdate operation. */ +export interface VirtualMachinesCreateOrUpdateHeaders { + azureAsyncOperation?: string; } -/** - * Optional Parameters. - */ -export interface SkusAvailabilityListOptionalParams extends msRest.RequestOptionsBase { - /** - * sku id, if no sku is passed availability for all skus will be returned - */ - skuId?: string; +/** Defines headers for VirtualMachines_delete operation. */ +export interface VirtualMachinesDeleteHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: number; } -/** - * Optional Parameters. - */ -export interface UsagesListOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the list operation. only name.value is allowed here as a filter e.g. - * $filter=name.value eq 'xxxx' - */ - filter?: string; +/** Defines headers for VirtualMachines_delete operation. */ +export interface VirtualMachinesDeleteExceptionHeaders { + contentType?: string; } -/** - * Optional Parameters. - */ -export interface VirtualMachinesListBySubscriptionOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the list operation - */ - filter?: string; - /** - * The maximum number of record sets to return - */ - top?: number; - /** - * to be used by nextLink implementation - */ - skipToken?: string; +/** Defines headers for VirtualMachines_start operation. */ +export interface VirtualMachinesStartHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: number; } -/** - * Optional Parameters. - */ -export interface VirtualMachinesListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the list operation - */ - filter?: string; - /** - * The maximum number of record sets to return - */ - top?: number; - /** - * to be used by nextLink implementation - */ - skipToken?: string; +/** Defines headers for VirtualMachines_start operation. */ +export interface VirtualMachinesStartExceptionHeaders { + contentType?: string; } -/** - * Optional Parameters. - */ -export interface VirtualMachinesUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * The tags key:value pairs - */ - tags?: { [propertyName: string]: string }; +/** Defines headers for VirtualMachines_stop operation. */ +export interface VirtualMachinesStopHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: number; } -/** - * Optional Parameters. - */ -export interface VirtualMachinesStopOptionalParams extends msRest.RequestOptionsBase { - /** - * query stop mode parameter (reboot, shutdown, etc...). Possible values include: 'reboot', - * 'suspend', 'shutdown', 'poweroff' - */ - mode?: StopMode; - /** - * mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible - * values include: 'reboot', 'suspend', 'shutdown', 'poweroff' - */ - mode1?: StopMode; +/** Defines headers for VirtualMachines_stop operation. */ +export interface VirtualMachinesStopExceptionHeaders { + contentType?: string; } -/** - * Optional Parameters. - */ -export interface VirtualMachinesBeginUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * The tags key:value pairs - */ - tags?: { [propertyName: string]: string }; +/** Known values of {@link GuestOsnicCustomizationAllocation} that the service accepts. */ +export enum KnownGuestOsnicCustomizationAllocation { + Static = "static", + Dynamic = "dynamic" } /** - * Optional Parameters. + * Defines values for GuestOsnicCustomizationAllocation. \ + * {@link KnownGuestOsnicCustomizationAllocation} can be used interchangeably with GuestOsnicCustomizationAllocation, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **static** \ + * **dynamic** */ -export interface VirtualMachinesBeginStopOptionalParams extends msRest.RequestOptionsBase { - /** - * query stop mode parameter (reboot, shutdown, etc...). Possible values include: 'reboot', - * 'suspend', 'shutdown', 'poweroff' - */ - mode?: StopMode; - /** - * mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible - * values include: 'reboot', 'suspend', 'shutdown', 'poweroff' - */ - mode1?: StopMode; -} +export type GuestOsnicCustomizationAllocation = string; -/** - * An interface representing VMwareCloudSimpleClientOptions. - */ -export interface VMwareCloudSimpleClientOptions extends AzureServiceClientOptions { - baseUri?: string; +/** Known values of {@link CustomizationHostNameType} that the service accepts. */ +export enum KnownCustomizationHostNameType { + UserDefined = "USER_DEFINED", + PrefixBased = "PREFIX_BASED", + Fixed = "FIXED", + VirtualMachineName = "VIRTUAL_MACHINE_NAME", + CustomName = "CUSTOM_NAME" } /** - * Defines headers for Get operation. + * Defines values for CustomizationHostNameType. \ + * {@link KnownCustomizationHostNameType} can be used interchangeably with CustomizationHostNameType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **USER_DEFINED** \ + * **PREFIX_BASED** \ + * **FIXED** \ + * **VIRTUAL_MACHINE_NAME** \ + * **CUSTOM_NAME** */ -export interface OperationsGetHeaders { - location: string; - retryAfter: number; - contentType: string; -} +export type CustomizationHostNameType = string; -/** - * Defines headers for CreateOrUpdate operation. - */ -export interface DedicatedCloudNodesCreateOrUpdateHeaders { - azureAsyncOperation: string; - locationHeader: string; - retryAfter: number; +/** Known values of {@link CustomizationIdentityType} that the service accepts. */ +export enum KnownCustomizationIdentityType { + WindowsText = "WINDOWS_TEXT", + Windows = "WINDOWS", + Linux = "LINUX" } /** - * Defines headers for Delete operation. + * Defines values for CustomizationIdentityType. \ + * {@link KnownCustomizationIdentityType} can be used interchangeably with CustomizationIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **WINDOWS_TEXT** \ + * **WINDOWS** \ + * **LINUX** */ -export interface DedicatedCloudNodesDeleteHeaders { - contentType: string; -} +export type CustomizationIdentityType = string; -/** - * Defines headers for Delete operation. - */ -export interface DedicatedCloudServicesDeleteHeaders { - contentType: string; +/** Known values of {@link CustomizationIPAddressType} that the service accepts. */ +export enum KnownCustomizationIPAddressType { + Custom = "CUSTOM", + DhcpIP = "DHCP_IP", + FixedIP = "FIXED_IP", + UserDefined = "USER_DEFINED" } /** - * Defines headers for CreateOrUpdate operation. + * Defines values for CustomizationIPAddressType. \ + * {@link KnownCustomizationIPAddressType} can be used interchangeably with CustomizationIPAddressType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CUSTOM** \ + * **DHCP_IP** \ + * **FIXED_IP** \ + * **USER_DEFINED** */ -export interface VirtualMachinesCreateOrUpdateHeaders { - azureAsyncOperation: string; -} +export type CustomizationIPAddressType = string; -/** - * Defines headers for Delete operation. - */ -export interface VirtualMachinesDeleteHeaders { - azureAsyncOperation: string; - location: string; - retryAfter: number; - contentType: string; +/** Known values of {@link CustomizationPolicyPropertiesType} that the service accepts. */ +export enum KnownCustomizationPolicyPropertiesType { + Linux = "LINUX", + Windows = "WINDOWS" } /** - * Defines headers for Start operation. - */ -export interface VirtualMachinesStartHeaders { - azureAsyncOperation: string; - location: string; - retryAfter: number; - contentType: string; + * Defines values for CustomizationPolicyPropertiesType. \ + * {@link KnownCustomizationPolicyPropertiesType} can be used interchangeably with CustomizationPolicyPropertiesType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **LINUX** \ + * **WINDOWS** + */ +export type CustomizationPolicyPropertiesType = string; +/** Defines values for OperationOrigin. */ +export type OperationOrigin = "user" | "system" | "user,system"; +/** Defines values for AggregationType. */ +export type AggregationType = "Average" | "Total"; +/** Defines values for NodeStatus. */ +export type NodeStatus = "unused" | "used"; +/** Defines values for OnboardingStatus. */ +export type OnboardingStatus = + | "notOnBoarded" + | "onBoarded" + | "onBoardingFailed" + | "onBoarding"; +/** Defines values for DiskIndependenceMode. */ +export type DiskIndependenceMode = + | "persistent" + | "independent_persistent" + | "independent_nonpersistent"; +/** Defines values for NICType. */ +export type NICType = + | "E1000" + | "E1000E" + | "PCNET32" + | "VMXNET" + | "VMXNET2" + | "VMXNET3"; +/** Defines values for UsageCount. */ +export type UsageCount = + | "Count" + | "Bytes" + | "Seconds" + | "Percent" + | "CountPerSecond" + | "BytesPerSecond"; +/** Defines values for GuestOSType. */ +export type GuestOSType = "linux" | "windows" | "other"; +/** Defines values for VirtualMachineStatus. */ +export type VirtualMachineStatus = + | "running" + | "suspended" + | "poweredoff" + | "updating" + | "deallocating" + | "deleting"; +/** Defines values for StopMode. */ +export type StopMode = "reboot" | "suspend" | "shutdown" | "poweroff"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = AvailableOperationsListResponse; + +/** Optional parameters. */ +export interface OperationsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type OperationsGetResponse = OperationResource; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = AvailableOperationsListResponse; + +/** Optional parameters. */ +export interface DedicatedCloudNodesListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; } -/** - * Defines headers for Stop operation. - */ -export interface VirtualMachinesStopHeaders { - azureAsyncOperation: string; - location: string; - retryAfter: number; - contentType: string; -} +/** Contains response data for the listBySubscription operation. */ +export type DedicatedCloudNodesListBySubscriptionResponse = DedicatedCloudNodeListResponse; -/** - * @interface - * List of available operations - * @extends Array - */ -export interface AvailableOperationsListResponse extends Array { - /** - * Link for next list of available operations - */ - nextLink?: string; +/** Optional parameters. */ +export interface DedicatedCloudNodesListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; } -/** - * @interface - * List of dedicated nodes response model - * @extends Array - */ -export interface DedicatedCloudNodeListResponse extends Array { - /** - * Link for next list of DedicatedCloudNode - */ - nextLink?: string; -} +/** Contains response data for the listByResourceGroup operation. */ +export type DedicatedCloudNodesListByResourceGroupResponse = DedicatedCloudNodeListResponse; -/** - * @interface - * List of dedicated cloud services - * @extends Array - */ -export interface DedicatedCloudServiceListResponse extends Array { - /** - * Link for next list of DedicatedCloudNode - */ - nextLink?: string; -} +/** Optional parameters. */ +export interface DedicatedCloudNodesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * List of SKU availabilities - * @extends Array - */ -export interface SkuAvailabilityListResponse extends Array { - /** - * Link for next list of DedicatedCloudNode - */ - nextLink?: string; +/** Contains response data for the get operation. */ +export type DedicatedCloudNodesGetResponse = DedicatedCloudNode; + +/** Optional parameters. */ +export interface DedicatedCloudNodesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * List of private clouds - * @extends Array - */ -export interface PrivateCloudList extends Array { - /** - * Link for next list of Private Clouds - */ - nextLink?: string; +/** Contains response data for the createOrUpdate operation. */ +export type DedicatedCloudNodesCreateOrUpdateResponse = DedicatedCloudNodesCreateOrUpdateHeaders & + DedicatedCloudNode; + +/** Optional parameters. */ +export interface DedicatedCloudNodesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DedicatedCloudNodesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type DedicatedCloudNodesUpdateResponse = DedicatedCloudNode; + +/** Optional parameters. */ +export interface DedicatedCloudNodesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; } -/** - * @interface - * List of resource pools response model - * @extends Array - */ -export interface ResourcePoolsListResponse extends Array { - /** - * Link for next list of ResourcePoolsList - */ - nextLink?: string; +/** Contains response data for the listBySubscriptionNext operation. */ +export type DedicatedCloudNodesListBySubscriptionNextResponse = DedicatedCloudNodeListResponse; + +/** Optional parameters. */ +export interface DedicatedCloudNodesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; } -/** - * @interface - * List of virtual machine templates - * @extends Array - */ -export interface VirtualMachineTemplateListResponse extends Array { - /** - * Link for next list of VirtualMachineTemplate - */ - nextLink?: string; +/** Contains response data for the listByResourceGroupNext operation. */ +export type DedicatedCloudNodesListByResourceGroupNextResponse = DedicatedCloudNodeListResponse; + +/** Optional parameters. */ +export interface DedicatedCloudServicesListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; } -/** - * @interface - * List of virtual networks - * @extends Array - */ -export interface VirtualNetworkListResponse extends Array { - /** - * Link for next list of VirtualNetwork - */ - nextLink?: string; +/** Contains response data for the listBySubscription operation. */ +export type DedicatedCloudServicesListBySubscriptionResponse = DedicatedCloudServiceListResponse; + +/** Optional parameters. */ +export interface DedicatedCloudServicesListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; } -/** - * @interface - * List of usages - * @extends Array - */ -export interface UsageListResponse extends Array { - /** - * Link for next list of DedicatedCloudNode - */ - nextLink?: string; +/** Contains response data for the listByResourceGroup operation. */ +export type DedicatedCloudServicesListByResourceGroupResponse = DedicatedCloudServiceListResponse; + +/** Optional parameters. */ +export interface DedicatedCloudServicesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DedicatedCloudServicesGetResponse = DedicatedCloudService; + +/** Optional parameters. */ +export interface DedicatedCloudServicesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type DedicatedCloudServicesCreateOrUpdateResponse = DedicatedCloudService; + +/** Optional parameters. */ +export interface DedicatedCloudServicesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * List of virtual machines - * @extends Array - */ -export interface VirtualMachineListResponse extends Array { - /** - * Link for next list of VirtualMachines - */ - nextLink?: string; +/** Optional parameters. */ +export interface DedicatedCloudServicesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type DedicatedCloudServicesUpdateResponse = DedicatedCloudService; + +/** Optional parameters. */ +export interface DedicatedCloudServicesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; } -/** - * Defines values for OperationOrigin. - * Possible values include: 'user', 'system', 'user,system' - * @readonly - * @enum {string} - */ -export type OperationOrigin = 'user' | 'system' | 'user,system'; +/** Contains response data for the listBySubscriptionNext operation. */ +export type DedicatedCloudServicesListBySubscriptionNextResponse = DedicatedCloudServiceListResponse; -/** - * Defines values for AggregationType. - * Possible values include: 'Average', 'Total' - * @readonly - * @enum {string} - */ -export type AggregationType = 'Average' | 'Total'; +/** Optional parameters. */ +export interface DedicatedCloudServicesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; +} -/** - * Defines values for NodeStatus. - * Possible values include: 'unused', 'used' - * @readonly - * @enum {string} - */ -export type NodeStatus = 'unused' | 'used'; +/** Contains response data for the listByResourceGroupNext operation. */ +export type DedicatedCloudServicesListByResourceGroupNextResponse = DedicatedCloudServiceListResponse; -/** - * Defines values for OnboardingStatus. - * Possible values include: 'notOnBoarded', 'onBoarded', 'onBoardingFailed', 'onBoarding' - * @readonly - * @enum {string} - */ -export type OnboardingStatus = 'notOnBoarded' | 'onBoarded' | 'onBoardingFailed' | 'onBoarding'; +/** Optional parameters. */ +export interface SkusAvailabilityListOptionalParams + extends coreClient.OperationOptions { + /** sku id, if no sku is passed availability for all skus will be returned */ + skuId?: string; +} -/** - * Defines values for DiskIndependenceMode. - * Possible values include: 'persistent', 'independent_persistent', 'independent_nonpersistent' - * @readonly - * @enum {string} - */ -export type DiskIndependenceMode = 'persistent' | 'independent_persistent' | 'independent_nonpersistent'; +/** Contains response data for the list operation. */ +export type SkusAvailabilityListResponse = SkuAvailabilityListResponse; -/** - * Defines values for NICType. - * Possible values include: 'E1000', 'E1000E', 'PCNET32', 'VMXNET', 'VMXNET2', 'VMXNET3' - * @readonly - * @enum {string} - */ -export type NICType = 'E1000' | 'E1000E' | 'PCNET32' | 'VMXNET' | 'VMXNET2' | 'VMXNET3'; +/** Optional parameters. */ +export interface SkusAvailabilityListNextOptionalParams + extends coreClient.OperationOptions { + /** sku id, if no sku is passed availability for all skus will be returned */ + skuId?: string; +} -/** - * Defines values for PrivateCloudResourceType. - * Possible values include: 'Microsoft.VMwareCloudSimple/privateClouds' - * @readonly - * @enum {string} - */ -export type PrivateCloudResourceType = 'Microsoft.VMwareCloudSimple/privateClouds'; +/** Contains response data for the listNext operation. */ +export type SkusAvailabilityListNextResponse = SkuAvailabilityListResponse; -/** - * Defines values for UsageCount. - * Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', - * 'BytesPerSecond' - * @readonly - * @enum {string} - */ -export type UsageCount = 'Count' | 'Bytes' | 'Seconds' | 'Percent' | 'CountPerSecond' | 'BytesPerSecond'; +/** Optional parameters. */ +export interface PrivateCloudsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for GuestOSType. - * Possible values include: 'linux', 'windows', 'other' - * @readonly - * @enum {string} - */ -export type GuestOSType = 'linux' | 'windows' | 'other'; +/** Contains response data for the list operation. */ +export type PrivateCloudsListResponse = PrivateCloudList; -/** - * Defines values for VirtualMachineStatus. - * Possible values include: 'running', 'suspended', 'poweredoff', 'updating', 'deallocating', - * 'deleting' - * @readonly - * @enum {string} - */ -export type VirtualMachineStatus = 'running' | 'suspended' | 'poweredoff' | 'updating' | 'deallocating' | 'deleting'; +/** Optional parameters. */ +export interface PrivateCloudsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for StopMode. - * Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' - * @readonly - * @enum {string} - */ -export type StopMode = 'reboot' | 'suspend' | 'shutdown' | 'poweroff'; +/** Contains response data for the get operation. */ +export type PrivateCloudsGetResponse = PrivateCloud; -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = AvailableOperationsListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AvailableOperationsListResponse; - }; -}; +/** Optional parameters. */ +export interface PrivateCloudsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type OperationsGetResponse = OperationResource & OperationsGetHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: OperationsGetHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationResource; - }; -}; +/** Contains response data for the listNext operation. */ +export type PrivateCloudsListNextResponse = PrivateCloudList; -/** - * Contains response data for the listNext operation. - */ -export type OperationsListNextResponse = AvailableOperationsListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AvailableOperationsListResponse; - }; -}; +/** Optional parameters. */ +export interface CustomizationPoliciesListOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation. only type is allowed here as a filter e.g. $filter=type eq 'xxxx' */ + filter?: string; +} -/** - * Contains response data for the listBySubscription operation. - */ -export type DedicatedCloudNodesListBySubscriptionResponse = DedicatedCloudNodeListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudNodeListResponse; - }; -}; +/** Contains response data for the list operation. */ +export type CustomizationPoliciesListOperationResponse = CustomizationPoliciesListResponse; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type DedicatedCloudNodesListByResourceGroupResponse = DedicatedCloudNodeListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudNodeListResponse; - }; -}; +/** Optional parameters. */ +export interface CustomizationPoliciesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type DedicatedCloudNodesGetResponse = DedicatedCloudNode & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudNode; - }; -}; +/** Contains response data for the get operation. */ +export type CustomizationPoliciesGetResponse = CustomizationPolicy; -/** - * Contains response data for the createOrUpdate operation. - */ -export type DedicatedCloudNodesCreateOrUpdateResponse = DedicatedCloudNode & DedicatedCloudNodesCreateOrUpdateHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: DedicatedCloudNodesCreateOrUpdateHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudNode; - }; -}; +/** Optional parameters. */ +export interface CustomizationPoliciesListNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation. only type is allowed here as a filter e.g. $filter=type eq 'xxxx' */ + filter?: string; +} -/** - * Contains response data for the deleteMethod operation. - */ -export type DedicatedCloudNodesDeleteResponse = DedicatedCloudNodesDeleteHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: DedicatedCloudNodesDeleteHeaders; - }; -}; +/** Contains response data for the listNext operation. */ +export type CustomizationPoliciesListNextResponse = CustomizationPoliciesListResponse; -/** - * Contains response data for the update operation. - */ -export type DedicatedCloudNodesUpdateResponse = DedicatedCloudNode & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudNode; - }; -}; +/** Optional parameters. */ +export interface ResourcePoolsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listBySubscriptionNext operation. - */ -export type DedicatedCloudNodesListBySubscriptionNextResponse = DedicatedCloudNodeListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudNodeListResponse; - }; -}; +/** Contains response data for the list operation. */ +export type ResourcePoolsListOperationResponse = ResourcePoolsListResponse; -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type DedicatedCloudNodesListByResourceGroupNextResponse = DedicatedCloudNodeListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudNodeListResponse; - }; -}; +/** Optional parameters. */ +export interface ResourcePoolsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listBySubscription operation. - */ -export type DedicatedCloudServicesListBySubscriptionResponse = DedicatedCloudServiceListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudServiceListResponse; - }; -}; +/** Contains response data for the get operation. */ +export type ResourcePoolsGetResponse = ResourcePool; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type DedicatedCloudServicesListByResourceGroupResponse = DedicatedCloudServiceListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudServiceListResponse; - }; -}; +/** Optional parameters. */ +export interface ResourcePoolsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type DedicatedCloudServicesGetResponse = DedicatedCloudService & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudService; - }; -}; +/** Contains response data for the listNext operation. */ +export type ResourcePoolsListNextResponse = ResourcePoolsListResponse; -/** - * Contains response data for the createOrUpdate operation. - */ -export type DedicatedCloudServicesCreateOrUpdateResponse = DedicatedCloudService & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudService; - }; -}; +/** Optional parameters. */ +export interface VirtualMachineTemplatesListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the deleteMethod operation. - */ -export type DedicatedCloudServicesDeleteResponse = DedicatedCloudServicesDeleteHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: DedicatedCloudServicesDeleteHeaders; - }; -}; +/** Contains response data for the list operation. */ +export type VirtualMachineTemplatesListResponse = VirtualMachineTemplateListResponse; -/** - * Contains response data for the update operation. - */ -export type DedicatedCloudServicesUpdateResponse = DedicatedCloudService & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudService; - }; -}; +/** Optional parameters. */ +export interface VirtualMachineTemplatesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listBySubscriptionNext operation. - */ -export type DedicatedCloudServicesListBySubscriptionNextResponse = DedicatedCloudServiceListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudServiceListResponse; - }; -}; +/** Contains response data for the get operation. */ +export type VirtualMachineTemplatesGetResponse = VirtualMachineTemplate; -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type DedicatedCloudServicesListByResourceGroupNextResponse = DedicatedCloudServiceListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DedicatedCloudServiceListResponse; - }; -}; +/** Optional parameters. */ +export interface VirtualMachineTemplatesListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type SkusAvailabilityListResponse = SkuAvailabilityListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SkuAvailabilityListResponse; - }; -}; +/** Contains response data for the listNext operation. */ +export type VirtualMachineTemplatesListNextResponse = VirtualMachineTemplateListResponse; -/** - * Contains response data for the listNext operation. - */ -export type SkusAvailabilityListNextResponse = SkuAvailabilityListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SkuAvailabilityListResponse; - }; -}; +/** Optional parameters. */ +export interface VirtualNetworksListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type PrivateCloudsListResponse = PrivateCloudList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateCloudList; - }; -}; +/** Contains response data for the list operation. */ +export type VirtualNetworksListResponse = VirtualNetworkListResponse; -/** - * Contains response data for the get operation. - */ -export type PrivateCloudsGetResponse = PrivateCloud & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateCloud; - }; -}; +/** Optional parameters. */ +export interface VirtualNetworksGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type PrivateCloudsListNextResponse = PrivateCloudList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateCloudList; - }; -}; +/** Contains response data for the get operation. */ +export type VirtualNetworksGetResponse = VirtualNetwork; -/** - * Contains response data for the list operation. - */ -export type ResourcePoolsListResponse2 = ResourcePoolsListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResourcePoolsListResponse; - }; -}; +/** Optional parameters. */ +export interface VirtualNetworksListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ResourcePoolsGetResponse = ResourcePool & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResourcePool; - }; -}; +/** Contains response data for the listNext operation. */ +export type VirtualNetworksListNextResponse = VirtualNetworkListResponse; -/** - * Contains response data for the listNext operation. - */ -export type ResourcePoolsListNextResponse = ResourcePoolsListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResourcePoolsListResponse; - }; -}; +/** Optional parameters. */ +export interface UsagesListOptionalParams extends coreClient.OperationOptions { + /** The filter to apply on the list operation. only name.value is allowed here as a filter e.g. $filter=name.value eq 'xxxx' */ + filter?: string; +} -/** - * Contains response data for the list operation. - */ -export type VirtualMachineTemplatesListResponse = VirtualMachineTemplateListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualMachineTemplateListResponse; - }; -}; +/** Contains response data for the list operation. */ +export type UsagesListResponse = UsageListResponse; -/** - * Contains response data for the get operation. - */ -export type VirtualMachineTemplatesGetResponse = VirtualMachineTemplate & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualMachineTemplate; - }; -}; +/** Optional parameters. */ +export interface UsagesListNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation. only name.value is allowed here as a filter e.g. $filter=name.value eq 'xxxx' */ + filter?: string; +} -/** - * Contains response data for the listNext operation. - */ -export type VirtualMachineTemplatesListNextResponse = VirtualMachineTemplateListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualMachineTemplateListResponse; - }; -}; +/** Contains response data for the listNext operation. */ +export type UsagesListNextResponse = UsageListResponse; -/** - * Contains response data for the list operation. - */ -export type VirtualNetworksListResponse = VirtualNetworkListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualNetworkListResponse; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; +} -/** - * Contains response data for the get operation. - */ -export type VirtualNetworksGetResponse = VirtualNetwork & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualNetwork; - }; -}; +/** Contains response data for the listBySubscription operation. */ +export type VirtualMachinesListBySubscriptionResponse = VirtualMachineListResponse; -/** - * Contains response data for the listNext operation. - */ -export type VirtualNetworksListNextResponse = VirtualNetworkListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualNetworkListResponse; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; +} -/** - * Contains response data for the list operation. - */ -export type UsagesListResponse = UsageListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageListResponse; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type VirtualMachinesListByResourceGroupResponse = VirtualMachineListResponse; -/** - * Contains response data for the listNext operation. - */ -export type UsagesListNextResponse = UsageListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageListResponse; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listBySubscription operation. - */ -export type VirtualMachinesListBySubscriptionResponse = VirtualMachineListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualMachineListResponse; - }; -}; +/** Contains response data for the get operation. */ +export type VirtualMachinesGetResponse = VirtualMachine; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type VirtualMachinesListByResourceGroupResponse = VirtualMachineListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualMachineListResponse; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the get operation. - */ -export type VirtualMachinesGetResponse = VirtualMachine & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualMachine; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type VirtualMachinesCreateOrUpdateResponse = VirtualMachinesCreateOrUpdateHeaders & + VirtualMachine; + +/** Optional parameters. */ +export interface VirtualMachinesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type VirtualMachinesCreateOrUpdateResponse = VirtualMachine & VirtualMachinesCreateOrUpdateHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: VirtualMachinesCreateOrUpdateHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualMachine; - }; -}; +/** Contains response data for the delete operation. */ +export type VirtualMachinesDeleteResponse = VirtualMachinesDeleteHeaders; -/** - * Contains response data for the deleteMethod operation. - */ -export type VirtualMachinesDeleteResponse = VirtualMachinesDeleteHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: VirtualMachinesDeleteHeaders; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the update operation. - */ -export type VirtualMachinesUpdateResponse = VirtualMachine & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualMachine; - }; -}; +/** Contains response data for the update operation. */ +export type VirtualMachinesUpdateResponse = VirtualMachine; -/** - * Contains response data for the start operation. - */ -export type VirtualMachinesStartResponse = VirtualMachinesStartHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: VirtualMachinesStartHeaders; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesStartOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the stop operation. - */ -export type VirtualMachinesStopResponse = VirtualMachinesStopHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: VirtualMachinesStopHeaders; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesStopOptionalParams + extends coreClient.OperationOptions { + /** body stop mode parameter (reboot, shutdown, etc...) */ + m?: VirtualMachineStopMode; + /** query stop mode parameter (reboot, shutdown, etc...) */ + mode?: StopMode; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the beginUpdate operation. - */ -export type VirtualMachinesBeginUpdateResponse = VirtualMachine & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualMachine; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; +} -/** - * Contains response data for the listBySubscriptionNext operation. - */ -export type VirtualMachinesListBySubscriptionNextResponse = VirtualMachineListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualMachineListResponse; - }; -}; +/** Contains response data for the listBySubscriptionNext operation. */ +export type VirtualMachinesListBySubscriptionNextResponse = VirtualMachineListResponse; -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type VirtualMachinesListByResourceGroupNextResponse = VirtualMachineListResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VirtualMachineListResponse; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation */ + filter?: string; + /** The maximum number of record sets to return */ + top?: number; + /** to be used by nextLink implementation */ + skipToken?: string; +} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type VirtualMachinesListByResourceGroupNextResponse = VirtualMachineListResponse; + +/** Optional parameters. */ +export interface VMwareCloudSimpleOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/mappers.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/mappers.ts index 8f0066f574ee..f8bdc185996e 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/mappers.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/mappers.ts @@ -1,92 +1,109 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const AvailableOperationDisplay: msRest.CompositeMapper = { - serializedName: "AvailableOperationDisplay", +export const AvailableOperationsListResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailableOperationDisplay", + className: "AvailableOperationsListResponse", modelProperties: { - description: { - serializedName: "description", + nextLink: { + serializedName: "nextLink", type: { name: "String" } }, - operation: { - serializedName: "operation", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AvailableOperation" + } + } + } + } + } + } +}; + +export const AvailableOperation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableOperation", + modelProperties: { + display: { + serializedName: "display", + type: { + name: "Composite", + className: "AvailableOperationDisplay" } }, - provider: { - serializedName: "provider", + isDataAction: { + defaultValue: false, + serializedName: "isDataAction", type: { - name: "String" + name: "Boolean" } }, - resource: { - serializedName: "resource", + name: { + serializedName: "name", type: { name: "String" } + }, + origin: { + serializedName: "origin", + type: { + name: "Enum", + allowedValues: ["user", "system", "user,system"] + } + }, + serviceSpecification: { + serializedName: "properties.serviceSpecification", + type: { + name: "Composite", + className: + "AvailableOperationDisplayPropertyServiceSpecificationMetricsList" + } } } } }; -export const AvailableOperationDisplayPropertyServiceSpecificationMetricsItem: msRest.CompositeMapper = { - serializedName: "AvailableOperationDisplayPropertyServiceSpecificationMetricsItem", +export const AvailableOperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailableOperationDisplayPropertyServiceSpecificationMetricsItem", + className: "AvailableOperationDisplay", modelProperties: { - aggregationType: { - required: true, - serializedName: "aggregationType", - type: { - name: "Enum", - allowedValues: [ - "Average", - "Total" - ] - } - }, - displayDescription: { - required: true, - serializedName: "displayDescription", + description: { + serializedName: "description", type: { name: "String" } }, - displayName: { - required: true, - serializedName: "displayName", + operation: { + serializedName: "operation", type: { name: "String" } }, - name: { - required: true, - serializedName: "name", + provider: { + serializedName: "provider", type: { name: "String" } }, - unit: { - required: true, - serializedName: "unit", + resource: { + serializedName: "resource", type: { name: "String" } @@ -95,11 +112,11 @@ export const AvailableOperationDisplayPropertyServiceSpecificationMetricsItem: m } }; -export const AvailableOperationDisplayPropertyServiceSpecificationMetricsList: msRest.CompositeMapper = { - serializedName: "AvailableOperationDisplayPropertyServiceSpecificationMetricsList", +export const AvailableOperationDisplayPropertyServiceSpecificationMetricsList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailableOperationDisplayPropertyServiceSpecificationMetricsList", + className: + "AvailableOperationDisplayPropertyServiceSpecificationMetricsList", modelProperties: { metricSpecifications: { serializedName: "metricSpecifications", @@ -108,7 +125,8 @@ export const AvailableOperationDisplayPropertyServiceSpecificationMetricsList: m element: { type: { name: "Composite", - className: "AvailableOperationDisplayPropertyServiceSpecificationMetricsItem" + className: + "AvailableOperationDisplayPropertyServiceSpecificationMetricsItem" } } } @@ -117,83 +135,96 @@ export const AvailableOperationDisplayPropertyServiceSpecificationMetricsList: m } }; -export const AvailableOperation: msRest.CompositeMapper = { - serializedName: "AvailableOperation", +export const AvailableOperationDisplayPropertyServiceSpecificationMetricsItem: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailableOperation", + className: + "AvailableOperationDisplayPropertyServiceSpecificationMetricsItem", modelProperties: { - display: { - serializedName: "display", + aggregationType: { + serializedName: "aggregationType", + required: true, type: { - name: "Composite", - className: "AvailableOperationDisplay" + name: "Enum", + allowedValues: ["Average", "Total"] } }, - isDataAction: { - serializedName: "isDataAction", - defaultValue: false, + displayDescription: { + serializedName: "displayDescription", + required: true, type: { - name: "Boolean" + name: "String" + } + }, + displayName: { + serializedName: "displayName", + required: true, + type: { + name: "String" } }, name: { serializedName: "name", + required: true, type: { name: "String" } }, - origin: { - serializedName: "origin", + unit: { + serializedName: "unit", + required: true, type: { - name: "Enum", - allowedValues: [ - "user", - "system", - "user,system" - ] + name: "String" } - }, - serviceSpecification: { - serializedName: "properties.serviceSpecification", + } + } + } +}; + +export const CsrpError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CsrpError", + modelProperties: { + error: { + serializedName: "error", type: { name: "Composite", - className: "AvailableOperationDisplayPropertyServiceSpecificationMetricsList" + className: "CsrpErrorBody" } } } } }; -export const CSRPErrorBody: msRest.CompositeMapper = { - serializedName: "CSRPErrorBody", +export const CsrpErrorBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CSRPErrorBody", + className: "CsrpErrorBody", modelProperties: { code: { - readOnly: true, serializedName: "code", + readOnly: true, type: { name: "String" } }, details: { - readOnly: true, serializedName: "details", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "CSRPErrorBody" + className: "CsrpErrorBody" } } } }, message: { - readOnly: true, serializedName: "message", + readOnly: true, type: { name: "String" } @@ -208,272 +239,306 @@ export const CSRPErrorBody: msRest.CompositeMapper = { } }; -export const CSRPError: msRest.CompositeMapper = { - serializedName: "CSRPError", +export const DedicatedCloudNodeListResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CSRPError", + className: "DedicatedCloudNodeListResponse", modelProperties: { - error: { - serializedName: "error", + nextLink: { + serializedName: "nextLink", type: { - name: "Composite", - className: "CSRPErrorBody" + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DedicatedCloudNode" + } + } } } } } }; -export const Sku: msRest.CompositeMapper = { - serializedName: "Sku", +export const DedicatedCloudNode: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Sku", + className: "DedicatedCloudNode", modelProperties: { - capacity: { - serializedName: "capacity", - type: { - name: "String" - } - }, - description: { - serializedName: "description", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - family: { - serializedName: "family", + location: { + serializedName: "location", + required: true, type: { name: "String" } }, name: { - required: true, + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$") + }, serializedName: "name", + readOnly: true, type: { name: "String" } }, - tier: { - serializedName: "tier", - type: { - name: "String" - } - } - } - } -}; - -export const DedicatedCloudNode: msRest.CompositeMapper = { - serializedName: "DedicatedCloudNode", - type: { - name: "Composite", - className: "DedicatedCloudNode", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", + sku: { + serializedName: "sku", type: { - name: "String" + name: "Composite", + className: "Sku" } }, - location: { - required: true, - serializedName: "location", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - name: { + type: { + serializedName: "type", readOnly: true, - serializedName: "name", - constraints: { - Pattern: /^[-a-zA-Z0-9]+$/ - }, type: { name: "String" } }, availabilityZoneId: { - required: true, serializedName: "properties.availabilityZoneId", type: { name: "String" } }, availabilityZoneName: { - readOnly: true, serializedName: "properties.availabilityZoneName", + readOnly: true, type: { name: "String" } }, cloudRackName: { - readOnly: true, serializedName: "properties.cloudRackName", + readOnly: true, type: { name: "String" } }, created: { - readOnly: true, serializedName: "properties.created", + readOnly: true, type: { - name: "Object" + name: "DateTime" } }, nodesCount: { - required: true, serializedName: "properties.nodesCount", type: { name: "Number" } }, placementGroupId: { - required: true, serializedName: "properties.placementGroupId", type: { name: "String" } }, placementGroupName: { - readOnly: true, serializedName: "properties.placementGroupName", + readOnly: true, type: { name: "String" } }, privateCloudId: { - readOnly: true, serializedName: "properties.privateCloudId", + readOnly: true, type: { name: "String" } }, privateCloudName: { - readOnly: true, serializedName: "properties.privateCloudName", + readOnly: true, type: { name: "String" } }, provisioningState: { - readOnly: true, serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } }, purchaseId: { - required: true, serializedName: "properties.purchaseId", type: { name: "Uuid" } }, - id1: { - required: true, - serializedName: "properties.skuDescription.id", - type: { - name: "String" - } - }, - name1: { - required: true, - serializedName: "properties.skuDescription.name", - type: { - name: "String" - } - }, status: { - readOnly: true, serializedName: "properties.status", + readOnly: true, type: { name: "Enum", - allowedValues: [ - "unused", - "used" - ] + allowedValues: ["unused", "used"] } }, vmwareClusterName: { - readOnly: true, serializedName: "properties.vmwareClusterName", + readOnly: true, type: { name: "String" } }, - sku: { - serializedName: "sku", + idPropertiesSkuDescriptionId: { + serializedName: "properties.skuDescription.id", type: { - name: "Composite", - className: "Sku" + name: "String" } }, - tags: { - serializedName: "tags", + namePropertiesSkuDescriptionName: { + serializedName: "properties.skuDescription.name", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" + } + } + } + } +}; + +export const Sku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Sku", + modelProperties: { + capacity: { + serializedName: "capacity", + type: { + name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + description: { + serializedName: "description", + type: { + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + } + } + } +}; + +export const DedicatedCloudServiceListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DedicatedCloudServiceListResponse", + modelProperties: { + nextLink: { + serializedName: "nextLink", type: { name: "String" } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DedicatedCloudService" + } + } + } } } } }; -export const DedicatedCloudService: msRest.CompositeMapper = { - serializedName: "DedicatedCloudService", +export const DedicatedCloudService: coreClient.CompositeMapper = { type: { name: "Composite", className: "DedicatedCloudService", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, location: { - required: true, serializedName: "location", + required: true, type: { name: "String" } }, name: { - readOnly: true, - serializedName: "name", constraints: { - Pattern: /^[-a-zA-Z0-9]+$/ + Pattern: new RegExp("^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$") }, + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, gatewaySubnet: { - required: true, serializedName: "properties.gatewaySubnet", type: { name: "String" } }, isAccountOnboarded: { - readOnly: true, serializedName: "properties.isAccountOnboarded", + readOnly: true, type: { name: "Enum", allowedValues: [ @@ -486,52 +551,99 @@ export const DedicatedCloudService: msRest.CompositeMapper = { }, nodes: { serializedName: "properties.nodes", + readOnly: true, type: { name: "Number" } }, serviceURL: { serializedName: "properties.serviceURL", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SkuAvailabilityListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuAvailabilityListResponse", + modelProperties: { + nextLink: { + serializedName: "nextLink", type: { name: "String" } }, - tags: { - serializedName: "tags", + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "SkuAvailability" } } } - }, - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } } } } }; -export const OperationError: msRest.CompositeMapper = { - serializedName: "OperationError", +export const SkuAvailability: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationError", + className: "SkuAvailability", modelProperties: { - code: { - serializedName: "code", + dedicatedAvailabilityZoneId: { + serializedName: "dedicatedAvailabilityZoneId", type: { name: "String" } }, - message: { - serializedName: "message", + dedicatedAvailabilityZoneName: { + serializedName: "dedicatedAvailabilityZoneName", + type: { + name: "String" + } + }, + dedicatedPlacementGroupId: { + serializedName: "dedicatedPlacementGroupId", + type: { + name: "String" + } + }, + dedicatedPlacementGroupName: { + serializedName: "dedicatedPlacementGroupName", + type: { + name: "String" + } + }, + limit: { + serializedName: "limit", + required: true, + type: { + name: "Number" + } + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + skuId: { + serializedName: "skuId", + type: { + name: "String" + } + }, + skuName: { + serializedName: "skuName", type: { name: "String" } @@ -540,15 +652,14 @@ export const OperationError: msRest.CompositeMapper = { } }; -export const OperationResource: msRest.CompositeMapper = { - serializedName: "OperationResource", +export const OperationResource: coreClient.CompositeMapper = { type: { name: "Composite", className: "OperationResource", modelProperties: { endTime: { - readOnly: true, serializedName: "endTime", + readOnly: true, type: { name: "DateTime" } @@ -561,29 +672,29 @@ export const OperationResource: msRest.CompositeMapper = { } }, id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, startTime: { - readOnly: true, serializedName: "startTime", + readOnly: true, type: { name: "DateTime" } }, status: { - readOnly: true, serializedName: "status", + readOnly: true, type: { name: "String" } @@ -592,19 +703,46 @@ export const OperationResource: msRest.CompositeMapper = { } }; -export const PatchPayload: msRest.CompositeMapper = { - serializedName: "PatchPayload", +export const OperationError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PatchPayload", + className: "OperationError", modelProperties: { - tags: { - serializedName: "tags", + code: { + serializedName: "code", type: { - name: "Dictionary", - value: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateCloudList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateCloudList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "PrivateCloud" } } } @@ -613,258 +751,251 @@ export const PatchPayload: msRest.CompositeMapper = { } }; -export const ResourcePool: msRest.CompositeMapper = { - serializedName: "ResourcePool", +export const PrivateCloud: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourcePool", + className: "PrivateCloud", modelProperties: { id: { - required: true, serializedName: "id", type: { name: "String" } }, location: { - readOnly: true, serializedName: "location", type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", type: { name: "String" } }, - privateCloudId: { - readOnly: true, - serializedName: "privateCloudId", + type: { + defaultValue: "Microsoft.VMwareCloudSimple/privateClouds", + isConstant: true, + serializedName: "type", type: { name: "String" } }, - fullName: { - readOnly: true, - serializedName: "properties.fullName", + availabilityZoneId: { + serializedName: "properties.availabilityZoneId", type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + availabilityZoneName: { + serializedName: "properties.availabilityZoneName", type: { name: "String" } - } - } - } -}; - -export const VirtualDiskController: msRest.CompositeMapper = { - serializedName: "VirtualDiskController", - type: { - name: "Composite", - className: "VirtualDiskController", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", + }, + clustersNumber: { + serializedName: "properties.clustersNumber", + type: { + name: "Number" + } + }, + createdBy: { + serializedName: "properties.createdBy", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + createdOn: { + serializedName: "properties.createdOn", + type: { + name: "DateTime" + } + }, + dnsServers: { + serializedName: "properties.dnsServers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + expires: { + serializedName: "properties.expires", type: { name: "String" } }, - subType: { - readOnly: true, - serializedName: "subType", + nsxType: { + serializedName: "properties.nsxType", type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + placementGroupId: { + serializedName: "properties.placementGroupId", type: { name: "String" } - } - } - } -}; - -export const VirtualDisk: msRest.CompositeMapper = { - serializedName: "VirtualDisk", - type: { - name: "Composite", - className: "VirtualDisk", - modelProperties: { - controllerId: { - required: true, - serializedName: "controllerId", + }, + placementGroupName: { + serializedName: "properties.placementGroupName", type: { name: "String" } }, - independenceMode: { - required: true, - serializedName: "independenceMode", + privateCloudId: { + serializedName: "properties.privateCloudId", type: { - name: "Enum", - allowedValues: [ - "persistent", - "independent_persistent", - "independent_nonpersistent" - ] + name: "Uuid" } }, - totalSize: { - required: true, - serializedName: "totalSize", + resourcePools: { + serializedName: "properties.resourcePools", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourcePool" + } + } } }, - virtualDiskId: { - serializedName: "virtualDiskId", + state: { + serializedName: "properties.state", type: { name: "String" } }, - virtualDiskName: { - readOnly: true, - serializedName: "virtualDiskName", + totalCpuCores: { + serializedName: "properties.totalCpuCores", type: { - name: "String" + name: "Number" } - } - } - } -}; - -export const VirtualNetwork: msRest.CompositeMapper = { - serializedName: "VirtualNetwork", - type: { - name: "Composite", - className: "VirtualNetwork", - modelProperties: { - assignable: { - readOnly: true, - serializedName: "assignable", + }, + totalNodes: { + serializedName: "properties.totalNodes", type: { - name: "Boolean" + name: "Number" } }, - id: { - required: true, - serializedName: "id", + totalRam: { + serializedName: "properties.totalRam", type: { - name: "String" + name: "Number" } }, - location: { - readOnly: true, - serializedName: "location", + totalStorage: { + serializedName: "properties.totalStorage", + type: { + name: "Number" + } + }, + typePropertiesType: { + serializedName: "properties.type", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + vSphereVersion: { + serializedName: "properties.vSphereVersion", type: { name: "String" } }, - privateCloudId: { - readOnly: true, - serializedName: "properties.privateCloudId", + vcenterFqdn: { + serializedName: "properties.vcenterFqdn", type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + vcenterRefid: { + serializedName: "properties.vcenterRefid", type: { name: "String" } - } - } - } -}; - -export const VirtualNic: msRest.CompositeMapper = { - serializedName: "VirtualNic", - type: { - name: "Composite", - className: "VirtualNic", - modelProperties: { - ipAddresses: { - serializedName: "ipAddresses", + }, + virtualMachineTemplates: { + serializedName: "properties.virtualMachineTemplates", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "VirtualMachineTemplate" } } } }, - macAddress: { - serializedName: "macAddress", + virtualNetworks: { + serializedName: "properties.virtualNetworks", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetwork" + } + } } }, - network: { + vrOpsEnabled: { + serializedName: "properties.vrOpsEnabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ResourcePool: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourcePool", + modelProperties: { + id: { + serializedName: "id", required: true, - serializedName: "network", type: { - name: "Composite", - className: "VirtualNetwork" + name: "String" } }, - nicType: { - required: true, - serializedName: "nicType", + location: { + serializedName: "location", + readOnly: true, type: { - name: "Enum", - allowedValues: [ - "E1000", - "E1000E", - "PCNET32", - "VMXNET", - "VMXNET2", - "VMXNET3" - ] + name: "String" } }, - powerOnBoot: { - serializedName: "powerOnBoot", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - virtualNicId: { - serializedName: "virtualNicId", + privateCloudId: { + serializedName: "privateCloudId", + readOnly: true, type: { name: "String" } }, - virtualNicName: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + fullName: { + serializedName: "properties.fullName", readOnly: true, - serializedName: "virtualNicName", type: { name: "String" } @@ -873,15 +1004,14 @@ export const VirtualNic: msRest.CompositeMapper = { } }; -export const VirtualMachineTemplate: msRest.CompositeMapper = { - serializedName: "VirtualMachineTemplate", +export const VirtualMachineTemplate: coreClient.CompositeMapper = { type: { name: "Composite", className: "VirtualMachineTemplate", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } @@ -893,8 +1023,15 @@ export const VirtualMachineTemplate: msRest.CompositeMapper = { } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } @@ -942,15 +1079,15 @@ export const VirtualMachineTemplate: msRest.CompositeMapper = { } }, guestOS: { - readOnly: true, serializedName: "properties.guestOS", + readOnly: true, type: { name: "String" } }, guestOSType: { - readOnly: true, serializedName: "properties.guestOSType", + readOnly: true, type: { name: "String" } @@ -980,7 +1117,6 @@ export const VirtualMachineTemplate: msRest.CompositeMapper = { } }, privateCloudId: { - required: true, serializedName: "properties.privateCloudId", type: { name: "String" @@ -1009,15 +1145,8 @@ export const VirtualMachineTemplate: msRest.CompositeMapper = { } }, vmwaretools: { - readOnly: true, serializedName: "properties.vmwaretools", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", + readOnly: true, type: { name: "String" } @@ -1026,309 +1155,708 @@ export const VirtualMachineTemplate: msRest.CompositeMapper = { } }; -export const PrivateCloud: msRest.CompositeMapper = { - serializedName: "PrivateCloud", +export const VirtualDiskController: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateCloud", + className: "VirtualDiskController", modelProperties: { id: { serializedName: "id", + readOnly: true, type: { name: "String" } }, - location: { - serializedName: "location", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - name: { - serializedName: "name", + subType: { + serializedName: "subType", + readOnly: true, type: { name: "String" } }, - availabilityZoneId: { - serializedName: "properties.availabilityZoneId", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } - }, - availabilityZoneName: { - serializedName: "properties.availabilityZoneName", + } + } + } +}; + +export const VirtualDisk: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualDisk", + modelProperties: { + controllerId: { + serializedName: "controllerId", + required: true, type: { name: "String" } }, - clustersNumber: { - serializedName: "properties.clustersNumber", + independenceMode: { + serializedName: "independenceMode", + required: true, + type: { + name: "Enum", + allowedValues: [ + "persistent", + "independent_persistent", + "independent_nonpersistent" + ] + } + }, + totalSize: { + serializedName: "totalSize", + required: true, type: { name: "Number" } }, - createdBy: { - serializedName: "properties.createdBy", + virtualDiskId: { + serializedName: "virtualDiskId", type: { name: "String" } }, - createdOn: { - serializedName: "properties.createdOn", + virtualDiskName: { + serializedName: "virtualDiskName", + readOnly: true, type: { - name: "DateTime" + name: "String" + } + } + } + } +}; + +export const VirtualNic: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNic", + modelProperties: { + customization: { + serializedName: "customization", + type: { + name: "Composite", + className: "GuestOsnicCustomization" + } + }, + ipAddresses: { + serializedName: "ipAddresses", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + macAddress: { + serializedName: "macAddress", + type: { + name: "String" + } + }, + network: { + serializedName: "network", + type: { + name: "Composite", + className: "VirtualNetwork" + } + }, + nicType: { + serializedName: "nicType", + required: true, + type: { + name: "Enum", + allowedValues: [ + "E1000", + "E1000E", + "PCNET32", + "VMXNET", + "VMXNET2", + "VMXNET3" + ] + } + }, + powerOnBoot: { + serializedName: "powerOnBoot", + type: { + name: "Boolean" + } + }, + virtualNicId: { + serializedName: "virtualNicId", + type: { + name: "String" + } + }, + virtualNicName: { + serializedName: "virtualNicName", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const GuestOsnicCustomization: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GuestOsnicCustomization", + modelProperties: { + allocation: { + serializedName: "allocation", + type: { + name: "String" } }, dnsServers: { - serializedName: "properties.dnsServers", + serializedName: "dnsServers", type: { name: "Sequence", element: { + constraints: { + Pattern: new RegExp( + "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])[.]){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" + ) + }, type: { name: "String" } } } }, - expires: { - serializedName: "properties.expires", + gateway: { + serializedName: "gateway", + type: { + name: "Sequence", + element: { + constraints: { + Pattern: new RegExp( + "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])[.]){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" + ) + }, + type: { + name: "String" + } + } + } + }, + ipAddress: { + constraints: { + Pattern: new RegExp( + "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])[.]){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" + ) + }, + serializedName: "ipAddress", type: { name: "String" } }, - nsxType: { - serializedName: "properties.nsxType", + mask: { + constraints: { + Pattern: new RegExp( + "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])[.]){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" + ) + }, + serializedName: "mask", type: { name: "String" } }, - placementGroupId: { - serializedName: "properties.placementGroupId", + primaryWinsServer: { + constraints: { + Pattern: new RegExp( + "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])[.]){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" + ) + }, + serializedName: "primaryWinsServer", type: { name: "String" } }, - placementGroupName: { - serializedName: "properties.placementGroupName", + secondaryWinsServer: { + constraints: { + Pattern: new RegExp( + "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])[.]){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" + ) + }, + serializedName: "secondaryWinsServer", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetwork: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetwork", + modelProperties: { + assignable: { + serializedName: "assignable", + readOnly: true, + type: { + name: "Boolean" + } + }, + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, privateCloudId: { serializedName: "properties.privateCloudId", + readOnly: true, type: { - name: "Uuid" + name: "String" + } + } + } + } +}; + +export const CustomizationPoliciesListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomizationPoliciesListResponse", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" } }, - resourcePools: { - serializedName: "properties.resourcePools", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ResourcePool" + className: "CustomizationPolicy" } } } + } + } + } +}; + +export const CustomizationPolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomizationPolicy", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } }, - state: { - serializedName: "properties.state", + location: { + serializedName: "location", type: { name: "String" } }, - totalCpuCores: { - serializedName: "properties.totalCpuCores", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Number" + name: "String" } }, - totalNodes: { - serializedName: "properties.totalNodes", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Number" + name: "String" } }, - totalRam: { - serializedName: "properties.totalRam", + description: { + serializedName: "properties.description", type: { - name: "Number" + name: "String" } }, - totalStorage: { - serializedName: "properties.totalStorage", + privateCloudId: { + serializedName: "properties.privateCloudId", type: { - name: "Number" + name: "String" } }, - privateCloudPropertiesType: { + specification: { + serializedName: "properties.specification", + type: { + name: "Composite", + className: "CustomizationSpecification" + } + }, + typePropertiesType: { serializedName: "properties.type", type: { name: "String" } }, - vSphereVersion: { - serializedName: "properties.vSphereVersion", + version: { + serializedName: "properties.version", + type: { + name: "String" + } + } + } + } +}; + +export const CustomizationSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomizationSpecification", + modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "CustomizationIdentity" + } + }, + nicSettings: { + serializedName: "nicSettings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomizationNicSetting" + } + } + } + } + } + } +}; + +export const CustomizationIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomizationIdentity", + modelProperties: { + data: { + serializedName: "data", type: { name: "String" } }, - vcenterFqdn: { - serializedName: "properties.vcenterFqdn", + hostName: { + serializedName: "hostName", + type: { + name: "Composite", + className: "CustomizationHostName" + } + }, + type: { + serializedName: "type", type: { name: "String" } }, - vcenterRefid: { - serializedName: "properties.vcenterRefid", + userData: { + serializedName: "userData", + type: { + name: "Composite", + className: "CustomizationIdentityUserData" + } + } + } + } +}; + +export const CustomizationHostName: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomizationHostName", + modelProperties: { + name: { + serializedName: "name", type: { name: "String" } }, - virtualMachineTemplates: { - serializedName: "properties.virtualMachineTemplates", + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const CustomizationIdentityUserData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomizationIdentityUserData", + modelProperties: { + isPasswordPredefined: { + defaultValue: false, + serializedName: "isPasswordPredefined", + type: { + name: "Boolean" + } + } + } + } +}; + +export const CustomizationNicSetting: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomizationNicSetting", + modelProperties: { + adapter: { + serializedName: "adapter", + type: { + name: "Composite", + className: "CustomizationIPSettings" + } + }, + macAddress: { + serializedName: "macAddress", + type: { + name: "String" + } + } + } + } +}; + +export const CustomizationIPSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomizationIPSettings", + modelProperties: { + gateway: { + serializedName: "gateway", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + ip: { + serializedName: "ip", + type: { + name: "Composite", + className: "CustomizationIPAddress" + } + }, + subnetMask: { + serializedName: "subnetMask", + type: { + name: "String" + } + } + } + } +}; + +export const CustomizationIPAddress: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomizationIPAddress", + modelProperties: { + argument: { + serializedName: "argument", + type: { + name: "String" + } + }, + ipAddress: { + serializedName: "ipAddress", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ResourcePoolsListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourcePoolsListResponse", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "VirtualMachineTemplate" + className: "ResourcePool" } } } + } + } + } +}; + +export const VirtualMachineTemplateListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachineTemplateListResponse", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } }, - virtualNetworks: { - serializedName: "properties.virtualNetworks", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "VirtualNetwork" + className: "VirtualMachineTemplate" } } } - }, - vrOpsEnabled: { - serializedName: "properties.vrOpsEnabled", - type: { - name: "Boolean" - } - }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: [ - "Microsoft.VMwareCloudSimple/privateClouds" - ] - } } } } }; -export const SkuAvailability: msRest.CompositeMapper = { - serializedName: "SkuAvailability", +export const VirtualNetworkListResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SkuAvailability", + className: "VirtualNetworkListResponse", modelProperties: { - dedicatedAvailabilityZoneId: { - serializedName: "dedicatedAvailabilityZoneId", - type: { - name: "String" - } - }, - dedicatedAvailabilityZoneName: { - serializedName: "dedicatedAvailabilityZoneName", - type: { - name: "String" - } - }, - dedicatedPlacementGroupId: { - serializedName: "dedicatedPlacementGroupId", - type: { - name: "String" - } - }, - dedicatedPlacementGroupName: { - serializedName: "dedicatedPlacementGroupName", - type: { - name: "String" - } - }, - limit: { - required: true, - serializedName: "limit", - type: { - name: "Number" - } - }, - resourceType: { - serializedName: "resourceType", - type: { - name: "String" - } - }, - skuId: { - serializedName: "skuId", + nextLink: { + serializedName: "nextLink", type: { name: "String" } }, - skuName: { - serializedName: "skuName", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetwork" + } + } } } } } }; -export const UsageName: msRest.CompositeMapper = { - serializedName: "UsageName", +export const UsageListResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UsageName", + className: "UsageListResponse", modelProperties: { - localizedValue: { - serializedName: "localizedValue", + nextLink: { + serializedName: "nextLink", type: { name: "String" } }, value: { serializedName: "value", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Usage" + } + } } } } } }; -export const Usage: msRest.CompositeMapper = { - serializedName: "Usage", +export const Usage: coreClient.CompositeMapper = { type: { name: "Composite", className: "Usage", modelProperties: { currentValue: { - required: true, - serializedName: "currentValue", defaultValue: 0, + serializedName: "currentValue", + required: true, type: { name: "Number" } }, limit: { - required: true, - serializedName: "limit", defaultValue: 0, + serializedName: "limit", + required: true, type: { name: "Number" } @@ -1358,46 +1886,106 @@ export const Usage: msRest.CompositeMapper = { } }; -export const VirtualMachine: msRest.CompositeMapper = { - serializedName: "VirtualMachine", +export const UsageName: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UsageName", + modelProperties: { + localizedValue: { + serializedName: "localizedValue", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachineListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachineListResponse", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualMachine" + } + } + } + } + } + } +}; + +export const VirtualMachine: coreClient.CompositeMapper = { type: { name: "Composite", className: "VirtualMachine", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, location: { - required: true, serializedName: "location", + required: true, type: { name: "String" } }, name: { - readOnly: true, - serializedName: "name", constraints: { - Pattern: /^[-a-zA-Z0-9]+$/ + Pattern: new RegExp("^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$") }, + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, amountOfRam: { - required: true, serializedName: "properties.amountOfRam", type: { name: "Number" } }, controllers: { - readOnly: true, serializedName: "properties.controllers", + readOnly: true, type: { name: "Sequence", element: { @@ -1408,6 +1996,13 @@ export const VirtualMachine: msRest.CompositeMapper = { } } }, + customization: { + serializedName: "properties.customization", + type: { + name: "Composite", + className: "GuestOSCustomization" + } + }, disks: { serializedName: "properties.disks", type: { @@ -1421,8 +2016,8 @@ export const VirtualMachine: msRest.CompositeMapper = { } }, dnsname: { - readOnly: true, serializedName: "properties.dnsname", + readOnly: true, type: { name: "String" } @@ -1434,29 +2029,25 @@ export const VirtualMachine: msRest.CompositeMapper = { } }, folder: { - readOnly: true, serializedName: "properties.folder", + readOnly: true, type: { name: "String" } }, guestOS: { - readOnly: true, serializedName: "properties.guestOS", + readOnly: true, type: { name: "String" } }, guestOSType: { - readOnly: true, serializedName: "properties.guestOSType", + readOnly: true, type: { name: "Enum", - allowedValues: [ - "linux", - "windows", - "other" - ] + allowedValues: ["linux", "windows", "other"] } }, nics: { @@ -1472,7 +2063,6 @@ export const VirtualMachine: msRest.CompositeMapper = { } }, numberOfCores: { - required: true, serializedName: "properties.numberOfCores", type: { name: "Number" @@ -1485,22 +2075,21 @@ export const VirtualMachine: msRest.CompositeMapper = { } }, privateCloudId: { - required: true, serializedName: "properties.privateCloudId", type: { name: "String" } }, provisioningState: { - readOnly: true, serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } }, publicIP: { - readOnly: true, serializedName: "properties.publicIP", + readOnly: true, type: { name: "String" } @@ -1513,8 +2102,8 @@ export const VirtualMachine: msRest.CompositeMapper = { } }, status: { - readOnly: true, serializedName: "properties.status", + readOnly: true, type: { name: "Enum", allowedValues: [ @@ -1551,33 +2140,15 @@ export const VirtualMachine: msRest.CompositeMapper = { } }, vmId: { - readOnly: true, serializedName: "properties.vmId", + readOnly: true, type: { name: "String" } }, vmwaretools: { - readOnly: true, serializedName: "properties.vmwaretools", - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - type: { readOnly: true, - serializedName: "type", type: { name: "String" } @@ -1586,92 +2157,47 @@ export const VirtualMachine: msRest.CompositeMapper = { } }; -export const VirtualMachineStopMode: msRest.CompositeMapper = { - serializedName: "VirtualMachineStopMode", - type: { - name: "Composite", - className: "VirtualMachineStopMode", - modelProperties: { - mode: { - serializedName: "mode", - type: { - name: "Enum", - allowedValues: [ - "reboot", - "suspend", - "shutdown", - "poweroff" - ] - } - } - } - } -}; - -export const OperationsGetHeaders: msRest.CompositeMapper = { - serializedName: "operations-get-headers", +export const GuestOSCustomization: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationsGetHeaders", + className: "GuestOSCustomization", modelProperties: { - location: { - serializedName: "location", - type: { - name: "String" - } - }, - retryAfter: { - serializedName: "retry-after", + dnsServers: { + serializedName: "dnsServers", type: { - name: "Number" + name: "Sequence", + element: { + constraints: { + Pattern: new RegExp( + "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])[.]){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" + ) + }, + type: { + name: "String" + } + } } }, - contentType: { - serializedName: "content-type", - type: { - name: "String" - } - } - } - } -}; - -export const DedicatedCloudNodesCreateOrUpdateHeaders: msRest.CompositeMapper = { - serializedName: "dedicatedcloudnodes-createorupdate-headers", - type: { - name: "Composite", - className: "DedicatedCloudNodesCreateOrUpdateHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", + hostName: { + serializedName: "hostName", type: { name: "String" } }, - locationHeader: { - serializedName: "location", + password: { + serializedName: "password", type: { name: "String" } }, - retryAfter: { - serializedName: "retry-after", + policyId: { + serializedName: "policyId", type: { - name: "Number" + name: "String" } - } - } - } -}; - -export const DedicatedCloudNodesDeleteHeaders: msRest.CompositeMapper = { - serializedName: "dedicatedcloudnodes-delete-headers", - type: { - name: "Composite", - className: "DedicatedCloudNodesDeleteHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", + }, + username: { + serializedName: "username", type: { name: "String" } @@ -1680,50 +2206,43 @@ export const DedicatedCloudNodesDeleteHeaders: msRest.CompositeMapper = { } }; -export const DedicatedCloudServicesDeleteHeaders: msRest.CompositeMapper = { - serializedName: "dedicatedcloudservices-delete-headers", +export const PatchPayload: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedCloudServicesDeleteHeaders", + className: "PatchPayload", modelProperties: { - contentType: { - serializedName: "content-type", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const VirtualMachinesCreateOrUpdateHeaders: msRest.CompositeMapper = { - serializedName: "virtualmachines-createorupdate-headers", +export const VirtualMachineStopMode: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VirtualMachinesCreateOrUpdateHeaders", + className: "VirtualMachineStopMode", modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", + mode: { + serializedName: "mode", type: { - name: "String" + name: "Enum", + allowedValues: ["reboot", "suspend", "shutdown", "poweroff"] } } } } }; -export const VirtualMachinesDeleteHeaders: msRest.CompositeMapper = { - serializedName: "virtualmachines-delete-headers", +export const OperationsGetHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VirtualMachinesDeleteHeaders", + className: "OperationsGetHeaders", modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String" - } - }, location: { serializedName: "location", type: { @@ -1735,42 +2254,18 @@ export const VirtualMachinesDeleteHeaders: msRest.CompositeMapper = { type: { name: "Number" } - }, - contentType: { - serializedName: "content-type", - type: { - name: "String" - } } } } }; -export const VirtualMachinesStartHeaders: msRest.CompositeMapper = { - serializedName: "virtualmachines-start-headers", +export const OperationsGetExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VirtualMachinesStartHeaders", + className: "OperationsGetExceptionHeaders", modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number" - } - }, contentType: { + defaultValue: "application/json", serializedName: "content-type", type: { name: "String" @@ -1780,11 +2275,10 @@ export const VirtualMachinesStartHeaders: msRest.CompositeMapper = { } }; -export const VirtualMachinesStopHeaders: msRest.CompositeMapper = { - serializedName: "virtualmachines-stop-headers", +export const DedicatedCloudNodesCreateOrUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VirtualMachinesStopHeaders", + className: "DedicatedCloudNodesCreateOrUpdateHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -1803,293 +2297,182 @@ export const VirtualMachinesStopHeaders: msRest.CompositeMapper = { type: { name: "Number" } - }, - contentType: { - serializedName: "content-type", - type: { - name: "String" - } } } } }; -export const AvailableOperationsListResponse: msRest.CompositeMapper = { - serializedName: "AvailableOperationsListResponse", +export const DedicatedCloudNodesDeleteExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailableOperationsListResponse", + className: "DedicatedCloudNodesDeleteExceptionHeaders", modelProperties: { - nextLink: { - serializedName: "nextLink", + contentType: { + defaultValue: "application/json", + serializedName: "content-type", type: { name: "String" } - }, - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AvailableOperation" - } - } - } } } } }; -export const DedicatedCloudNodeListResponse: msRest.CompositeMapper = { - serializedName: "DedicatedCloudNodeListResponse", +export const DedicatedCloudServicesDeleteExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedCloudNodeListResponse", + className: "DedicatedCloudServicesDeleteExceptionHeaders", modelProperties: { - nextLink: { - serializedName: "nextLink", + contentType: { + defaultValue: "application/json", + serializedName: "content-type", type: { name: "String" } - }, - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DedicatedCloudNode" - } - } - } } } } }; -export const DedicatedCloudServiceListResponse: msRest.CompositeMapper = { - serializedName: "DedicatedCloudServiceListResponse", +export const VirtualMachinesCreateOrUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedCloudServiceListResponse", + className: "VirtualMachinesCreateOrUpdateHeaders", modelProperties: { - nextLink: { - serializedName: "nextLink", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { name: "String" } - }, - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DedicatedCloudService" - } - } - } } } } }; -export const SkuAvailabilityListResponse: msRest.CompositeMapper = { - serializedName: "SkuAvailabilityListResponse", +export const VirtualMachinesDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SkuAvailabilityListResponse", + className: "VirtualMachinesDeleteHeaders", modelProperties: { - nextLink: { - serializedName: "nextLink", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { name: "String" } }, - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SkuAvailability" - } - } - } - } - } - } -}; - -export const PrivateCloudList: msRest.CompositeMapper = { - serializedName: "PrivateCloudList", - type: { - name: "Composite", - className: "PrivateCloudList", - modelProperties: { - nextLink: { - serializedName: "nextLink", + location: { + serializedName: "location", type: { name: "String" } }, - value: { - serializedName: "", + retryAfter: { + serializedName: "retry-after", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateCloud" - } - } + name: "Number" } } } } }; -export const ResourcePoolsListResponse: msRest.CompositeMapper = { - serializedName: "ResourcePoolsListResponse", +export const VirtualMachinesDeleteExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourcePoolsListResponse", + className: "VirtualMachinesDeleteExceptionHeaders", modelProperties: { - nextLink: { - serializedName: "nextLink", + contentType: { + defaultValue: "application/json", + serializedName: "content-type", type: { name: "String" } - }, - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourcePool" - } - } - } } } } }; -export const VirtualMachineTemplateListResponse: msRest.CompositeMapper = { - serializedName: "VirtualMachineTemplateListResponse", +export const VirtualMachinesStartHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VirtualMachineTemplateListResponse", + className: "VirtualMachinesStartHeaders", modelProperties: { - nextLink: { - serializedName: "nextLink", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { name: "String" } }, - value: { - serializedName: "", + location: { + serializedName: "location", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineTemplate" - } - } + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" } } } } }; -export const VirtualNetworkListResponse: msRest.CompositeMapper = { - serializedName: "VirtualNetworkListResponse", +export const VirtualMachinesStartExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VirtualNetworkListResponse", + className: "VirtualMachinesStartExceptionHeaders", modelProperties: { - nextLink: { - serializedName: "nextLink", + contentType: { + defaultValue: "application/json", + serializedName: "content-type", type: { name: "String" } - }, - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualNetwork" - } - } - } } } } }; -export const UsageListResponse: msRest.CompositeMapper = { - serializedName: "UsageListResponse", +export const VirtualMachinesStopHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UsageListResponse", + className: "VirtualMachinesStopHeaders", modelProperties: { - nextLink: { - serializedName: "nextLink", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { name: "String" } }, - value: { - readOnly: true, - serializedName: "", + location: { + serializedName: "location", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Usage" - } - } + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" } } } } }; -export const VirtualMachineListResponse: msRest.CompositeMapper = { - serializedName: "VirtualMachineListResponse", +export const VirtualMachinesStopExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VirtualMachineListResponse", + className: "VirtualMachinesStopExceptionHeaders", modelProperties: { - nextLink: { - serializedName: "nextLink", + contentType: { + defaultValue: "application/json", + serializedName: "content-type", type: { name: "String" } - }, - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachine" - } - } - } } } } diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/operationsMappers.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/operationsMappers.ts deleted file mode 100644 index 0c20c8a9c0a5..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/operationsMappers.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AvailableOperation, - AvailableOperationDisplay, - AvailableOperationDisplayPropertyServiceSpecificationMetricsItem, - AvailableOperationDisplayPropertyServiceSpecificationMetricsList, - AvailableOperationsListResponse, - CSRPError, - CSRPErrorBody, - OperationError, - OperationResource, - OperationsGetHeaders -} from "../models/mappers"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/parameters.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/parameters.ts index d81f0d06d134..1560632e46b9 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/parameters.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/parameters.ts @@ -1,189 +1,230 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + DedicatedCloudNode as DedicatedCloudNodeMapper, + PatchPayload as PatchPayloadMapper, + DedicatedCloudService as DedicatedCloudServiceMapper, + VirtualMachine as VirtualMachineMapper, + VirtualMachineStopMode as VirtualMachineStopModeMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "api-version", type: { name: "String" } - } + }, + skipEncoding: true }; -export const dedicatedCloudNodeName: msRest.OperationURLParameter = { - parameterPath: "dedicatedCloudNodeName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "dedicatedCloudNodeName", - constraints: { - Pattern: /^[-a-zA-Z0-9]+$/ - }, + defaultValue: "2019-04-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const dedicatedCloudServiceName0: msRest.OperationURLParameter = { - parameterPath: "dedicatedCloudServiceName", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "dedicatedCloudServiceName", type: { name: "String" } } }; -export const dedicatedCloudServiceName1: msRest.OperationURLParameter = { - parameterPath: "dedicatedCloudServiceName", + +export const regionId: OperationURLParameter = { + parameterPath: "regionId", mapper: { + serializedName: "regionId", required: true, - serializedName: "dedicatedCloudServiceName", - constraints: { - Pattern: /^[-a-zA-Z0-9]+$/ - }, type: { name: "String" } } }; -export const filter: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "filter" - ], + +export const referer: OperationParameter = { + parameterPath: "referer", mapper: { - serializedName: "$filter", + serializedName: "Referer", + required: true, type: { name: "String" } } }; -export const mode: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "mode" - ], + +export const operationId: OperationURLParameter = { + parameterPath: "operationId", mapper: { - serializedName: "mode", + serializedName: "operationId", + required: true, type: { - name: "Enum", - allowedValues: [ - "reboot", - "suspend", - "shutdown", - "poweroff" - ] + name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { - required: true, serializedName: "nextLink", + required: true, type: { name: "String" } }, skipEncoding: true }; -export const operationId: msRest.OperationURLParameter = { - parameterPath: "operationId", + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], mapper: { - required: true, - serializedName: "operationId", + serializedName: "$filter", type: { name: "String" } } }; -export const pcName: msRest.OperationURLParameter = { - parameterPath: "pcName", + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], mapper: { - required: true, - serializedName: "pcName", + serializedName: "$top", + type: { + name: "Number" + } + } +}; + +export const skipToken: OperationQueryParameter = { + parameterPath: ["options", "skipToken"], + mapper: { + serializedName: "$skipToken", type: { name: "String" } } }; -export const referer: msRest.OperationParameter = { - parameterPath: "referer", + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + serializedName: "resourceGroupName", required: true, - serializedName: "Referer", type: { name: "String" } } }; -export const regionId: msRest.OperationURLParameter = { - parameterPath: "regionId", + +export const dedicatedCloudNodeName: OperationURLParameter = { + parameterPath: "dedicatedCloudNodeName", mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$") + }, + serializedName: "dedicatedCloudNodeName", required: true, - serializedName: "regionId", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "resourceGroupName", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const resourcePoolName: msRest.OperationURLParameter = { - parameterPath: "resourcePoolName", + +export const dedicatedCloudNodeRequest: OperationParameter = { + parameterPath: "dedicatedCloudNodeRequest", + mapper: DedicatedCloudNodeMapper +}; + +export const dedicatedCloudNodeRequest1: OperationParameter = { + parameterPath: "dedicatedCloudNodeRequest", + mapper: PatchPayloadMapper +}; + +export const dedicatedCloudServiceName: OperationURLParameter = { + parameterPath: "dedicatedCloudServiceName", mapper: { + serializedName: "dedicatedCloudServiceName", required: true, - serializedName: "resourcePoolName", type: { name: "String" } } }; -export const skipToken: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "skipToken" - ], + +export const dedicatedCloudServiceRequest: OperationParameter = { + parameterPath: "dedicatedCloudServiceRequest", + mapper: DedicatedCloudServiceMapper +}; + +export const dedicatedCloudServiceName1: OperationURLParameter = { + parameterPath: "dedicatedCloudServiceName", mapper: { - serializedName: "$skipToken", + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$") + }, + serializedName: "dedicatedCloudServiceName", + required: true, type: { name: "String" } } }; -export const skuId: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "skuId" - ], + +export const dedicatedCloudServiceRequest1: OperationParameter = { + parameterPath: "dedicatedCloudServiceRequest", + mapper: PatchPayloadMapper +}; + +export const skuId: OperationQueryParameter = { + parameterPath: ["options", "skuId"], mapper: { serializedName: "skuId", type: { @@ -191,68 +232,120 @@ export const skuId: msRest.OperationQueryParameter = { } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const pcName: OperationURLParameter = { + parameterPath: "pcName", mapper: { + serializedName: "pcName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; -export const top: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "top" - ], + +export const customizationPolicyName: OperationURLParameter = { + parameterPath: "customizationPolicyName", mapper: { - serializedName: "$top", + serializedName: "customizationPolicyName", + required: true, type: { - name: "Number" + name: "String" } } }; -export const virtualMachineName0: msRest.OperationURLParameter = { - parameterPath: "virtualMachineName", + +export const resourcePoolName: OperationURLParameter = { + parameterPath: "resourcePoolName", mapper: { + serializedName: "resourcePoolName", required: true, - serializedName: "virtualMachineName", type: { name: "String" } } }; -export const virtualMachineName1: msRest.OperationURLParameter = { - parameterPath: "virtualMachineName", + +export const resourcePoolName1: OperationQueryParameter = { + parameterPath: "resourcePoolName", mapper: { + serializedName: "resourcePoolName", required: true, - serializedName: "virtualMachineName", - constraints: { - Pattern: /^[-a-zA-Z0-9]+$/ - }, type: { name: "String" } } }; -export const virtualMachineTemplateName: msRest.OperationURLParameter = { + +export const virtualMachineTemplateName: OperationURLParameter = { parameterPath: "virtualMachineTemplateName", mapper: { - required: true, serializedName: "virtualMachineTemplateName", + required: true, type: { name: "String" } } }; -export const virtualNetworkName: msRest.OperationURLParameter = { + +export const virtualNetworkName: OperationURLParameter = { parameterPath: "virtualNetworkName", mapper: { - required: true, serializedName: "virtualNetworkName", + required: true, + type: { + name: "String" + } + } +}; + +export const virtualMachineName: OperationURLParameter = { + parameterPath: "virtualMachineName", + mapper: { + serializedName: "virtualMachineName", + required: true, + type: { + name: "String" + } + } +}; + +export const virtualMachineRequest: OperationParameter = { + parameterPath: "virtualMachineRequest", + mapper: VirtualMachineMapper +}; + +export const virtualMachineName1: OperationURLParameter = { + parameterPath: "virtualMachineName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$") + }, + serializedName: "virtualMachineName", + required: true, type: { name: "String" } } }; + +export const virtualMachineRequest1: OperationParameter = { + parameterPath: "virtualMachineRequest", + mapper: PatchPayloadMapper +}; + +export const m: OperationParameter = { + parameterPath: ["options", "m"], + mapper: VirtualMachineStopModeMapper +}; + +export const mode: OperationQueryParameter = { + parameterPath: ["options", "mode"], + mapper: { + serializedName: "mode", + type: { + name: "Enum", + allowedValues: ["reboot", "suspend", "shutdown", "poweroff"] + } + } +}; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/privateCloudsMappers.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/privateCloudsMappers.ts deleted file mode 100644 index b6b92e662c0b..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/privateCloudsMappers.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CSRPError, - CSRPErrorBody, - PrivateCloud, - PrivateCloudList, - ResourcePool, - VirtualDisk, - VirtualDiskController, - VirtualMachineTemplate, - VirtualNetwork, - VirtualNic -} from "../models/mappers"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/resourcePoolsMappers.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/resourcePoolsMappers.ts deleted file mode 100644 index 63e758768125..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/resourcePoolsMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CSRPError, - CSRPErrorBody, - ResourcePool, - ResourcePoolsListResponse -} from "../models/mappers"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/skusAvailabilityMappers.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/skusAvailabilityMappers.ts deleted file mode 100644 index e5fbf12b2915..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/skusAvailabilityMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CSRPError, - CSRPErrorBody, - SkuAvailability, - SkuAvailabilityListResponse -} from "../models/mappers"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/usagesMappers.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/usagesMappers.ts deleted file mode 100644 index b03697d4f6fb..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/usagesMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CSRPError, - CSRPErrorBody, - Usage, - UsageListResponse, - UsageName -} from "../models/mappers"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualMachineTemplatesMappers.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualMachineTemplatesMappers.ts deleted file mode 100644 index 73000267eb20..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualMachineTemplatesMappers.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CSRPError, - CSRPErrorBody, - VirtualDisk, - VirtualDiskController, - VirtualMachineTemplate, - VirtualMachineTemplateListResponse, - VirtualNetwork, - VirtualNic -} from "../models/mappers"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualMachinesMappers.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualMachinesMappers.ts deleted file mode 100644 index 02ff89614a14..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualMachinesMappers.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CSRPError, - CSRPErrorBody, - DedicatedCloudNode, - DedicatedCloudService, - PatchPayload, - ResourcePool, - Sku, - VirtualDisk, - VirtualDiskController, - VirtualMachine, - VirtualMachineListResponse, - VirtualMachinesCreateOrUpdateHeaders, - VirtualMachinesDeleteHeaders, - VirtualMachinesStartHeaders, - VirtualMachinesStopHeaders, - VirtualMachineStopMode, - VirtualNetwork, - VirtualNic -} from "../models/mappers"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualNetworksMappers.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualNetworksMappers.ts deleted file mode 100644 index de6b058f1c19..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/models/virtualNetworksMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CSRPError, - CSRPErrorBody, - VirtualNetwork, - VirtualNetworkListResponse -} from "../models/mappers"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/customizationPolicies.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/customizationPolicies.ts new file mode 100644 index 000000000000..f5ebfb352eb5 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/customizationPolicies.ts @@ -0,0 +1,217 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { CustomizationPolicies } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { VMwareCloudSimple } from "../vMwareCloudSimple"; +import { + CustomizationPolicy, + CustomizationPoliciesListNextOptionalParams, + CustomizationPoliciesListOptionalParams, + CustomizationPoliciesListOperationResponse, + CustomizationPoliciesGetOptionalParams, + CustomizationPoliciesGetResponse, + CustomizationPoliciesListNextResponse +} from "../models"; + +/// +/** Class containing CustomizationPolicies operations. */ +export class CustomizationPoliciesImpl implements CustomizationPolicies { + private readonly client: VMwareCloudSimple; + + /** + * Initialize a new instance of the class CustomizationPolicies class. + * @param client Reference to the service client + */ + constructor(client: VMwareCloudSimple) { + this.client = client; + } + + /** + * Returns list of customization policies in region for private cloud + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param options The options parameters. + */ + public list( + regionId: string, + pcName: string, + options?: CustomizationPoliciesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(regionId, pcName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(regionId, pcName, options); + } + }; + } + + private async *listPagingPage( + regionId: string, + pcName: string, + options?: CustomizationPoliciesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(regionId, pcName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + regionId, + pcName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + regionId: string, + pcName: string, + options?: CustomizationPoliciesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(regionId, pcName, options)) { + yield* page; + } + } + + /** + * Returns list of customization policies in region for private cloud + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param options The options parameters. + */ + private _list( + regionId: string, + pcName: string, + options?: CustomizationPoliciesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { regionId, pcName, options }, + listOperationSpec + ); + } + + /** + * Returns customization policy by its name + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param customizationPolicyName customization policy name + * @param options The options parameters. + */ + get( + regionId: string, + pcName: string, + customizationPolicyName: string, + options?: CustomizationPoliciesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { regionId, pcName, customizationPolicyName, options }, + getOperationSpec + ); + } + + /** + * ListNext + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + regionId: string, + pcName: string, + nextLink: string, + options?: CustomizationPoliciesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { regionId, pcName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/customizationPolicies", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomizationPoliciesListResponse + }, + default: { + bodyMapper: Mappers.CsrpError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.pcName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/customizationPolicies/{customizationPolicyName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomizationPolicy + }, + default: { + bodyMapper: Mappers.CsrpError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.pcName, + Parameters.customizationPolicyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomizationPoliciesListResponse + }, + default: { + bodyMapper: Mappers.CsrpError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.nextLink, + Parameters.pcName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/dedicatedCloudNodes.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/dedicatedCloudNodes.ts index 15c5a99b4b5c..bd914b064289 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/dedicatedCloudNodes.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/dedicatedCloudNodes.ts @@ -1,493 +1,567 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/dedicatedCloudNodesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { DedicatedCloudNodes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VMwareCloudSimpleClientContext } from "../vMwareCloudSimpleClientContext"; +import { VMwareCloudSimple } from "../vMwareCloudSimple"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DedicatedCloudNode, + DedicatedCloudNodesListBySubscriptionNextOptionalParams, + DedicatedCloudNodesListBySubscriptionOptionalParams, + DedicatedCloudNodesListByResourceGroupNextOptionalParams, + DedicatedCloudNodesListByResourceGroupOptionalParams, + DedicatedCloudNodesListBySubscriptionResponse, + DedicatedCloudNodesListByResourceGroupResponse, + DedicatedCloudNodesGetOptionalParams, + DedicatedCloudNodesGetResponse, + DedicatedCloudNodesCreateOrUpdateOptionalParams, + DedicatedCloudNodesCreateOrUpdateResponse, + DedicatedCloudNodesDeleteOptionalParams, + PatchPayload, + DedicatedCloudNodesUpdateOptionalParams, + DedicatedCloudNodesUpdateResponse, + DedicatedCloudNodesListBySubscriptionNextResponse, + DedicatedCloudNodesListByResourceGroupNextResponse +} from "../models"; -/** Class representing a DedicatedCloudNodes. */ -export class DedicatedCloudNodes { - private readonly client: VMwareCloudSimpleClientContext; +/// +/** Class containing DedicatedCloudNodes operations. */ +export class DedicatedCloudNodesImpl implements DedicatedCloudNodes { + private readonly client: VMwareCloudSimple; /** - * Create a DedicatedCloudNodes. - * @param {VMwareCloudSimpleClientContext} client Reference to the service client. + * Initialize a new instance of the class DedicatedCloudNodes class. + * @param client Reference to the service client */ - constructor(client: VMwareCloudSimpleClientContext) { + constructor(client: VMwareCloudSimple) { this.client = client; } /** * Returns list of dedicate cloud nodes within subscription - * @summary Implements list of dedicated cloud nodes within subscription method - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listBySubscription(options?: Models.DedicatedCloudNodesListBySubscriptionOptionalParams): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listBySubscription(options: Models.DedicatedCloudNodesListBySubscriptionOptionalParams, callback: msRest.ServiceCallback): void; - listBySubscription(options?: Models.DedicatedCloudNodesListBySubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public listBySubscription( + options?: DedicatedCloudNodesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listBySubscriptionOperationSpec, - callback) as Promise; + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: DedicatedCloudNodesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: DedicatedCloudNodesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } } /** * Returns list of dedicate cloud nodes within resource group - * @summary Implements list of dedicated cloud nodes within RG method * @param resourceGroupName The name of the resource group - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: Models.DedicatedCloudNodesListByResourceGroupOptionalParams): Promise; + public listByResourceGroup( + resourceGroupName: string, + options?: DedicatedCloudNodesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: DedicatedCloudNodesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: DedicatedCloudNodesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group - * @param callback The callback + * Returns list of dedicate cloud nodes within subscription + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + private _listBySubscription( + options?: DedicatedCloudNodesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + /** + * Returns list of dedicate cloud nodes within resource group * @param resourceGroupName The name of the resource group - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: Models.DedicatedCloudNodesListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: Models.DedicatedCloudNodesListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: DedicatedCloudNodesListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** * Returns dedicated cloud node - * @summary Implements dedicated cloud node GET method * @param resourceGroupName The name of the resource group * @param dedicatedCloudNodeName dedicated cloud node name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, dedicatedCloudNodeName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group - * @param dedicatedCloudNodeName dedicated cloud node name - * @param callback The callback - */ - get(resourceGroupName: string, dedicatedCloudNodeName: string, callback: msRest.ServiceCallback): void; + get( + resourceGroupName: string, + dedicatedCloudNodeName: string, + options?: DedicatedCloudNodesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dedicatedCloudNodeName, options }, + getOperationSpec + ); + } + /** + * Returns dedicated cloud node by its name * @param resourceGroupName The name of the resource group * @param dedicatedCloudNodeName dedicated cloud node name - * @param options The optional parameters - * @param callback The callback + * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request + * @param options The options parameters. */ - get(resourceGroupName: string, dedicatedCloudNodeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, dedicatedCloudNodeName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + resourceGroupName: string, + dedicatedCloudNodeName: string, + dedicatedCloudNodeRequest: DedicatedCloudNode, + options?: DedicatedCloudNodesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DedicatedCloudNodesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { resourceGroupName, dedicatedCloudNodeName, + dedicatedCloudNodeRequest, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Returns dedicated cloud node by its name - * @summary Implements dedicated cloud node PUT method * @param resourceGroupName The name of the resource group * @param dedicatedCloudNodeName dedicated cloud node name * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, dedicatedCloudNodeName: string, dedicatedCloudNodeRequest: Models.DedicatedCloudNode, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,dedicatedCloudNodeName,dedicatedCloudNodeRequest,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + dedicatedCloudNodeName: string, + dedicatedCloudNodeRequest: DedicatedCloudNode, + options?: DedicatedCloudNodesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + dedicatedCloudNodeName, + dedicatedCloudNodeRequest, + options + ); + return poller.pollUntilDone(); } /** * Delete dedicated cloud node - * @summary Implements dedicated cloud node DELETE method - * @param resourceGroupName The name of the resource group - * @param dedicatedCloudNodeName dedicated cloud node name - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, dedicatedCloudNodeName: string, options?: msRest.RequestOptionsBase): Promise; - /** * @param resourceGroupName The name of the resource group * @param dedicatedCloudNodeName dedicated cloud node name - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, dedicatedCloudNodeName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group - * @param dedicatedCloudNodeName dedicated cloud node name - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, dedicatedCloudNodeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, dedicatedCloudNodeName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + dedicatedCloudNodeName: string, + options?: DedicatedCloudNodesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - dedicatedCloudNodeName, - options - }, - deleteMethodOperationSpec, - callback) as Promise; + { resourceGroupName, dedicatedCloudNodeName, options }, + deleteOperationSpec + ); } /** * Patches dedicated node properties - * @summary Implements dedicated cloud node PATCH method - * @param resourceGroupName The name of the resource group - * @param dedicatedCloudNodeName dedicated cloud node name - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, dedicatedCloudNodeName: string, options?: Models.DedicatedCloudNodesUpdateOptionalParams): Promise; - /** * @param resourceGroupName The name of the resource group * @param dedicatedCloudNodeName dedicated cloud node name - * @param callback The callback + * @param dedicatedCloudNodeRequest Patch Dedicated Cloud Node request + * @param options The options parameters. */ - update(resourceGroupName: string, dedicatedCloudNodeName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group - * @param dedicatedCloudNodeName dedicated cloud node name - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, dedicatedCloudNodeName: string, options: Models.DedicatedCloudNodesUpdateOptionalParams, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, dedicatedCloudNodeName: string, options?: Models.DedicatedCloudNodesUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + dedicatedCloudNodeName: string, + dedicatedCloudNodeRequest: PatchPayload, + options?: DedicatedCloudNodesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - dedicatedCloudNodeName, - options - }, - updateOperationSpec, - callback) as Promise; - } - - /** - * Returns dedicated cloud node by its name - * @summary Implements dedicated cloud node PUT method - * @param resourceGroupName The name of the resource group - * @param dedicatedCloudNodeName dedicated cloud node name - * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(resourceGroupName: string, dedicatedCloudNodeName: string, dedicatedCloudNodeRequest: Models.DedicatedCloudNode, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( { resourceGroupName, dedicatedCloudNodeName, dedicatedCloudNodeRequest, options }, - beginCreateOrUpdateOperationSpec, - options); + updateOperationSpec + ); } /** - * Returns list of dedicate cloud nodes within subscription - * @summary Implements list of dedicated cloud nodes within subscription method - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscriptionNext( + nextLink: string, + options?: DedicatedCloudNodesListBySubscriptionNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listBySubscriptionNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); } /** - * Returns list of dedicate cloud nodes within resource group - * @summary Implements list of dedicated cloud nodes within RG method - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DedicatedCloudNodesListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listBySubscriptionOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes", - urlParameters: [ - Parameters.subscriptionId - ], + responses: { + 200: { + bodyMapper: Mappers.DedicatedCloudNodeListResponse + }, + default: { + bodyMapper: Mappers.CsrpError + } + }, queryParameters: [ Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.skipToken ], - headerParameters: [ - Parameters.acceptLanguage - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DedicatedCloudNodeListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], queryParameters: [ Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.skipToken ], - headerParameters: [ - Parameters.acceptLanguage + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DedicatedCloudNodeListResponse + bodyMapper: Mappers.DedicatedCloudNode }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.dedicatedCloudNodeName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.DedicatedCloudNode + bodyMapper: Mappers.DedicatedCloudNode, + headersMapper: Mappers.DedicatedCloudNodesCreateOrUpdateHeaders + }, + 201: { + bodyMapper: Mappers.DedicatedCloudNode, + headersMapper: Mappers.DedicatedCloudNodesCreateOrUpdateHeaders + }, + 202: { + bodyMapper: Mappers.DedicatedCloudNode, + headersMapper: Mappers.DedicatedCloudNodesCreateOrUpdateHeaders + }, + 204: { + bodyMapper: Mappers.DedicatedCloudNode, + headersMapper: Mappers.DedicatedCloudNodesCreateOrUpdateHeaders }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}", + requestBody: Parameters.dedicatedCloudNodeRequest, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.dedicatedCloudNodeName ], - queryParameters: [ - Parameters.apiVersion - ], headerParameters: [ - Parameters.acceptLanguage + Parameters.accept, + Parameters.referer, + Parameters.contentType ], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}", + httpMethod: "DELETE", responses: { - 204: { - headersMapper: Mappers.DedicatedCloudNodesDeleteHeaders - }, + 204: {}, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError, + headersMapper: Mappers.DedicatedCloudNodesDeleteExceptionHeaders } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.dedicatedCloudNodeName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: { - tags: [ - "options", - "tags" - ] - }, - mapper: { - ...Mappers.PatchPayload, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.DedicatedCloudNode }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}", + requestBody: Parameters.dedicatedCloudNodeRequest1, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.dedicatedCloudNodeName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.referer, - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "dedicatedCloudNodeRequest", - mapper: { - ...Mappers.DedicatedCloudNode, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.DedicatedCloudNode, - headersMapper: Mappers.DedicatedCloudNodesCreateOrUpdateHeaders - }, - default: { - bodyMapper: Mappers.CSRPError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DedicatedCloudNodeListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DedicatedCloudNodeListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/dedicatedCloudServices.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/dedicatedCloudServices.ts index 2e78464b1d5e..85294301feca 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/dedicatedCloudServices.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/dedicatedCloudServices.ts @@ -1,145 +1,205 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/dedicatedCloudServicesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { DedicatedCloudServices } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VMwareCloudSimpleClientContext } from "../vMwareCloudSimpleClientContext"; +import { VMwareCloudSimple } from "../vMwareCloudSimple"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DedicatedCloudService, + DedicatedCloudServicesListBySubscriptionNextOptionalParams, + DedicatedCloudServicesListBySubscriptionOptionalParams, + DedicatedCloudServicesListByResourceGroupNextOptionalParams, + DedicatedCloudServicesListByResourceGroupOptionalParams, + DedicatedCloudServicesListBySubscriptionResponse, + DedicatedCloudServicesListByResourceGroupResponse, + DedicatedCloudServicesGetOptionalParams, + DedicatedCloudServicesGetResponse, + DedicatedCloudServicesCreateOrUpdateOptionalParams, + DedicatedCloudServicesCreateOrUpdateResponse, + DedicatedCloudServicesDeleteOptionalParams, + PatchPayload, + DedicatedCloudServicesUpdateOptionalParams, + DedicatedCloudServicesUpdateResponse, + DedicatedCloudServicesListBySubscriptionNextResponse, + DedicatedCloudServicesListByResourceGroupNextResponse +} from "../models"; -/** Class representing a DedicatedCloudServices. */ -export class DedicatedCloudServices { - private readonly client: VMwareCloudSimpleClientContext; +/// +/** Class containing DedicatedCloudServices operations. */ +export class DedicatedCloudServicesImpl implements DedicatedCloudServices { + private readonly client: VMwareCloudSimple; /** - * Create a DedicatedCloudServices. - * @param {VMwareCloudSimpleClientContext} client Reference to the service client. + * Initialize a new instance of the class DedicatedCloudServices class. + * @param client Reference to the service client */ - constructor(client: VMwareCloudSimpleClientContext) { + constructor(client: VMwareCloudSimple) { this.client = client; } /** * Returns list of dedicated cloud services within a subscription - * @summary Implements list of dedicatedCloudService objects within subscription method - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listBySubscription(options?: Models.DedicatedCloudServicesListBySubscriptionOptionalParams): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listBySubscription(options: Models.DedicatedCloudServicesListBySubscriptionOptionalParams, callback: msRest.ServiceCallback): void; - listBySubscription(options?: Models.DedicatedCloudServicesListBySubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public listBySubscription( + options?: DedicatedCloudServicesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); }, - listBySubscriptionOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: DedicatedCloudServicesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: DedicatedCloudServicesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } } /** * Returns list of dedicated cloud services within a resource group - * @summary Implements list of dedicatedCloudService objects within RG method * @param resourceGroupName The name of the resource group - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: Models.DedicatedCloudServicesListByResourceGroupOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: Models.DedicatedCloudServicesListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: Models.DedicatedCloudServicesListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByResourceGroup( + resourceGroupName: string, + options?: DedicatedCloudServicesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: DedicatedCloudServicesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, + continuationToken, options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: DedicatedCloudServicesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Returns Dedicate Cloud Service - * @summary Implements dedicatedCloudService GET method - * @param resourceGroupName The name of the resource group - * @param dedicatedCloudServiceName dedicated cloud Service name - * @param [options] The optional parameters - * @returns Promise + * Returns list of dedicated cloud services within a subscription + * @param options The options parameters. */ - get(resourceGroupName: string, dedicatedCloudServiceName: string, options?: msRest.RequestOptionsBase): Promise; + private _listBySubscription( + options?: DedicatedCloudServicesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + /** + * Returns list of dedicated cloud services within a resource group * @param resourceGroupName The name of the resource group - * @param dedicatedCloudServiceName dedicated cloud Service name - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, dedicatedCloudServiceName: string, callback: msRest.ServiceCallback): void; + private _listByResourceGroup( + resourceGroupName: string, + options?: DedicatedCloudServicesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + /** + * Returns Dedicate Cloud Service * @param resourceGroupName The name of the resource group * @param dedicatedCloudServiceName dedicated cloud Service name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, dedicatedCloudServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, dedicatedCloudServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + dedicatedCloudServiceName: string, + options?: DedicatedCloudServicesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - dedicatedCloudServiceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, dedicatedCloudServiceName, options }, + getOperationSpec + ); } /** * Create dedicate cloud service - * @summary Implements dedicated cloud service PUT method * @param resourceGroupName The name of the resource group * @param dedicatedCloudServiceName dedicated cloud Service name * @param dedicatedCloudServiceRequest Create Dedicated Cloud Service request - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, dedicatedCloudServiceName: string, dedicatedCloudServiceRequest: Models.DedicatedCloudService, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group - * @param dedicatedCloudServiceName dedicated cloud Service name - * @param dedicatedCloudServiceRequest Create Dedicated Cloud Service request - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, dedicatedCloudServiceName: string, dedicatedCloudServiceRequest: Models.DedicatedCloudService, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group - * @param dedicatedCloudServiceName dedicated cloud Service name - * @param dedicatedCloudServiceRequest Create Dedicated Cloud Service request - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, dedicatedCloudServiceName: string, dedicatedCloudServiceRequest: Models.DedicatedCloudService, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, dedicatedCloudServiceName: string, dedicatedCloudServiceRequest: Models.DedicatedCloudService, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + dedicatedCloudServiceName: string, + dedicatedCloudServiceRequest: DedicatedCloudService, + options?: DedicatedCloudServicesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -147,346 +207,339 @@ export class DedicatedCloudServices { dedicatedCloudServiceRequest, options }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); } /** * Delete dedicate cloud service - * @summary Implements dedicatedCloudService DELETE method * @param resourceGroupName The name of the resource group * @param dedicatedCloudServiceName dedicated cloud service name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, dedicatedCloudServiceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,dedicatedCloudServiceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginDelete( + resourceGroupName: string, + dedicatedCloudServiceName: string, + options?: DedicatedCloudServicesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, dedicatedCloudServiceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Patch dedicated cloud service's properties - * @summary Implements dedicatedCloudService PATCH method - * @param resourceGroupName The name of the resource group - * @param dedicatedCloudServiceName dedicated cloud service name - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, dedicatedCloudServiceName: string, options?: Models.DedicatedCloudServicesUpdateOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group - * @param dedicatedCloudServiceName dedicated cloud service name - * @param callback The callback - */ - update(resourceGroupName: string, dedicatedCloudServiceName: string, callback: msRest.ServiceCallback): void; - /** + * Delete dedicate cloud service * @param resourceGroupName The name of the resource group * @param dedicatedCloudServiceName dedicated cloud service name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, dedicatedCloudServiceName: string, options: Models.DedicatedCloudServicesUpdateOptionalParams, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, dedicatedCloudServiceName: string, options?: Models.DedicatedCloudServicesUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - dedicatedCloudServiceName, - options - }, - updateOperationSpec, - callback) as Promise; + async beginDeleteAndWait( + resourceGroupName: string, + dedicatedCloudServiceName: string, + options?: DedicatedCloudServicesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + dedicatedCloudServiceName, + options + ); + return poller.pollUntilDone(); } /** - * Delete dedicate cloud service - * @summary Implements dedicatedCloudService DELETE method + * Patch dedicated cloud service's properties * @param resourceGroupName The name of the resource group * @param dedicatedCloudServiceName dedicated cloud service name - * @param [options] The optional parameters - * @returns Promise + * @param dedicatedCloudServiceRequest Patch Dedicated Cloud Service request + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, dedicatedCloudServiceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + update( + resourceGroupName: string, + dedicatedCloudServiceName: string, + dedicatedCloudServiceRequest: PatchPayload, + options?: DedicatedCloudServicesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( { resourceGroupName, dedicatedCloudServiceName, + dedicatedCloudServiceRequest, options }, - beginDeleteMethodOperationSpec, - options); + updateOperationSpec + ); } /** - * Returns list of dedicated cloud services within a subscription - * @summary Implements list of dedicatedCloudService objects within subscription method - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscriptionNext( + nextLink: string, + options?: DedicatedCloudServicesListBySubscriptionNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listBySubscriptionNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); } /** - * Returns list of dedicated cloud services within a resource group - * @summary Implements list of dedicatedCloudService objects within RG method - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DedicatedCloudServicesListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listBySubscriptionOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices", - urlParameters: [ - Parameters.subscriptionId - ], + responses: { + 200: { + bodyMapper: Mappers.DedicatedCloudServiceListResponse + }, + default: { + bodyMapper: Mappers.CsrpError + } + }, queryParameters: [ Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.skipToken ], - headerParameters: [ - Parameters.acceptLanguage - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DedicatedCloudServiceListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], queryParameters: [ Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.skipToken ], - headerParameters: [ - Parameters.acceptLanguage + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DedicatedCloudServiceListResponse + bodyMapper: Mappers.DedicatedCloudService }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.dedicatedCloudServiceName0 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.dedicatedCloudServiceName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.DedicatedCloudService }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}", + requestBody: Parameters.dedicatedCloudServiceRequest, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.dedicatedCloudServiceName1 ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "dedicatedCloudServiceRequest", - mapper: { - ...Mappers.DedicatedCloudService, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.DedicatedCloudService - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError, + headersMapper: Mappers.DedicatedCloudServicesDeleteExceptionHeaders } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.dedicatedCloudServiceName0 + Parameters.dedicatedCloudServiceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: { - tags: [ - "options", - "tags" - ] - }, - mapper: { - ...Mappers.PatchPayload, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.DedicatedCloudService }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}", + requestBody: Parameters.dedicatedCloudServiceRequest1, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.dedicatedCloudServiceName0 + Parameters.dedicatedCloudServiceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 204: { - headersMapper: Mappers.DedicatedCloudServicesDeleteHeaders - }, - default: { - bodyMapper: Mappers.CSRPError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DedicatedCloudServiceListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DedicatedCloudServiceListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/index.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/index.ts index 8b0e0e5096b4..fb9725c0b4b2 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/index.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./operations"; @@ -13,6 +11,7 @@ export * from "./dedicatedCloudNodes"; export * from "./dedicatedCloudServices"; export * from "./skusAvailability"; export * from "./privateClouds"; +export * from "./customizationPolicies"; export * from "./resourcePools"; export * from "./virtualMachineTemplates"; export * from "./virtualNetworks"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/operations.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/operations.ts index b1360f981bdb..df1910c07eba 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/operations.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/operations.ts @@ -1,191 +1,183 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VMwareCloudSimpleClientContext } from "../vMwareCloudSimpleClientContext"; +import { VMwareCloudSimple } from "../vMwareCloudSimple"; +import { + AvailableOperation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsGetOptionalParams, + OperationsGetResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: VMwareCloudSimpleClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: VMwareCloudSimple; /** - * Create a Operations. - * @param {VMwareCloudSimpleClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: VMwareCloudSimpleClientContext) { + constructor(client: VMwareCloudSimple) { this.client = client; } /** * Return list of operations - * @summary Implements list of available operations - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** - * Return an async operation - * @summary Implements get of async operation - * @param regionId The region Id (westus, eastus) - * @param operationId operation id - * @param [options] The optional parameters - * @returns Promise - */ - get(regionId: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param regionId The region Id (westus, eastus) - * @param operationId operation id - * @param callback The callback + * Return list of operations + * @param options The options parameters. */ - get(regionId: string, operationId: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** + * Return an async operation * @param regionId The region Id (westus, eastus) * @param operationId operation id - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(regionId: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(regionId: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + regionId: string, + operationId: string, + options?: OperationsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - regionId, - operationId, - options - }, - getOperationSpec, - callback) as Promise; + { regionId, operationId, options }, + getOperationSpec + ); } /** - * Return list of operations - * @summary Implements list of available operations - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.VMwareCloudSimple/operations", httpMethod: "GET", - path: "providers/Microsoft.VMwareCloudSimple/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AvailableOperationsListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/operationResults/{operationId}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/operationResults/{operationId}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.regionId, - Parameters.operationId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.referer, - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.OperationResource, - headersMapper: Mappers.OperationsGetHeaders + bodyMapper: Mappers.OperationResource }, 202: { headersMapper: Mappers.OperationsGetHeaders }, - 204: { - headersMapper: Mappers.OperationsGetHeaders - }, + 204: {}, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError, + headersMapper: Mappers.OperationsGetExceptionHeaders } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.operationId + ], + headerParameters: [Parameters.accept, Parameters.referer], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AvailableOperationsListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/privateClouds.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/privateClouds.ts index e59d8c62603c..79208c1e0b0b 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/privateClouds.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/privateClouds.ts @@ -1,191 +1,199 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/privateCloudsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PrivateClouds } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VMwareCloudSimpleClientContext } from "../vMwareCloudSimpleClientContext"; +import { VMwareCloudSimple } from "../vMwareCloudSimple"; +import { + PrivateCloud, + PrivateCloudsListNextOptionalParams, + PrivateCloudsListOptionalParams, + PrivateCloudsListResponse, + PrivateCloudsGetOptionalParams, + PrivateCloudsGetResponse, + PrivateCloudsListNextResponse +} from "../models"; -/** Class representing a PrivateClouds. */ -export class PrivateClouds { - private readonly client: VMwareCloudSimpleClientContext; +/// +/** Class containing PrivateClouds operations. */ +export class PrivateCloudsImpl implements PrivateClouds { + private readonly client: VMwareCloudSimple; /** - * Create a PrivateClouds. - * @param {VMwareCloudSimpleClientContext} client Reference to the service client. + * Initialize a new instance of the class PrivateClouds class. + * @param client Reference to the service client */ - constructor(client: VMwareCloudSimpleClientContext) { + constructor(client: VMwareCloudSimple) { this.client = client; } /** * Returns list of private clouds in particular region - * @summary Implements private cloud list GET method * @param regionId The region Id (westus, eastus) - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(regionId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param regionId The region Id (westus, eastus) - * @param callback The callback - */ - list(regionId: string, callback: msRest.ServiceCallback): void; + public list( + regionId: string, + options?: PrivateCloudsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(regionId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(regionId, options); + } + }; + } + + private async *listPagingPage( + regionId: string, + options?: PrivateCloudsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(regionId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(regionId, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + regionId: string, + options?: PrivateCloudsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(regionId, options)) { + yield* page; + } + } + /** + * Returns list of private clouds in particular region * @param regionId The region Id (westus, eastus) - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(regionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(regionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + regionId: string, + options?: PrivateCloudsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - regionId, - options - }, - listOperationSpec, - callback) as Promise; + { regionId, options }, + listOperationSpec + ); } /** * Returns private cloud by its name - * @summary Implements private cloud GET method * @param pcName The private cloud name * @param regionId The region Id (westus, eastus) - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(pcName: string, regionId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param pcName The private cloud name - * @param regionId The region Id (westus, eastus) - * @param callback The callback - */ - get(pcName: string, regionId: string, callback: msRest.ServiceCallback): void; - /** - * @param pcName The private cloud name - * @param regionId The region Id (westus, eastus) - * @param options The optional parameters - * @param callback The callback - */ - get(pcName: string, regionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(pcName: string, regionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + pcName: string, + regionId: string, + options?: PrivateCloudsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - pcName, - regionId, - options - }, - getOperationSpec, - callback) as Promise; + { pcName, regionId, options }, + getOperationSpec + ); } /** - * Returns list of private clouds in particular region - * @summary Implements private cloud list GET method - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param regionId The region Id (westus, eastus) + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + regionId: string, + nextLink: string, + options?: PrivateCloudsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { regionId, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds", - urlParameters: [ - Parameters.subscriptionId, - Parameters.regionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.PrivateCloudList }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.pcName, Parameters.regionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateCloud }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.pcName + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateCloudList }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/resourcePools.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/resourcePools.ts index 23ec0d05f32f..1b6c29f15613 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/resourcePools.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/resourcePools.ts @@ -1,201 +1,217 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/resourcePoolsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ResourcePools } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VMwareCloudSimpleClientContext } from "../vMwareCloudSimpleClientContext"; +import { VMwareCloudSimple } from "../vMwareCloudSimple"; +import { + ResourcePool, + ResourcePoolsListNextOptionalParams, + ResourcePoolsListOptionalParams, + ResourcePoolsListOperationResponse, + ResourcePoolsGetOptionalParams, + ResourcePoolsGetResponse, + ResourcePoolsListNextResponse +} from "../models"; -/** Class representing a ResourcePools. */ -export class ResourcePools { - private readonly client: VMwareCloudSimpleClientContext; +/// +/** Class containing ResourcePools operations. */ +export class ResourcePoolsImpl implements ResourcePools { + private readonly client: VMwareCloudSimple; /** - * Create a ResourcePools. - * @param {VMwareCloudSimpleClientContext} client Reference to the service client. + * Initialize a new instance of the class ResourcePools class. + * @param client Reference to the service client */ - constructor(client: VMwareCloudSimpleClientContext) { + constructor(client: VMwareCloudSimple) { this.client = client; } /** * Returns list of resource pools in region for private cloud - * @summary Implements get of resource pools list * @param regionId The region Id (westus, eastus) * @param pcName The private cloud name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(regionId: string, pcName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param regionId The region Id (westus, eastus) - * @param pcName The private cloud name - * @param callback The callback - */ - list(regionId: string, pcName: string, callback: msRest.ServiceCallback): void; - /** - * @param regionId The region Id (westus, eastus) - * @param pcName The private cloud name - * @param options The optional parameters - * @param callback The callback - */ - list(regionId: string, pcName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(regionId: string, pcName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public list( + regionId: string, + pcName: string, + options?: ResourcePoolsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(regionId, pcName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(regionId, pcName, options); + } + }; + } + + private async *listPagingPage( + regionId: string, + pcName: string, + options?: ResourcePoolsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(regionId, pcName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( regionId, pcName, + continuationToken, options - }, - listOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + regionId: string, + pcName: string, + options?: ResourcePoolsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(regionId, pcName, options)) { + yield* page; + } } /** - * Returns resource pool templates by its name - * @summary Implements get of resource pool - * @param regionId The region Id (westus, eastus) - * @param pcName The private cloud name - * @param resourcePoolName resource pool id (vsphereId) - * @param [options] The optional parameters - * @returns Promise - */ - get(regionId: string, pcName: string, resourcePoolName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Returns list of resource pools in region for private cloud * @param regionId The region Id (westus, eastus) * @param pcName The private cloud name - * @param resourcePoolName resource pool id (vsphereId) - * @param callback The callback + * @param options The options parameters. */ - get(regionId: string, pcName: string, resourcePoolName: string, callback: msRest.ServiceCallback): void; + private _list( + regionId: string, + pcName: string, + options?: ResourcePoolsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { regionId, pcName, options }, + listOperationSpec + ); + } + /** + * Returns resource pool templates by its name * @param regionId The region Id (westus, eastus) * @param pcName The private cloud name * @param resourcePoolName resource pool id (vsphereId) - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(regionId: string, pcName: string, resourcePoolName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(regionId: string, pcName: string, resourcePoolName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + regionId: string, + pcName: string, + resourcePoolName: string, + options?: ResourcePoolsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - regionId, - pcName, - resourcePoolName, - options - }, - getOperationSpec, - callback) as Promise; + { regionId, pcName, resourcePoolName, options }, + getOperationSpec + ); } /** - * Returns list of resource pools in region for private cloud - * @summary Implements get of resource pools list - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + regionId: string, + pcName: string, + nextLink: string, + options?: ResourcePoolsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { regionId, pcName, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools", - urlParameters: [ - Parameters.subscriptionId, - Parameters.regionId, - Parameters.pcName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ResourcePoolsListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools/{resourcePoolName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.regionId, - Parameters.pcName, - Parameters.resourcePoolName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.pcName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools/{resourcePoolName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ResourcePool }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.pcName, + Parameters.resourcePoolName + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ResourcePoolsListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.nextLink, + Parameters.pcName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/skusAvailability.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/skusAvailability.ts index 0c28b077c18b..42da0d565040 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/skusAvailability.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/skusAvailability.ts @@ -1,134 +1,158 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/skusAvailabilityMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SkusAvailability } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VMwareCloudSimpleClientContext } from "../vMwareCloudSimpleClientContext"; +import { VMwareCloudSimple } from "../vMwareCloudSimple"; +import { + SkuAvailability, + SkusAvailabilityListNextOptionalParams, + SkusAvailabilityListOptionalParams, + SkusAvailabilityListResponse, + SkusAvailabilityListNextResponse +} from "../models"; -/** Class representing a SkusAvailability. */ -export class SkusAvailability { - private readonly client: VMwareCloudSimpleClientContext; +/// +/** Class containing SkusAvailability operations. */ +export class SkusAvailabilityImpl implements SkusAvailability { + private readonly client: VMwareCloudSimple; /** - * Create a SkusAvailability. - * @param {VMwareCloudSimpleClientContext} client Reference to the service client. + * Initialize a new instance of the class SkusAvailability class. + * @param client Reference to the service client */ - constructor(client: VMwareCloudSimpleClientContext) { + constructor(client: VMwareCloudSimple) { this.client = client; } /** * Returns list of available resources in region - * @summary Implements SkuAvailability List method * @param regionId The region Id (westus, eastus) - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(regionId: string, options?: Models.SkusAvailabilityListOptionalParams): Promise; - /** - * @param regionId The region Id (westus, eastus) - * @param callback The callback - */ - list(regionId: string, callback: msRest.ServiceCallback): void; - /** - * @param regionId The region Id (westus, eastus) - * @param options The optional parameters - * @param callback The callback - */ - list(regionId: string, options: Models.SkusAvailabilityListOptionalParams, callback: msRest.ServiceCallback): void; - list(regionId: string, options?: Models.SkusAvailabilityListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - regionId, - options + public list( + regionId: string, + options?: SkusAvailabilityListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(regionId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(regionId, options); + } + }; + } + + private async *listPagingPage( + regionId: string, + options?: SkusAvailabilityListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(regionId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(regionId, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + regionId: string, + options?: SkusAvailabilityListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(regionId, options)) { + yield* page; + } } /** * Returns list of available resources in region - * @summary Implements SkuAvailability List method - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param regionId The region Id (westus, eastus) + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + regionId: string, + options?: SkusAvailabilityListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { regionId, options }, + listOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param regionId The region Id (westus, eastus) + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + regionId: string, + nextLink: string, + options?: SkusAvailabilityListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { regionId, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/availabilities", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/availabilities", - urlParameters: [ - Parameters.subscriptionId, - Parameters.regionId - ], - queryParameters: [ - Parameters.skuId, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.SkuAvailabilityListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion, Parameters.skuId], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SkuAvailabilityListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion, Parameters.skuId], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/usages.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/usages.ts index 271806e5dfed..a9007559f4ee 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/usages.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/usages.ts @@ -1,134 +1,158 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/usagesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Usages } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VMwareCloudSimpleClientContext } from "../vMwareCloudSimpleClientContext"; +import { VMwareCloudSimple } from "../vMwareCloudSimple"; +import { + Usage, + UsagesListNextOptionalParams, + UsagesListOptionalParams, + UsagesListResponse, + UsagesListNextResponse +} from "../models"; -/** Class representing a Usages. */ -export class Usages { - private readonly client: VMwareCloudSimpleClientContext; +/// +/** Class containing Usages operations. */ +export class UsagesImpl implements Usages { + private readonly client: VMwareCloudSimple; /** - * Create a Usages. - * @param {VMwareCloudSimpleClientContext} client Reference to the service client. + * Initialize a new instance of the class Usages class. + * @param client Reference to the service client */ - constructor(client: VMwareCloudSimpleClientContext) { + constructor(client: VMwareCloudSimple) { this.client = client; } /** * Returns list of usage in region - * @summary Implements Usages List method * @param regionId The region Id (westus, eastus) - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(regionId: string, options?: Models.UsagesListOptionalParams): Promise; - /** - * @param regionId The region Id (westus, eastus) - * @param callback The callback - */ - list(regionId: string, callback: msRest.ServiceCallback): void; - /** - * @param regionId The region Id (westus, eastus) - * @param options The optional parameters - * @param callback The callback - */ - list(regionId: string, options: Models.UsagesListOptionalParams, callback: msRest.ServiceCallback): void; - list(regionId: string, options?: Models.UsagesListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - regionId, - options + public list( + regionId: string, + options?: UsagesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(regionId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(regionId, options); + } + }; + } + + private async *listPagingPage( + regionId: string, + options?: UsagesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(regionId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(regionId, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + regionId: string, + options?: UsagesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(regionId, options)) { + yield* page; + } } /** * Returns list of usage in region - * @summary Implements Usages List method - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param regionId The region Id (westus, eastus) + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + regionId: string, + options?: UsagesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { regionId, options }, + listOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param regionId The region Id (westus, eastus) + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + regionId: string, + nextLink: string, + options?: UsagesListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { regionId, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/usages", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/usages", - urlParameters: [ - Parameters.subscriptionId, - Parameters.regionId - ], - queryParameters: [ - Parameters.filter, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.UsageListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.UsageListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualMachineTemplates.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualMachineTemplates.ts index 6d51cea9355d..b162e879357b 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualMachineTemplates.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualMachineTemplates.ts @@ -1,206 +1,236 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/virtualMachineTemplatesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { VirtualMachineTemplates } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VMwareCloudSimpleClientContext } from "../vMwareCloudSimpleClientContext"; +import { VMwareCloudSimple } from "../vMwareCloudSimple"; +import { + VirtualMachineTemplate, + VirtualMachineTemplatesListNextOptionalParams, + VirtualMachineTemplatesListOptionalParams, + VirtualMachineTemplatesListResponse, + VirtualMachineTemplatesGetOptionalParams, + VirtualMachineTemplatesGetResponse, + VirtualMachineTemplatesListNextResponse +} from "../models"; -/** Class representing a VirtualMachineTemplates. */ -export class VirtualMachineTemplates { - private readonly client: VMwareCloudSimpleClientContext; +/// +/** Class containing VirtualMachineTemplates operations. */ +export class VirtualMachineTemplatesImpl implements VirtualMachineTemplates { + private readonly client: VMwareCloudSimple; /** - * Create a VirtualMachineTemplates. - * @param {VMwareCloudSimpleClientContext} client Reference to the service client. + * Initialize a new instance of the class VirtualMachineTemplates class. + * @param client Reference to the service client */ - constructor(client: VMwareCloudSimpleClientContext) { + constructor(client: VMwareCloudSimple) { this.client = client; } /** * Returns list of virtual machine templates in region for private cloud - * @summary Implements list of available VM templates * @param pcName The private cloud name * @param regionId The region Id (westus, eastus) * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(pcName: string, regionId: string, resourcePoolName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param pcName The private cloud name - * @param regionId The region Id (westus, eastus) - * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates - * @param callback The callback - */ - list(pcName: string, regionId: string, resourcePoolName: string, callback: msRest.ServiceCallback): void; - /** - * @param pcName The private cloud name - * @param regionId The region Id (westus, eastus) - * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates - * @param options The optional parameters - * @param callback The callback - */ - list(pcName: string, regionId: string, resourcePoolName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(pcName: string, regionId: string, resourcePoolName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public list( + pcName: string, + regionId: string, + resourcePoolName: string, + options?: VirtualMachineTemplatesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + pcName, + regionId, + resourcePoolName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(pcName, regionId, resourcePoolName, options); + } + }; + } + + private async *listPagingPage( + pcName: string, + regionId: string, + resourcePoolName: string, + options?: VirtualMachineTemplatesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(pcName, regionId, resourcePoolName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( pcName, regionId, resourcePoolName, + continuationToken, options - }, - listOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + pcName: string, + regionId: string, + resourcePoolName: string, + options?: VirtualMachineTemplatesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + pcName, + regionId, + resourcePoolName, + options + )) { + yield* page; + } } /** - * Returns virtual machine templates by its name - * @summary Implements virtual machine template GET method - * @param regionId The region Id (westus, eastus) + * Returns list of virtual machine templates in region for private cloud * @param pcName The private cloud name - * @param virtualMachineTemplateName virtual machine template id (vsphereId) - * @param [options] The optional parameters - * @returns Promise - */ - get(regionId: string, pcName: string, virtualMachineTemplateName: string, options?: msRest.RequestOptionsBase): Promise; - /** * @param regionId The region Id (westus, eastus) - * @param pcName The private cloud name - * @param virtualMachineTemplateName virtual machine template id (vsphereId) - * @param callback The callback + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates + * @param options The options parameters. */ - get(regionId: string, pcName: string, virtualMachineTemplateName: string, callback: msRest.ServiceCallback): void; + private _list( + pcName: string, + regionId: string, + resourcePoolName: string, + options?: VirtualMachineTemplatesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { pcName, regionId, resourcePoolName, options }, + listOperationSpec + ); + } + /** + * Returns virtual machine templates by its name * @param regionId The region Id (westus, eastus) * @param pcName The private cloud name * @param virtualMachineTemplateName virtual machine template id (vsphereId) - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(regionId: string, pcName: string, virtualMachineTemplateName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(regionId: string, pcName: string, virtualMachineTemplateName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + regionId: string, + pcName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - regionId, - pcName, - virtualMachineTemplateName, - options - }, - getOperationSpec, - callback) as Promise; + { regionId, pcName, virtualMachineTemplateName, options }, + getOperationSpec + ); } /** - * Returns list of virtual machine templates in region for private cloud - * @summary Implements list of available VM templates - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param pcName The private cloud name + * @param regionId The region Id (westus, eastus) + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + pcName: string, + regionId: string, + resourcePoolName: string, + nextLink: string, + options?: VirtualMachineTemplatesListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { pcName, regionId, resourcePoolName, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates", - urlParameters: [ - Parameters.subscriptionId, - Parameters.pcName, - Parameters.regionId - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.resourcePoolName - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.VirtualMachineTemplateListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates/{virtualMachineTemplateName}", + queryParameters: [Parameters.apiVersion, Parameters.resourcePoolName1], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.regionId, - Parameters.pcName, - Parameters.virtualMachineTemplateName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.pcName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates/{virtualMachineTemplateName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.VirtualMachineTemplate }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.pcName, + Parameters.virtualMachineTemplateName + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.VirtualMachineTemplateListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion, Parameters.resourcePoolName1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.nextLink, + Parameters.pcName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualMachines.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualMachines.ts index 7f5eae012574..5b13f56168fc 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualMachines.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualMachines.ts @@ -1,443 +1,729 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/virtualMachinesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { VirtualMachines } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VMwareCloudSimpleClientContext } from "../vMwareCloudSimpleClientContext"; +import { VMwareCloudSimple } from "../vMwareCloudSimple"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + VirtualMachine, + VirtualMachinesListBySubscriptionNextOptionalParams, + VirtualMachinesListBySubscriptionOptionalParams, + VirtualMachinesListByResourceGroupNextOptionalParams, + VirtualMachinesListByResourceGroupOptionalParams, + VirtualMachinesListBySubscriptionResponse, + VirtualMachinesListByResourceGroupResponse, + VirtualMachinesGetOptionalParams, + VirtualMachinesGetResponse, + VirtualMachinesCreateOrUpdateOptionalParams, + VirtualMachinesCreateOrUpdateResponse, + VirtualMachinesDeleteOptionalParams, + VirtualMachinesDeleteResponse, + PatchPayload, + VirtualMachinesUpdateOptionalParams, + VirtualMachinesUpdateResponse, + VirtualMachinesStartOptionalParams, + VirtualMachinesStopOptionalParams, + VirtualMachinesListBySubscriptionNextResponse, + VirtualMachinesListByResourceGroupNextResponse +} from "../models"; -/** Class representing a VirtualMachines. */ -export class VirtualMachines { - private readonly client: VMwareCloudSimpleClientContext; +/// +/** Class containing VirtualMachines operations. */ +export class VirtualMachinesImpl implements VirtualMachines { + private readonly client: VMwareCloudSimple; /** - * Create a VirtualMachines. - * @param {VMwareCloudSimpleClientContext} client Reference to the service client. + * Initialize a new instance of the class VirtualMachines class. + * @param client Reference to the service client */ - constructor(client: VMwareCloudSimpleClientContext) { + constructor(client: VMwareCloudSimple) { this.client = client; } /** * Returns list virtual machine within subscription - * @summary Implements list virtual machine within subscription method - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listBySubscription(options?: Models.VirtualMachinesListBySubscriptionOptionalParams): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listBySubscription(options: Models.VirtualMachinesListBySubscriptionOptionalParams, callback: msRest.ServiceCallback): void; - listBySubscription(options?: Models.VirtualMachinesListBySubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public listBySubscription( + options?: VirtualMachinesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listBySubscriptionOperationSpec, - callback) as Promise; + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: VirtualMachinesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: VirtualMachinesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } } /** * Returns list of virtual machine within resource group - * @summary Implements list virtual machine within RG method * @param resourceGroupName The name of the resource group - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: Models.VirtualMachinesListByResourceGroupOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: Models.VirtualMachinesListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: Models.VirtualMachinesListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, + continuationToken, options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Get virtual machine - * @summary Implements virtual machine GET method - * @param resourceGroupName The name of the resource group - * @param virtualMachineName virtual machine name - * @param [options] The optional parameters - * @returns Promise + * Returns list virtual machine within subscription + * @param options The options parameters. */ - get(resourceGroupName: string, virtualMachineName: string, options?: msRest.RequestOptionsBase): Promise; + private _listBySubscription( + options?: VirtualMachinesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + /** + * Returns list of virtual machine within resource group * @param resourceGroupName The name of the resource group - * @param virtualMachineName virtual machine name - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, virtualMachineName: string, callback: msRest.ServiceCallback): void; + private _listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + /** + * Get virtual machine * @param resourceGroupName The name of the resource group * @param virtualMachineName virtual machine name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, virtualMachineName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, virtualMachineName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - virtualMachineName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, virtualMachineName, options }, + getOperationSpec + ); } /** * Create Or Update Virtual Machine - * @summary Implements virtual machine PUT method * @param resourceGroupName The name of the resource group * @param virtualMachineName virtual machine name * @param virtualMachineRequest Create or Update Virtual Machine request - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, virtualMachineName: string, virtualMachineRequest: Models.VirtualMachine, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,virtualMachineName,virtualMachineRequest,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineRequest: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, virtualMachineName, virtualMachineRequest, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Delete virtual machine - * @summary Implements virtual machine DELETE method + * Create Or Update Virtual Machine * @param resourceGroupName The name of the resource group * @param virtualMachineName virtual machine name - * @param [options] The optional parameters - * @returns Promise + * @param virtualMachineRequest Create or Update Virtual Machine request + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, virtualMachineName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,virtualMachineName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineRequest: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + virtualMachineName, + virtualMachineRequest, + options + ); + return poller.pollUntilDone(); } /** - * Patch virtual machine properties - * @summary Implements virtual machine PATCH method + * Delete virtual machine * @param resourceGroupName The name of the resource group * @param virtualMachineName virtual machine name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update(resourceGroupName: string, virtualMachineName: string, options?: Models.VirtualMachinesUpdateOptionalParams): Promise { - return this.beginUpdate(resourceGroupName,virtualMachineName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginDelete( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, virtualMachineName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Power on virtual machine - * @summary Implements a start method for a virtual machine + * Delete virtual machine * @param resourceGroupName The name of the resource group * @param virtualMachineName virtual machine name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - start(resourceGroupName: string, virtualMachineName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginStart(resourceGroupName,virtualMachineName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginDeleteAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); } /** - * Power off virtual machine, options: shutdown, poweroff, and suspend - * @summary Implements shutdown, poweroff, and suspend method for a virtual machine + * Patch virtual machine properties * @param resourceGroupName The name of the resource group * @param virtualMachineName virtual machine name - * @param [options] The optional parameters - * @returns Promise + * @param virtualMachineRequest Patch virtual machine request + * @param options The options parameters. */ - stop(resourceGroupName: string, virtualMachineName: string, options?: Models.VirtualMachinesStopOptionalParams): Promise { - return this.beginStop(resourceGroupName,virtualMachineName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginUpdate( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineRequest: PatchPayload, + options?: VirtualMachinesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, virtualMachineName, virtualMachineRequest, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Create Or Update Virtual Machine - * @summary Implements virtual machine PUT method + * Patch virtual machine properties * @param resourceGroupName The name of the resource group * @param virtualMachineName virtual machine name - * @param virtualMachineRequest Create or Update Virtual Machine request - * @param [options] The optional parameters - * @returns Promise + * @param virtualMachineRequest Patch virtual machine request + * @param options The options parameters. */ - beginCreateOrUpdate(resourceGroupName: string, virtualMachineName: string, virtualMachineRequest: Models.VirtualMachine, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - virtualMachineName, - virtualMachineRequest, - options - }, - beginCreateOrUpdateOperationSpec, - options); + async beginUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineRequest: PatchPayload, + options?: VirtualMachinesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + virtualMachineName, + virtualMachineRequest, + options + ); + return poller.pollUntilDone(); } /** - * Delete virtual machine - * @summary Implements virtual machine DELETE method + * Power on virtual machine * @param resourceGroupName The name of the resource group * @param virtualMachineName virtual machine name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, virtualMachineName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - virtualMachineName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginStart( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, virtualMachineName, options }, + startOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Patch virtual machine properties - * @summary Implements virtual machine PATCH method + * Power on virtual machine * @param resourceGroupName The name of the resource group * @param virtualMachineName virtual machine name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginUpdate(resourceGroupName: string, virtualMachineName: string, options?: Models.VirtualMachinesBeginUpdateOptionalParams): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - virtualMachineName, - options - }, - beginUpdateOperationSpec, - options); + async beginStartAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise { + const poller = await this.beginStart( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); } /** - * Power on virtual machine - * @summary Implements a start method for a virtual machine + * Power off virtual machine, options: shutdown, poweroff, and suspend * @param resourceGroupName The name of the resource group * @param virtualMachineName virtual machine name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginStart(resourceGroupName: string, virtualMachineName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - virtualMachineName, - options - }, - beginStartOperationSpec, - options); + async beginStop( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, virtualMachineName, options }, + stopOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Power off virtual machine, options: shutdown, poweroff, and suspend - * @summary Implements shutdown, poweroff, and suspend method for a virtual machine * @param resourceGroupName The name of the resource group * @param virtualMachineName virtual machine name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginStop(resourceGroupName: string, virtualMachineName: string, options?: Models.VirtualMachinesBeginStopOptionalParams): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - virtualMachineName, - options - }, - beginStopOperationSpec, - options); + async beginStopAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): Promise { + const poller = await this.beginStop( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); } /** - * Returns list virtual machine within subscription - * @summary Implements list virtual machine within subscription method - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscriptionNext( + nextLink: string, + options?: VirtualMachinesListBySubscriptionNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listBySubscriptionNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); } /** - * Returns list of virtual machine within resource group - * @summary Implements list virtual machine within RG method - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: VirtualMachinesListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listBySubscriptionOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/virtualMachines", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/virtualMachines", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.top, - Parameters.skipToken - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.VirtualMachineListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], queryParameters: [ Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.skipToken ], - headerParameters: [ - Parameters.acceptLanguage - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.VirtualMachineListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.virtualMachineName0 - ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skipToken ], - headerParameters: [ - Parameters.acceptLanguage + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.VirtualMachine }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.virtualMachineName1 - ], - queryParameters: [ - Parameters.apiVersion + Parameters.virtualMachineName ], - headerParameters: [ - Parameters.referer, - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "virtualMachineRequest", - mapper: { - ...Mappers.VirtualMachine, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.VirtualMachine, @@ -447,29 +733,45 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.VirtualMachine, headersMapper: Mappers.VirtualMachinesCreateOrUpdateHeaders }, + 202: { + bodyMapper: Mappers.VirtualMachine, + headersMapper: Mappers.VirtualMachinesCreateOrUpdateHeaders + }, + 204: { + bodyMapper: Mappers.VirtualMachine, + headersMapper: Mappers.VirtualMachinesCreateOrUpdateHeaders + }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}", + requestBody: Parameters.virtualMachineRequest, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.virtualMachineName0 - ], - queryParameters: [ - Parameters.apiVersion + Parameters.virtualMachineName1 ], headerParameters: [ + Parameters.accept, Parameters.referer, - Parameters.acceptLanguage + Parameters.contentType ], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}", + httpMethod: "DELETE", responses: { + 200: { + headersMapper: Mappers.VirtualMachinesDeleteHeaders + }, + 201: { + headersMapper: Mappers.VirtualMachinesDeleteHeaders + }, 202: { headersMapper: Mappers.VirtualMachinesDeleteHeaders }, @@ -477,155 +779,155 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.VirtualMachinesDeleteHeaders }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError, + headersMapper: Mappers.VirtualMachinesDeleteExceptionHeaders } }, - serializer -}; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.virtualMachineName0 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.virtualMachineName ], - requestBody: { - parameterPath: { - tags: [ - "options", - "tags" - ] - }, - mapper: { - ...Mappers.PatchPayload, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.referer], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.VirtualMachine }, + 201: { + bodyMapper: Mappers.VirtualMachine + }, + 202: { + bodyMapper: Mappers.VirtualMachine + }, + 204: { + bodyMapper: Mappers.VirtualMachine + }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const beginStartOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/start", + requestBody: Parameters.virtualMachineRequest1, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.virtualMachineName0 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.referer, - Parameters.acceptLanguage + Parameters.virtualMachineName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const startOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/start", + httpMethod: "POST", responses: { - 200: { - headersMapper: Mappers.VirtualMachinesStartHeaders - }, - 202: { - headersMapper: Mappers.VirtualMachinesStartHeaders - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError, + headersMapper: Mappers.VirtualMachinesStartExceptionHeaders } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept, Parameters.referer], serializer }; - -const beginStopOperationSpec: msRest.OperationSpec = { +const stopOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/stop", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/stop", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CsrpError, + headersMapper: Mappers.VirtualMachinesStopExceptionHeaders + } + }, + requestBody: Parameters.m, + queryParameters: [Parameters.apiVersion, Parameters.mode], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.virtualMachineName0 - ], - queryParameters: [ - Parameters.mode, - Parameters.apiVersion + Parameters.virtualMachineName ], headerParameters: [ + Parameters.accept, Parameters.referer, - Parameters.acceptLanguage + Parameters.contentType ], - requestBody: { - parameterPath: { - mode: [ - "options", - "mode1" - ] - }, - mapper: Mappers.VirtualMachineStopMode - }, - responses: { - 200: { - headersMapper: Mappers.VirtualMachinesStopHeaders - }, - 202: { - headersMapper: Mappers.VirtualMachinesStopHeaders - }, - default: { - bodyMapper: Mappers.CSRPError - } - }, + mediaType: "json", serializer }; - -const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.VirtualMachineListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.VirtualMachineListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualNetworks.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualNetworks.ts index a5c0dd290944..96a93035bf3c 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualNetworks.ts +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operations/virtualNetworks.ts @@ -1,209 +1,236 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/virtualNetworksMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { VirtualNetworks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { VMwareCloudSimpleClientContext } from "../vMwareCloudSimpleClientContext"; +import { VMwareCloudSimple } from "../vMwareCloudSimple"; +import { + VirtualNetwork, + VirtualNetworksListNextOptionalParams, + VirtualNetworksListOptionalParams, + VirtualNetworksListResponse, + VirtualNetworksGetOptionalParams, + VirtualNetworksGetResponse, + VirtualNetworksListNextResponse +} from "../models"; -/** Class representing a VirtualNetworks. */ -export class VirtualNetworks { - private readonly client: VMwareCloudSimpleClientContext; +/// +/** Class containing VirtualNetworks operations. */ +export class VirtualNetworksImpl implements VirtualNetworks { + private readonly client: VMwareCloudSimple; /** - * Create a VirtualNetworks. - * @param {VMwareCloudSimpleClientContext} client Reference to the service client. + * Initialize a new instance of the class VirtualNetworks class. + * @param client Reference to the service client */ - constructor(client: VMwareCloudSimpleClientContext) { + constructor(client: VMwareCloudSimple) { this.client = client; } /** * Return list of virtual networks in location for private cloud - * @summary Implements list available virtual networks within a subscription method * @param regionId The region Id (westus, eastus) * @param pcName The private cloud name - * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual - * networks - * @param [options] The optional parameters - * @returns Promise + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual networks + * @param options The options parameters. */ - list(regionId: string, pcName: string, resourcePoolName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param regionId The region Id (westus, eastus) - * @param pcName The private cloud name - * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual - * networks - * @param callback The callback - */ - list(regionId: string, pcName: string, resourcePoolName: string, callback: msRest.ServiceCallback): void; - /** - * @param regionId The region Id (westus, eastus) - * @param pcName The private cloud name - * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual - * networks - * @param options The optional parameters - * @param callback The callback - */ - list(regionId: string, pcName: string, resourcePoolName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(regionId: string, pcName: string, resourcePoolName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public list( + regionId: string, + pcName: string, + resourcePoolName: string, + options?: VirtualNetworksListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + regionId, + pcName, + resourcePoolName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(regionId, pcName, resourcePoolName, options); + } + }; + } + + private async *listPagingPage( + regionId: string, + pcName: string, + resourcePoolName: string, + options?: VirtualNetworksListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(regionId, pcName, resourcePoolName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( regionId, pcName, resourcePoolName, + continuationToken, options - }, - listOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + regionId: string, + pcName: string, + resourcePoolName: string, + options?: VirtualNetworksListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + regionId, + pcName, + resourcePoolName, + options + )) { + yield* page; + } } /** - * Return virtual network by its name - * @summary Implements virtual network GET method - * @param regionId The region Id (westus, eastus) - * @param pcName The private cloud name - * @param virtualNetworkName virtual network id (vsphereId) - * @param [options] The optional parameters - * @returns Promise - */ - get(regionId: string, pcName: string, virtualNetworkName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Return list of virtual networks in location for private cloud * @param regionId The region Id (westus, eastus) * @param pcName The private cloud name - * @param virtualNetworkName virtual network id (vsphereId) - * @param callback The callback + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual networks + * @param options The options parameters. */ - get(regionId: string, pcName: string, virtualNetworkName: string, callback: msRest.ServiceCallback): void; + private _list( + regionId: string, + pcName: string, + resourcePoolName: string, + options?: VirtualNetworksListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { regionId, pcName, resourcePoolName, options }, + listOperationSpec + ); + } + /** + * Return virtual network by its name * @param regionId The region Id (westus, eastus) * @param pcName The private cloud name * @param virtualNetworkName virtual network id (vsphereId) - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(regionId: string, pcName: string, virtualNetworkName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(regionId: string, pcName: string, virtualNetworkName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + regionId: string, + pcName: string, + virtualNetworkName: string, + options?: VirtualNetworksGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - regionId, - pcName, - virtualNetworkName, - options - }, - getOperationSpec, - callback) as Promise; + { regionId, pcName, virtualNetworkName, options }, + getOperationSpec + ); } /** - * Return list of virtual networks in location for private cloud - * @summary Implements list available virtual networks within a subscription method - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual networks + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + regionId: string, + pcName: string, + resourcePoolName: string, + nextLink: string, + options?: VirtualNetworksListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { regionId, pcName, resourcePoolName, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks", - urlParameters: [ - Parameters.subscriptionId, - Parameters.regionId, - Parameters.pcName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.resourcePoolName - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.VirtualNetworkListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks/{virtualNetworkName}", + queryParameters: [Parameters.apiVersion, Parameters.resourcePoolName1], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.regionId, - Parameters.pcName, - Parameters.virtualNetworkName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.pcName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks/{virtualNetworkName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.VirtualNetwork }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.pcName, + Parameters.virtualNetworkName + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.VirtualNetworkListResponse }, default: { - bodyMapper: Mappers.CSRPError + bodyMapper: Mappers.CsrpError } }, + queryParameters: [Parameters.apiVersion, Parameters.resourcePoolName1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.regionId, + Parameters.nextLink, + Parameters.pcName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/customizationPolicies.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/customizationPolicies.ts new file mode 100644 index 000000000000..358d09f8bd5c --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/customizationPolicies.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + CustomizationPolicy, + CustomizationPoliciesListOptionalParams, + CustomizationPoliciesGetOptionalParams, + CustomizationPoliciesGetResponse +} from "../models"; + +/// +/** Interface representing a CustomizationPolicies. */ +export interface CustomizationPolicies { + /** + * Returns list of customization policies in region for private cloud + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param options The options parameters. + */ + list( + regionId: string, + pcName: string, + options?: CustomizationPoliciesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns customization policy by its name + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param customizationPolicyName customization policy name + * @param options The options parameters. + */ + get( + regionId: string, + pcName: string, + customizationPolicyName: string, + options?: CustomizationPoliciesGetOptionalParams + ): Promise; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/dedicatedCloudNodes.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/dedicatedCloudNodes.ts new file mode 100644 index 000000000000..bc67c211b216 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/dedicatedCloudNodes.ts @@ -0,0 +1,110 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + DedicatedCloudNode, + DedicatedCloudNodesListBySubscriptionOptionalParams, + DedicatedCloudNodesListByResourceGroupOptionalParams, + DedicatedCloudNodesGetOptionalParams, + DedicatedCloudNodesGetResponse, + DedicatedCloudNodesCreateOrUpdateOptionalParams, + DedicatedCloudNodesCreateOrUpdateResponse, + DedicatedCloudNodesDeleteOptionalParams, + PatchPayload, + DedicatedCloudNodesUpdateOptionalParams, + DedicatedCloudNodesUpdateResponse +} from "../models"; + +/// +/** Interface representing a DedicatedCloudNodes. */ +export interface DedicatedCloudNodes { + /** + * Returns list of dedicate cloud nodes within subscription + * @param options The options parameters. + */ + listBySubscription( + options?: DedicatedCloudNodesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns list of dedicate cloud nodes within resource group + * @param resourceGroupName The name of the resource group + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DedicatedCloudNodesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns dedicated cloud node + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + dedicatedCloudNodeName: string, + options?: DedicatedCloudNodesGetOptionalParams + ): Promise; + /** + * Returns dedicated cloud node by its name + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + dedicatedCloudNodeName: string, + dedicatedCloudNodeRequest: DedicatedCloudNode, + options?: DedicatedCloudNodesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DedicatedCloudNodesCreateOrUpdateResponse + > + >; + /** + * Returns dedicated cloud node by its name + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + dedicatedCloudNodeName: string, + dedicatedCloudNodeRequest: DedicatedCloudNode, + options?: DedicatedCloudNodesCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete dedicated cloud node + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + dedicatedCloudNodeName: string, + options?: DedicatedCloudNodesDeleteOptionalParams + ): Promise; + /** + * Patches dedicated node properties + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param dedicatedCloudNodeRequest Patch Dedicated Cloud Node request + * @param options The options parameters. + */ + update( + resourceGroupName: string, + dedicatedCloudNodeName: string, + dedicatedCloudNodeRequest: PatchPayload, + options?: DedicatedCloudNodesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/dedicatedCloudServices.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/dedicatedCloudServices.ts new file mode 100644 index 000000000000..9aaf2a113e4c --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/dedicatedCloudServices.ts @@ -0,0 +1,103 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + DedicatedCloudService, + DedicatedCloudServicesListBySubscriptionOptionalParams, + DedicatedCloudServicesListByResourceGroupOptionalParams, + DedicatedCloudServicesGetOptionalParams, + DedicatedCloudServicesGetResponse, + DedicatedCloudServicesCreateOrUpdateOptionalParams, + DedicatedCloudServicesCreateOrUpdateResponse, + DedicatedCloudServicesDeleteOptionalParams, + PatchPayload, + DedicatedCloudServicesUpdateOptionalParams, + DedicatedCloudServicesUpdateResponse +} from "../models"; + +/// +/** Interface representing a DedicatedCloudServices. */ +export interface DedicatedCloudServices { + /** + * Returns list of dedicated cloud services within a subscription + * @param options The options parameters. + */ + listBySubscription( + options?: DedicatedCloudServicesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns list of dedicated cloud services within a resource group + * @param resourceGroupName The name of the resource group + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DedicatedCloudServicesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns Dedicate Cloud Service + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + dedicatedCloudServiceName: string, + options?: DedicatedCloudServicesGetOptionalParams + ): Promise; + /** + * Create dedicate cloud service + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud Service name + * @param dedicatedCloudServiceRequest Create Dedicated Cloud Service request + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + dedicatedCloudServiceName: string, + dedicatedCloudServiceRequest: DedicatedCloudService, + options?: DedicatedCloudServicesCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete dedicate cloud service + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + dedicatedCloudServiceName: string, + options?: DedicatedCloudServicesDeleteOptionalParams + ): Promise, void>>; + /** + * Delete dedicate cloud service + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + dedicatedCloudServiceName: string, + options?: DedicatedCloudServicesDeleteOptionalParams + ): Promise; + /** + * Patch dedicated cloud service's properties + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @param dedicatedCloudServiceRequest Patch Dedicated Cloud Service request + * @param options The options parameters. + */ + update( + resourceGroupName: string, + dedicatedCloudServiceName: string, + dedicatedCloudServiceRequest: PatchPayload, + options?: DedicatedCloudServicesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/index.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..fb9725c0b4b2 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./dedicatedCloudNodes"; +export * from "./dedicatedCloudServices"; +export * from "./skusAvailability"; +export * from "./privateClouds"; +export * from "./customizationPolicies"; +export * from "./resourcePools"; +export * from "./virtualMachineTemplates"; +export * from "./virtualNetworks"; +export * from "./usages"; +export * from "./virtualMachines"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/operations.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..ffcad090ac54 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/operations.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AvailableOperation, + OperationsListOptionalParams, + OperationsGetOptionalParams, + OperationsGetResponse +} from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Return list of operations + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Return an async operation + * @param regionId The region Id (westus, eastus) + * @param operationId operation id + * @param options The options parameters. + */ + get( + regionId: string, + operationId: string, + options?: OperationsGetOptionalParams + ): Promise; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/privateClouds.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/privateClouds.ts new file mode 100644 index 000000000000..3b1e5f9e2348 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/privateClouds.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + PrivateCloud, + PrivateCloudsListOptionalParams, + PrivateCloudsGetOptionalParams, + PrivateCloudsGetResponse +} from "../models"; + +/// +/** Interface representing a PrivateClouds. */ +export interface PrivateClouds { + /** + * Returns list of private clouds in particular region + * @param regionId The region Id (westus, eastus) + * @param options The options parameters. + */ + list( + regionId: string, + options?: PrivateCloudsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns private cloud by its name + * @param pcName The private cloud name + * @param regionId The region Id (westus, eastus) + * @param options The options parameters. + */ + get( + pcName: string, + regionId: string, + options?: PrivateCloudsGetOptionalParams + ): Promise; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/resourcePools.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/resourcePools.ts new file mode 100644 index 000000000000..9fe1dccc363c --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/resourcePools.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ResourcePool, + ResourcePoolsListOptionalParams, + ResourcePoolsGetOptionalParams, + ResourcePoolsGetResponse +} from "../models"; + +/// +/** Interface representing a ResourcePools. */ +export interface ResourcePools { + /** + * Returns list of resource pools in region for private cloud + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param options The options parameters. + */ + list( + regionId: string, + pcName: string, + options?: ResourcePoolsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns resource pool templates by its name + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param resourcePoolName resource pool id (vsphereId) + * @param options The options parameters. + */ + get( + regionId: string, + pcName: string, + resourcePoolName: string, + options?: ResourcePoolsGetOptionalParams + ): Promise; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/skusAvailability.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/skusAvailability.ts new file mode 100644 index 000000000000..be8b823d8890 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/skusAvailability.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SkuAvailability, SkusAvailabilityListOptionalParams } from "../models"; + +/// +/** Interface representing a SkusAvailability. */ +export interface SkusAvailability { + /** + * Returns list of available resources in region + * @param regionId The region Id (westus, eastus) + * @param options The options parameters. + */ + list( + regionId: string, + options?: SkusAvailabilityListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/usages.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/usages.ts new file mode 100644 index 000000000000..d09eabffc2bc --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/usages.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Usage, UsagesListOptionalParams } from "../models"; + +/// +/** Interface representing a Usages. */ +export interface Usages { + /** + * Returns list of usage in region + * @param regionId The region Id (westus, eastus) + * @param options The options parameters. + */ + list( + regionId: string, + options?: UsagesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualMachineTemplates.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualMachineTemplates.ts new file mode 100644 index 000000000000..525f5de499ee --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualMachineTemplates.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + VirtualMachineTemplate, + VirtualMachineTemplatesListOptionalParams, + VirtualMachineTemplatesGetOptionalParams, + VirtualMachineTemplatesGetResponse +} from "../models"; + +/// +/** Interface representing a VirtualMachineTemplates. */ +export interface VirtualMachineTemplates { + /** + * Returns list of virtual machine templates in region for private cloud + * @param pcName The private cloud name + * @param regionId The region Id (westus, eastus) + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates + * @param options The options parameters. + */ + list( + pcName: string, + regionId: string, + resourcePoolName: string, + options?: VirtualMachineTemplatesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns virtual machine templates by its name + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param virtualMachineTemplateName virtual machine template id (vsphereId) + * @param options The options parameters. + */ + get( + regionId: string, + pcName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesGetOptionalParams + ): Promise; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualMachines.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualMachines.ts new file mode 100644 index 000000000000..c19aac48d72c --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualMachines.ts @@ -0,0 +1,191 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + VirtualMachine, + VirtualMachinesListBySubscriptionOptionalParams, + VirtualMachinesListByResourceGroupOptionalParams, + VirtualMachinesGetOptionalParams, + VirtualMachinesGetResponse, + VirtualMachinesCreateOrUpdateOptionalParams, + VirtualMachinesCreateOrUpdateResponse, + VirtualMachinesDeleteOptionalParams, + VirtualMachinesDeleteResponse, + PatchPayload, + VirtualMachinesUpdateOptionalParams, + VirtualMachinesUpdateResponse, + VirtualMachinesStartOptionalParams, + VirtualMachinesStopOptionalParams +} from "../models"; + +/// +/** Interface representing a VirtualMachines. */ +export interface VirtualMachines { + /** + * Returns list virtual machine within subscription + * @param options The options parameters. + */ + listBySubscription( + options?: VirtualMachinesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns list of virtual machine within resource group + * @param resourceGroupName The name of the resource group + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get virtual machine + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesGetOptionalParams + ): Promise; + /** + * Create Or Update Virtual Machine + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Create or Update Virtual Machine request + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineRequest: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesCreateOrUpdateResponse + > + >; + /** + * Create Or Update Virtual Machine + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Create or Update Virtual Machine request + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineRequest: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete virtual machine + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesDeleteResponse + > + >; + /** + * Delete virtual machine + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): Promise; + /** + * Patch virtual machine properties + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Patch virtual machine request + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineRequest: PatchPayload, + options?: VirtualMachinesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesUpdateResponse + > + >; + /** + * Patch virtual machine properties + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Patch virtual machine request + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineRequest: PatchPayload, + options?: VirtualMachinesUpdateOptionalParams + ): Promise; + /** + * Power on virtual machine + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param options The options parameters. + */ + beginStart( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise, void>>; + /** + * Power on virtual machine + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param options The options parameters. + */ + beginStartAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise; + /** + * Power off virtual machine, options: shutdown, poweroff, and suspend + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param options The options parameters. + */ + beginStop( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): Promise, void>>; + /** + * Power off virtual machine, options: shutdown, poweroff, and suspend + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param options The options parameters. + */ + beginStopAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): Promise; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualNetworks.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualNetworks.ts new file mode 100644 index 000000000000..844737a56c70 --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/operationsInterfaces/virtualNetworks.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + VirtualNetwork, + VirtualNetworksListOptionalParams, + VirtualNetworksGetOptionalParams, + VirtualNetworksGetResponse +} from "../models"; + +/// +/** Interface representing a VirtualNetworks. */ +export interface VirtualNetworks { + /** + * Return list of virtual networks in location for private cloud + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual networks + * @param options The options parameters. + */ + list( + regionId: string, + pcName: string, + resourcePoolName: string, + options?: VirtualNetworksListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Return virtual network by its name + * @param regionId The region Id (westus, eastus) + * @param pcName The private cloud name + * @param virtualNetworkName virtual network id (vsphereId) + * @param options The options parameters. + */ + get( + regionId: string, + pcName: string, + virtualNetworkName: string, + options?: VirtualNetworksGetOptionalParams + ): Promise; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimple.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimple.ts new file mode 100644 index 000000000000..aa54a4ee101c --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimple.ts @@ -0,0 +1,126 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + DedicatedCloudNodesImpl, + DedicatedCloudServicesImpl, + SkusAvailabilityImpl, + PrivateCloudsImpl, + CustomizationPoliciesImpl, + ResourcePoolsImpl, + VirtualMachineTemplatesImpl, + VirtualNetworksImpl, + UsagesImpl, + VirtualMachinesImpl +} from "./operations"; +import { + Operations, + DedicatedCloudNodes, + DedicatedCloudServices, + SkusAvailability, + PrivateClouds, + CustomizationPolicies, + ResourcePools, + VirtualMachineTemplates, + VirtualNetworks, + Usages, + VirtualMachines +} from "./operationsInterfaces"; +import { VMwareCloudSimpleOptionalParams } from "./models"; + +export class VMwareCloudSimple extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + referer: string; + + /** + * Initializes a new instance of the VMwareCloudSimple class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The subscription ID. + * @param referer referer url + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + referer: string, + options?: VMwareCloudSimpleOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + if (referer === undefined) { + throw new Error("'referer' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: VMwareCloudSimpleOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-vmwarecloudsimple/2.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + this.referer = referer; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2019-04-01"; + this.operations = new OperationsImpl(this); + this.dedicatedCloudNodes = new DedicatedCloudNodesImpl(this); + this.dedicatedCloudServices = new DedicatedCloudServicesImpl(this); + this.skusAvailability = new SkusAvailabilityImpl(this); + this.privateClouds = new PrivateCloudsImpl(this); + this.customizationPolicies = new CustomizationPoliciesImpl(this); + this.resourcePools = new ResourcePoolsImpl(this); + this.virtualMachineTemplates = new VirtualMachineTemplatesImpl(this); + this.virtualNetworks = new VirtualNetworksImpl(this); + this.usages = new UsagesImpl(this); + this.virtualMachines = new VirtualMachinesImpl(this); + } + + operations: Operations; + dedicatedCloudNodes: DedicatedCloudNodes; + dedicatedCloudServices: DedicatedCloudServices; + skusAvailability: SkusAvailability; + privateClouds: PrivateClouds; + customizationPolicies: CustomizationPolicies; + resourcePools: ResourcePools; + virtualMachineTemplates: VirtualMachineTemplates; + virtualNetworks: VirtualNetworks; + usages: Usages; + virtualMachines: VirtualMachines; +} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimpleClient.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimpleClient.ts deleted file mode 100644 index dfebce6d20b3..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimpleClient.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { VMwareCloudSimpleClientContext } from "./vMwareCloudSimpleClientContext"; - - -class VMwareCloudSimpleClient extends VMwareCloudSimpleClientContext { - // Operation groups - operations: operations.Operations; - dedicatedCloudNodes: operations.DedicatedCloudNodes; - dedicatedCloudServices: operations.DedicatedCloudServices; - skusAvailability: operations.SkusAvailability; - privateClouds: operations.PrivateClouds; - resourcePools: operations.ResourcePools; - virtualMachineTemplates: operations.VirtualMachineTemplates; - virtualNetworks: operations.VirtualNetworks; - usages: operations.Usages; - virtualMachines: operations.VirtualMachines; - - /** - * Initializes a new instance of the VMwareCloudSimpleClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The subscription ID. - * @param referer referer url - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, referer: string, options?: Models.VMwareCloudSimpleClientOptions) { - super(credentials, subscriptionId, referer, options); - this.operations = new operations.Operations(this); - this.dedicatedCloudNodes = new operations.DedicatedCloudNodes(this); - this.dedicatedCloudServices = new operations.DedicatedCloudServices(this); - this.skusAvailability = new operations.SkusAvailability(this); - this.privateClouds = new operations.PrivateClouds(this); - this.resourcePools = new operations.ResourcePools(this); - this.virtualMachineTemplates = new operations.VirtualMachineTemplates(this); - this.virtualNetworks = new operations.VirtualNetworks(this); - this.usages = new operations.Usages(this); - this.virtualMachines = new operations.VirtualMachines(this); - } -} - -// Operation Specifications - -export { - VMwareCloudSimpleClient, - VMwareCloudSimpleClientContext, - Models as VMwareCloudSimpleModels, - Mappers as VMwareCloudSimpleMappers -}; -export * from "./operations"; diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimpleClientContext.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimpleClientContext.ts deleted file mode 100644 index 4110fc980a0a..000000000000 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/src/vMwareCloudSimpleClientContext.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-vmwarecloudsimple"; -const packageVersion = "1.0.0"; - -export class VMwareCloudSimpleClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - subscriptionId: string; - apiVersion?: string; - referer: string; - - /** - * Initializes a new instance of the VMwareCloudSimpleClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The subscription ID. - * @param referer referer url - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, referer: string, options?: Models.VMwareCloudSimpleClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - if (referer == undefined) { - throw new Error('\'referer\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2019-04-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - this.referer = referer; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/test/sampleTest.ts b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/tsconfig.json b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/tsconfig.json +++ b/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/vmwarecloudsimple/ci.yml b/sdk/vmwarecloudsimple/ci.yml new file mode 100644 index 000000000000..184de02d6b46 --- /dev/null +++ b/sdk/vmwarecloudsimple/ci.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/vmwarecloudsimple/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/vmwarecloudsimple/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: vmwarecloudsimple + Artifacts: + - name: azure-arm-vmwarecloudsimple + safeName: azurearmvmwarecloudsimple + \ No newline at end of file